@arcgis/core 4.34.0-next.89 → 4.34.0-next.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Components/featureUtils.d.ts +2 -0
- package/applications/Components/featureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{eada3483116a5ea8baed.js → 004c2a1a37b99a184b13.js} +1 -1
- package/assets/esri/core/workers/chunks/{23f54b49742098def8ae.js → 00ee2a605c30744f415a.js} +1 -1
- package/assets/esri/core/workers/chunks/024063fe2bbb27899094.js +1 -0
- package/assets/esri/core/workers/chunks/0271a2ca4e9b1e4fd284.js +1 -0
- package/assets/esri/core/workers/chunks/0328eaea66c1db98da1c.js +1 -0
- package/assets/esri/core/workers/chunks/04bac7bb3f794b33e2e4.js +1 -0
- package/assets/esri/core/workers/chunks/{8380a092ffc8e92ede7a.js → 05072093e0209ef5db20.js} +1 -1
- package/assets/esri/core/workers/chunks/{b53008c1461dd6bacc63.js → 06221ebadab32111e2c6.js} +1 -1
- package/assets/esri/core/workers/chunks/06aed0a5464965be8d52.js +1 -0
- package/assets/esri/core/workers/chunks/{67fdc8074cdcf374af9a.js → 07a7ca89ef2ca4fc090b.js} +1 -1
- package/assets/esri/core/workers/chunks/0810dbbf348a927392e7.js +1 -0
- package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +1 -0
- package/assets/esri/core/workers/chunks/0856cd281efd71bfe3c4.js +1 -0
- package/assets/esri/core/workers/chunks/08957e462d06c4dc8ab5.js +1 -0
- package/assets/esri/core/workers/chunks/0aaaf4d1c4a5d284216e.js +1 -0
- package/assets/esri/core/workers/chunks/{3c0990c4be06a2fd51e9.js → 0ca5060c81a1a05b8be3.js} +1 -1
- package/assets/esri/core/workers/chunks/0ceb68ff73e5d39e837a.js +1 -0
- package/assets/esri/core/workers/chunks/{998d164b3e0b99a0ff1e.js → 0e5e565df6ec71445f2e.js} +1 -1
- package/assets/esri/core/workers/chunks/0f4e9846d074864b39c2.js +1 -0
- package/assets/esri/core/workers/chunks/100a0041ee42b0b2fa32.js +1 -0
- package/assets/esri/core/workers/chunks/1194c2432c31def87db1.js +1 -0
- package/assets/esri/core/workers/chunks/{2896ada406074f754b00.js → 1214c126af0de25a4b4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{978ffde9ebebf5c83aea.js → 14114be3afd6d292f89c.js} +1 -1
- package/assets/esri/core/workers/chunks/{4dd4b19c410026233999.js → 142c45ad68eecaf3fc7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b2f1fcd50dea017d891.js → 147f6e7b147beaa4ed29.js} +1 -1
- package/assets/esri/core/workers/chunks/155dcbd957f8787a45c3.js +1 -0
- package/assets/esri/core/workers/chunks/{d5363e5637d37e89a25f.js → 18e9cb71fa020e93d139.js} +1 -1
- package/assets/esri/core/workers/chunks/19bd0b56d82446dbb7c5.js +1 -0
- package/assets/esri/core/workers/chunks/{96de78f9994207aa7201.js → 1bbc0dfad4cd72a1c42b.js} +1 -1
- package/assets/esri/core/workers/chunks/{914eaed113dda727eb47.js → 20988e116f3723228f36.js} +1 -1
- package/assets/esri/core/workers/chunks/{831a69e5a87e92830fbe.js → 21f37a4b8d1857369203.js} +1 -1
- package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +1 -0
- package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +1 -0
- package/assets/esri/core/workers/chunks/2870723d57aa7b885896.js +1 -0
- package/assets/esri/core/workers/chunks/28bb6896c5fd353ca5e9.js +1 -0
- package/assets/esri/core/workers/chunks/2b867cec6ada339f1c8f.js +1 -0
- package/assets/esri/core/workers/chunks/{709dc98379f4ce18a0b5.js → 31186e83fe009aa0fd36.js} +1 -1
- package/assets/esri/core/workers/chunks/{c779c8b98e07fa881c1d.js → 348c871657b0af621c33.js} +1 -1
- package/assets/esri/core/workers/chunks/35ca317490540fae437c.js +1 -0
- package/assets/esri/core/workers/chunks/{c5fe356fc5b8b7be0d31.js → 375f20f2e91d6a7507e8.js} +1 -1
- package/assets/esri/core/workers/chunks/3807d0b9b1894731174d.js +1 -0
- package/assets/esri/core/workers/chunks/38d874d7f815f5329420.js +1 -0
- package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +1 -0
- package/assets/esri/core/workers/chunks/3c3b1dc95f03082e4d5b.js +1 -0
- package/assets/esri/core/workers/chunks/3dcdbba706a8034b6ba3.js +1 -0
- package/assets/esri/core/workers/chunks/{834985ec601623df34a1.js → 3e11a893271caa11a881.js} +1 -1
- package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +1 -0
- package/assets/esri/core/workers/chunks/{b246ed6d86c2c8df56fb.js → 41f275401e1cde7eee20.js} +1 -1
- package/assets/esri/core/workers/chunks/{595593dd03bcfba795c8.js → 4660798b3b45dcb5cecb.js} +2 -2
- package/assets/esri/core/workers/chunks/{69ae235423f0b1bdfcb4.js → 48c8ef4170e803a564d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c90830ee562b5ddc4f8b.js → 49e6219dd08cb6c27023.js} +1 -1
- package/assets/esri/core/workers/chunks/{00bbd37910c70989b54d.js → 4d0e099f34639cda3a9b.js} +1 -1
- package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +1 -0
- package/assets/esri/core/workers/chunks/{d1fc2c6e95fe2572d297.js → 50d9f69d5255af4b29bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{300b96f0f8e34b4a5d8b.js → 56de25a6fe659a5b5c2b.js} +1 -1
- package/assets/esri/core/workers/chunks/57c08ccb75e3135978d1.js +1 -0
- package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +1 -0
- package/assets/esri/core/workers/chunks/{d8494617cebc68e50d35.js → 5b7a2ee44883b1fb2a5f.js} +1 -1
- package/assets/esri/core/workers/chunks/5caf49e679ed0c27e0bd.js +1 -0
- package/assets/esri/core/workers/chunks/{f5c821ca2911a5103c9a.js → 5d15ca055071d7db6de8.js} +1 -1
- package/assets/esri/core/workers/chunks/{59139347495988b19061.js → 61a9ffd4cf07d8bb7a9b.js} +1 -1
- package/assets/esri/core/workers/chunks/61e8e159f1f336569b27.js +1 -0
- package/assets/esri/core/workers/chunks/{88b8f33ce1cbf8a0f855.js → 633faa9cec8988ab06af.js} +4 -4
- package/assets/esri/core/workers/chunks/648c91a9822bc9d6ee47.js +1 -0
- package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +1 -0
- package/assets/esri/core/workers/chunks/{d2371f5034b2a32e2523.js → 6cfa0967045068ce8a8b.js} +1 -1
- package/assets/esri/core/workers/chunks/{28d30be414e59eabd963.js → 70c8f69eed14d55c5cf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdc8300b6374ef2b8b3e.js → 74881340e040bfd0580f.js} +1 -1
- package/assets/esri/core/workers/chunks/{8be81e1530b952c97936.js → 768ae52b4e5c3e571ef5.js} +1 -1
- package/assets/esri/core/workers/chunks/{b43473e84b3f7fa2634d.js → 77e611724a499d36eacc.js} +1 -1
- package/assets/esri/core/workers/chunks/7f8b85de079614b9c336.js +1 -0
- package/assets/esri/core/workers/chunks/{9280edff80fd87860a5e.js → 80a155496deef2c02a3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7db105f6b688b6da8106.js → 82ba4140e30f083fbc87.js} +1 -1
- package/assets/esri/core/workers/chunks/{672c04d48aa51f16e9b7.js → 8a6052b4d163d5088e11.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b35b30495145bf8dd5d.js → 8ff2daef892881ff2019.js} +1 -1
- package/assets/esri/core/workers/chunks/9a855a10798348a21bab.js +1 -0
- package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +1 -0
- package/assets/esri/core/workers/chunks/9d9a639f7388a29e7c96.js +1 -0
- package/assets/esri/core/workers/chunks/{813efde41e90e652b7db.js → 9f2a3f37fe9b19ef1209.js} +1 -1
- package/assets/esri/core/workers/chunks/a1a7b0e7ca488c895cb7.js +1 -0
- package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +1 -0
- package/assets/esri/core/workers/chunks/{d3fd11da3a823e148957.js → ab88577987cf2fe1cb32.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6767d75e718f2e1e714.js → ad9606164c694af0c61f.js} +1 -1
- package/assets/esri/core/workers/chunks/b18887a6dc86f0c8324a.js +1 -0
- package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +1 -0
- package/assets/esri/core/workers/chunks/{481c2b01e2fe92249698.js → b265472ac3f949a7f40c.js} +1 -1
- package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +1 -0
- package/assets/esri/core/workers/chunks/{4094cebc4b92c52f4e27.js → b48abbf877e26ed1a4f8.js} +1 -1
- package/assets/esri/core/workers/chunks/b510c07dfd0d31683b08.js +1 -0
- package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +1 -0
- package/assets/esri/core/workers/chunks/b8f55ee77ab6ea4c289e.js +1 -0
- package/assets/esri/core/workers/chunks/{ccd157ede169b93eea65.js → bb0a1be03bb9d621432c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdae43a97537093e4b97.js → bdf0ab95401c6d8fbc7d.js} +1 -1
- package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +1 -0
- package/assets/esri/core/workers/chunks/{365d63c2aed3a49918f2.js → c27783ce7ea51a5e49c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce937ff0dd1147ea297e.js → c3020747f9001ca6a6e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{516864fb68025acc7db6.js → c547692862df95d22818.js} +1 -1
- package/assets/esri/core/workers/chunks/c5c6a32a24005478c976.js +1 -0
- package/assets/esri/core/workers/chunks/{e4acc3c2b6d865ed1940.js → c7c76a8a1c47eb62bef1.js} +1 -1
- package/assets/esri/core/workers/chunks/{58422c616a824ab49218.js → c84665db250b05e2829d.js} +1 -1
- package/assets/esri/core/workers/chunks/cb6a9b43406f4fbe10b2.js +1 -0
- package/assets/esri/core/workers/chunks/{cef9ff811221a7c3812c.js → cb90cfa35d77ab561939.js} +1 -1
- package/assets/esri/core/workers/chunks/ced12ad98f8f48d0dc00.js +1 -0
- package/assets/esri/core/workers/chunks/{bd451668c4ce9f7d7128.js → d56548a994753b08403c.js} +1 -1
- package/assets/esri/core/workers/chunks/{251b7f2e295ce191eb62.js → da4163b4f9b34e83c92d.js} +1 -1
- package/assets/esri/core/workers/chunks/{43fba9d6be5971ec20a9.js → e0017c6739d2532793e6.js} +1 -1
- package/assets/esri/core/workers/chunks/e22b400636094fc7b6c0.js +1 -0
- package/assets/esri/core/workers/chunks/{0296ebe8e37e30af771c.js → e2fdc4dc1ab9decd731e.js} +1 -1
- package/assets/esri/core/workers/chunks/e34136ad9d620cb845fd.js +1 -0
- package/assets/esri/core/workers/chunks/e537e1d37f3fcb14fce2.js +1 -0
- package/assets/esri/core/workers/chunks/e5baa30944061418cb13.js +1 -0
- package/assets/esri/core/workers/chunks/edef1e2254c992459c63.js +1 -0
- package/assets/esri/core/workers/chunks/{109149c378aa4c5f8526.js → eea9d49d55c2d1355497.js} +1 -1
- package/assets/esri/core/workers/chunks/{3245663da75e168bf85c.js → ef75cad6570b14a42b62.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a2a925c45d5fd58628b.js → f3284d4e0d41efb0b4a0.js} +1 -1
- package/assets/esri/core/workers/chunks/f62717338075df626eda.js +1 -0
- package/assets/esri/core/workers/chunks/{d07d3b0e06f12aee4a8b.js → f6ce485c082d0d640b01.js} +1 -1
- package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +1 -0
- package/assets/esri/core/workers/chunks/{69e6000044bfb03776ac.js → fd34c033ce7f16835368.js} +1 -1
- package/assets/esri/core/workers/chunks/fdadf11f31384c09db9f.js +1 -0
- package/assets/esri/core/workers/chunks/{80bd5988180f4618fd61.js → ff6d189ba78980d40bb5.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bg.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ca.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_cs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_da.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_de.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_el.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_es.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_et.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_he.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hu.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_id.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_it.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ja.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ko.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lt.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_nl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_no.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ro.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ru.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_th.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_tr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_uk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_vi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-TW.json +1 -1
- package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
- package/chunks/Distance2DCalculator-CXhBP-8I.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/GlowBlur.glsl.js +5 -5
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OITBlend.glsl.js +9 -7
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/geohash/geohashUtils.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/json/projectOperator.js +5 -0
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/operators/support/geographicTransformationUtils.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +5 -0
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/GeographicTransformation.js +1 -1
- package/geometry/support/GeographicTransformationStep.js +1 -1
- package/interfaces.d.ts +359 -0
- package/intl/date.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/support/DateTimeFieldFormat.d.ts +4 -0
- package/layers/support/FieldConfiguration.d.ts +4 -0
- package/layers/support/NumberFieldFormat.d.ts +4 -0
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +4 -0
- package/views/3d/{support/flow/VisualQuery3D.js → analysis/VolumeMeasurement/VolumeMeasurementError.js} +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/FlowQuery3D.js +5 -0
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/0103b70126bc5dffc55e.js +0 -1
- package/assets/esri/core/workers/chunks/03ef19f0753d68770444.js +0 -1
- package/assets/esri/core/workers/chunks/050429f516149ce3b517.js +0 -1
- package/assets/esri/core/workers/chunks/09f1a27442bdd52cdeb7.js +0 -1
- package/assets/esri/core/workers/chunks/0fadd1defbb6743dacdc.js +0 -1
- package/assets/esri/core/workers/chunks/124f8757ea18bfd158ec.js +0 -1
- package/assets/esri/core/workers/chunks/135142f3cbfaf24949bc.js +0 -1
- package/assets/esri/core/workers/chunks/138c11b5eca621e51396.js +0 -1
- package/assets/esri/core/workers/chunks/14743a962e661babe0a4.js +0 -1
- package/assets/esri/core/workers/chunks/1bf17c6548ac4cd5a166.js +0 -1
- package/assets/esri/core/workers/chunks/1d9212a70df68a508dca.js +0 -1
- package/assets/esri/core/workers/chunks/213e82a7e3fa5b253ec1.js +0 -1
- package/assets/esri/core/workers/chunks/3b23c37e5bc552dc81d4.js +0 -1
- package/assets/esri/core/workers/chunks/3d68a650a1f944ec5171.js +0 -1
- package/assets/esri/core/workers/chunks/451555af283b32a10fef.js +0 -1
- package/assets/esri/core/workers/chunks/48913b944c28343816ac.js +0 -1
- package/assets/esri/core/workers/chunks/4e6e8dda6c12f6fbed8e.js +0 -1
- package/assets/esri/core/workers/chunks/4e77b9cc1d9437bcbb0c.js +0 -1
- package/assets/esri/core/workers/chunks/5019f1b8186a65a0313b.js +0 -1
- package/assets/esri/core/workers/chunks/547af4ffbeeccba9d187.js +0 -1
- package/assets/esri/core/workers/chunks/589a0e244ef5f1b84ab6.js +0 -1
- package/assets/esri/core/workers/chunks/59e27818cb68f0285d54.js +0 -1
- package/assets/esri/core/workers/chunks/5e1d6704ee0aa41b1d06.js +0 -1
- package/assets/esri/core/workers/chunks/6b0baecbd35d26393dcf.js +0 -1
- package/assets/esri/core/workers/chunks/6dafb2b95bae552c1cc2.js +0 -1
- package/assets/esri/core/workers/chunks/71df48968d6cdc736458.js +0 -1
- package/assets/esri/core/workers/chunks/773d106f60f7dad1493d.js +0 -1
- package/assets/esri/core/workers/chunks/79c4f10da8360ee60cd2.js +0 -1
- package/assets/esri/core/workers/chunks/7aa7aff6d42be7c2d1d2.js +0 -1
- package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +0 -1
- package/assets/esri/core/workers/chunks/84a556dafd583635ad5e.js +0 -1
- package/assets/esri/core/workers/chunks/885a398de8a33d36c59e.js +0 -1
- package/assets/esri/core/workers/chunks/8bd6c27a93a697a7fa3d.js +0 -1
- package/assets/esri/core/workers/chunks/8be9fa12e854a83062c3.js +0 -1
- package/assets/esri/core/workers/chunks/9386a0ebff78b6303ed2.js +0 -1
- package/assets/esri/core/workers/chunks/9673e25114fc1897460d.js +0 -1
- package/assets/esri/core/workers/chunks/96a14689815bec741308.js +0 -1
- package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +0 -1
- package/assets/esri/core/workers/chunks/97d71459ad72b4b780a3.js +0 -1
- package/assets/esri/core/workers/chunks/a1abe9865d66789bd5af.js +0 -1
- package/assets/esri/core/workers/chunks/a7ea2e3895046e566bc6.js +0 -1
- package/assets/esri/core/workers/chunks/a96e58ed9a4a2329ee53.js +0 -1
- package/assets/esri/core/workers/chunks/aa778e5d7db40d9b9b4a.js +0 -1
- package/assets/esri/core/workers/chunks/acb49f3d2b783e81a215.js +0 -1
- package/assets/esri/core/workers/chunks/b0a03b6edbcf6e933431.js +0 -1
- package/assets/esri/core/workers/chunks/bc83bcfe123525d21884.js +0 -1
- package/assets/esri/core/workers/chunks/bd028badc07270eda3d0.js +0 -1
- package/assets/esri/core/workers/chunks/be8dd8e68c8805300ad1.js +0 -1
- package/assets/esri/core/workers/chunks/c1d75c48558ed23c5b2b.js +0 -1
- package/assets/esri/core/workers/chunks/c24214666d10cb648428.js +0 -1
- package/assets/esri/core/workers/chunks/c3010d783506f8410f99.js +0 -1
- package/assets/esri/core/workers/chunks/d0296368ae143de4d5ce.js +0 -1
- package/assets/esri/core/workers/chunks/d51aabb9b950f49df183.js +0 -1
- package/assets/esri/core/workers/chunks/d8a0eb143b2079d7b6b7.js +0 -1
- package/assets/esri/core/workers/chunks/dca2b487152cde45fb65.js +0 -1
- package/assets/esri/core/workers/chunks/e760b8ca64d67c04d98a.js +0 -1
- package/assets/esri/core/workers/chunks/ee78a38a0cacb19b2fd4.js +0 -1
- package/assets/esri/core/workers/chunks/f5710ced8d38f9a90fc5.js +0 -1
- package/assets/esri/core/workers/chunks/f592c4e5e1746d4619db.js +0 -1
- package/assets/esri/core/workers/chunks/f8d2c52cc51d5f1bbce2.js +0 -1
- package/assets/esri/core/workers/chunks/f9decc88561c03aca3c9.js +0 -1
- package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +0 -1
- package/assets/esri/core/workers/chunks/ffee8cc83d703c1dc0c0.js +0 -1
- package/chunks/CompositeGeographicTransformation.js +0 -5
- package/chunks/GeographicTransformation.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{G as s,a as i,j as n,t as r,k as m,e as o,l as a,m as h,f as l,d as c,g as u}from"./Geometry.js";import{G as f}from"./SimpleGeometryCursor.js";import{C as _,c as g,P as d,E as p,s as b}from"./Envelope.js";import{i as y,m as P,P as x,h as C,d as D,a as w}from"./Point2D.js";import{L as T,D as v,a as S,P as I,i as M,E,n as V}from"./MultiPathImpl.js";import{Envelope2D as k}from"./Envelope2D.js";import{T as B}from"./Transformation2D.js";import{c as R}from"./GeometryCleaner-BEJM7I4l.js";import{W as A,L as X,a3 as Y}from"./UnitFactory.js";import{O as F}from"./OperatorSimplifyOGC.js";import{O as L}from"./OperatorGeneralize.js";var q;function z(e,t,s,i,n,r){return{m_from:e.clone(),m_to:t.clone(),m_center:s.clone(),m_next:n,m_type:i}}function j(e,t,s,i,n){return{m_from:e.clone(),m_to:t.clone(),m_next:s,m_type:4,m_center:new x}}!function(e){e[e.enumDummy=256]="enumDummy",e[e.enumLine=1]="enumLine",e[e.enumArc=2]="enumArc",e[e.enumMiter=8]="enumMiter",e[e.enumBevel=16]="enumBevel",e[e.enumJoinMask=26]="enumJoinMask",e[e.enumConnectionMask=27]="enumConnectionMask"}(q||(q={}));class G extends f{constructor(e,t,s,i,n,r,m,o,a,h){super(),this.m_index=0,this.m_bufferedPolygon=null,this.m_x=0,this.m_y=0,this.m_progressTracker=h,this.m_parent=e,this.m_mp=t,this.m_distance=s,this.m_spatialReference=i,this.m_densifyDist=o,this.m_maxVertexInCompleteCircle=a,this.m_joins=n,this.m_caps=r,this.m_miterLimit=m}next(){const e=new d;for(;;){if(this.m_index===this.m_mp.getPointCount())return null;if(1===this.m_caps)return this.m_index=this.m_mp.getPointCount(),new S({vd:this.m_mp.getDescription()});if(this.m_mp.getPointByVal(this.m_index,e),this.m_index++,!e.isEmpty())break}let t,s=!1;if(null===this.m_bufferedPolygon&&(this.m_x=e.getX(),this.m_y=e.getY(),this.m_bufferedPolygon=this.m_parent.buffer(e,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle),s=!0),t=this.m_index<this.m_mp.getPointCount()?this.m_bufferedPolygon.clone():this.m_bufferedPolygon,!s){const s=new B,i=e.getX()-this.m_x,n=e.getY()-this.m_y;s.setShiftCoords(i,n),t.applyTransformation(s)}return b(t,0),t}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class N extends f{constructor(e){super(),this.m_currentPathIndex=0,this.m_polyline=e}next(){if(!this.m_polyline)return null;const e=this.m_polyline.getImpl(),t=e.getPathCount();if(this.m_currentPathIndex<t){const t=this.m_currentPathIndex;if(this.m_currentPathIndex++,!e.isClosedPathInXYPlane(t)){let s=e.getXY(e.getPathEnd(t)-1);for(;this.m_currentPathIndex<e.getPathCount();){const t=e.getXY(e.getPathStart(this.m_currentPathIndex));if(e.isClosedPathInXYPlane(this.m_currentPathIndex))break;if(!t.equals(s))break;s=e.getXY(e.getPathEnd(this.m_currentPathIndex)-1),this.m_currentPathIndex++}}if(0===t&&this.m_currentPathIndex===this.m_polyline.getPathCount()){const e=this.m_polyline;return this.m_polyline=null,e}const s=new I({vd:this.m_polyline.getDescription()});s.addPath(this.m_polyline,t,!0);for(let i=t+1;i<this.m_currentPathIndex;i++)s.addSegmentsFromPath(this.m_polyline,i,0,e.getSegmentCountPath(i),!1);return this.m_currentPathIndex===this.m_polyline.getPathCount()&&(this.m_polyline=null),s}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class O extends f{constructor(e,t,s){super(),this.m_geometry=null,this.m_index=0,this.m_bufferer=e,this.m_geoms=t,this.m_index=0,this.m_bFilter=s}next(){if(null===this.m_geometry&&(this.m_index=0,this.m_geometry=this.m_geoms.next(),!this.m_geometry))return null;const e=this.m_geometry.getImpl();if(this.m_index<e.getPathCount()){const e=this.m_index;this.m_index++;return this.m_bufferer.bufferPolylinePath(this.m_geometry,e,this.m_bFilter)}return this.m_geometry=null,this.next()}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class U extends f{constructor(e){super(),this.m_index=0,this.m_bufferer=e}next(){const e=this.m_bufferer.m_geometry;if(this.m_index<e.getPathCount()){const t=this.m_index,s=e.calculateRingArea2D(this.m_index);for(u(s>0),this.m_index++;this.m_index<e.getPathCount();){if(e.calculateRingArea2D(this.m_index)>0)break;this.m_index++}let i;return i=0===t&&this.m_index===e.getPathCount()?this.m_bufferer.bufferPolygonImpl(e,0,e.getPathCount()):this.m_bufferer.bufferPolygonImpl(e,t,this.m_index),i}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class J{constructor(e){this.m_geometry=null,this.m_bufferCommands=[],this.m_originalGeomType=s.enumUnknown,this.m_maxVertexInCompleteCircle=-1,this.m_circleTemplateSize=-1,this.m_oldCircleTemplateSize=0,this.m_spatialReference=null,this.m_tolerance=new _(0,0),this.m_smallTolerance=new _(0,0),this.m_filterTolerance=0,this.m_densifyDist=-1,this.m_distance=Number.NaN,this.m_absDistance=0,this.m_absDistanceReversed=0,this.m_dA=-1,this.m_miterLimit=4,this.m_joins=0,this.m_caps=0,this.m_bRoundBuffer=!0,this.m_bOutputLoops=!0,this.m_bFilter=!0,this.m_circleTemplate=[],this.m_leftStack=[],this.m_middleStack=[],this.m_helperLine1=new T,this.m_helperLine2=new T,this.m_helperArray=[],this.m_progressCounter=0,this.m_densificator=v.constructDefault(e),this.m_progressTracker=e}buffer(e,t,s,l,c,u,f,_){if(e||i("Geometry.Bufferer.Impl.Buffer"),f<0&&i("Geometry.Bufferer.Impl.Buffer"),n(e.getGeometryType())&&r("Unsupported geometry type."),e.isEmpty())return new S({vd:e.getDescription()});if(this.m_joins=l,this.m_caps=c,this.m_bRoundBuffer=!1,this.m_miterLimit=u,this.m_originalGeomType=e.getGeometryType(),m(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_joins:o(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_caps:a(this.m_originalGeomType)&&(this.m_bRoundBuffer=0===this.m_joins&&0===this.m_caps),this.m_bFilter=this.m_bRoundBuffer,this.m_geometry=R(e),this.m_geometry.isEmpty())return new S({vd:e.getDescription()});const d=new k;this.m_geometry.queryLooseEnvelope(d),t>0&&d.inflateCoords(t,t),this.m_tolerance=g(s,d,!0),this.m_smallTolerance=g(null,d,!0),_<=0&&(_=96),this.m_spatialReference=s,this.m_distance=t,this.m_absDistance=Math.abs(this.m_distance),this.m_absDistanceReversed=0!==this.m_absDistance?1/this.m_absDistance:0,Number.isNaN(f)||0===f?f=1e-5*this.m_absDistance:f>.5*this.m_absDistance&&(f=.5*this.m_absDistance),_<12&&(_=12);const p=Math.abs(t)*(1-Math.cos(Math.PI/_));if(p>f)f=p;else if(0!==t){const e=Math.PI/Math.acos(1-f/Math.abs(t));e<_-1&&(_=Math.trunc(e))<12&&(_=12,f=Math.abs(t)*(1-Math.cos(Math.PI/_)))}this.m_densifyDist=f,this.m_maxVertexInCompleteCircle=_,this.m_filterTolerance=this.m_bRoundBuffer?Math.min(this.m_smallTolerance.total(),.25*this.m_densifyDist):0,this.m_circleTemplateSize=this.calcN(),this.m_circleTemplateSize!==this.m_oldCircleTemplateSize&&(this.m_circleTemplate.length=0,this.m_oldCircleTemplateSize=this.m_circleTemplateSize),this.m_densifyDist>0&&h(this.m_geometry)&&(this.m_geometry=this.m_densificator.densifyEx(this.m_geometry,0,this.m_densifyDist,0,0!==this.m_joins,y()));const b=this.bufferImpl();return this.m_geometry=null,b}generateCircleTemplate(){if(this.m_circleTemplate.length)return;const e=this.m_circleTemplateSize,t=Math.trunc((e+3)/4),s=.5*Math.PI/t;this.m_dA=s,this.m_circleTemplate=P(x,4*t);const i=Math.cos(s),n=Math.sin(s),r=x.construct(0,1);for(let m=0;m<t;m++)this.m_circleTemplate[m+0*t].setCoords(r.y,-r.x),this.m_circleTemplate[m+1*t].setCoords(-r.x,-r.y),this.m_circleTemplate[m+2*t].setCoords(-r.y,r.x),this.m_circleTemplate[m+3*t].setCoords(r.x,r.y),r.rotateReverse(i,n)}bufferImpl(){const e=this.m_geometry.getGeometryType();if(l(e)){const e=new I({vd:this.m_geometry.getDescription()});return e.addSegment(this.m_geometry,!0),this.m_geometry=e,this.bufferImpl()}if(this.m_distance<=this.m_tolerance.total()){if(!m(e))return new S({vd:this.m_geometry.getDescription()});if(this.m_distance<0){const e=new k;if(this.m_geometry.queryEnvelope(e),e.width()<=2*this.m_absDistance||e.height()<=2*this.m_absDistance)return new S({vd:this.m_geometry.getDescription()})}}switch(this.m_geometry.getGeometryType()){case s.enumPoint:return this.bufferPoint();case s.enumMultiPoint:return this.bufferMultiPoint();case s.enumPolyline:return this.bufferPolyline();case s.enumPolygon:return this.bufferPolygon();case s.enumEnvelope:return this.bufferEnvelope();default:c("")}}bufferPolyline(){if(this.isDegenerateGeometry(this.m_geometry)){const e=new d;this.m_geometry.getPointByVal(0,e);const t=new k;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const e=this.m_geometry,t=this.m_geometry.getDescription();this.m_geometry=null;const s=new N(e);let i,n;i=0===this.m_joins?(new L).executeMany(s,.25*this.m_densifyDist,!1,this.m_progressTracker):s,n=this.m_bRoundBuffer?(new F).executeMany(i,null,!0,this.m_progressTracker):i;const r=new O(this,n,this.m_bFilter),m=(new A).executeMany(r,this.m_spatialReference,this.m_progressTracker,2),o=(new X).executeMany(m,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==o?o:new S({vd:t})}bufferPolygon(){if(0===this.m_distance)return this.m_geometry;this.generateCircleTemplate();const e=(new X).execute(this.m_geometry,null,!1,this.m_progressTracker);if(this.m_distance<0){if(this.m_geometry=e,this.m_geometry.isEmpty())return this.m_geometry;const t=this.m_geometry,s=this.bufferPolygonImpl(t,0,t.getPathCount());return(new X).execute(s,this.m_spatialReference,!1,this.m_progressTracker)}{if(this.m_geometry=e,this.isDegenerateGeometry(this.m_geometry)){const e=new d;this.m_geometry.getPointByVal(0,e);const t=new k;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const t=new U(this),s=(new A).executeMany(t,this.m_spatialReference,this.m_progressTracker,2),i=(new X).executeMany(s,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==i?i:new S({vd:this.m_geometry.getDescription()})}}bufferPolygonImpl(e,t,s){const i=e,n=i.getImpl();let r=new S({vd:e.getDescription()});for(let m=t;m<s;m++){if(n.getPathSize(m)<1)continue;const t=n.calculateRingArea2D(m),s=new k;if(n.queryPathEnvelope(m,s),this.m_distance>0)if(t>0)if(this.isDegeneratePath(n,m)){const e=new d;n.getPointByVal(n.getPathStart(m),e),e.setXY(s.getCenter()),r.add(this.bufferDegeneratePath(e,!0),!1)}else{const t=new I({vd:e.getDescription()}),s=t.getImpl();if(M(this.m_geometry,m)){const e=this.bufferConvexPath(i,m);r.add(e,!1)}else{this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,1);const e=this.bufferCleanup(t);r.add(e,!1)}}else{if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new I({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,1),!t.isEmpty()){const e=s,n=Math.max(1,this.m_absDistance),m=e.clone();m.inflateCoords(n,n),i.addEnvelope(m,!1);const o=this.bufferCleanup(t);r.reserve(r.getPointCount()+o.getPointCount()-4),ee(o,r,m,!0)}}else if(t>0){if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new I({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,-1),!t.isEmpty()){const e=new k;i.queryLooseEnvelope(e);const s=Math.max(1,this.m_absDistance),n=e.clone();n.inflateCoords(s,s),i.addEnvelope(n,!1);ee(this.bufferCleanup(t),r,n,!0)}}else{const t=new I({vd:e.getDescription()}),s=t.getImpl();this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,-1);const i=this.bufferCleanup(t);for(let e=0,n=i.getPathCount();e<n;e++)r.addPath(i,e,!0)}}if(this.m_distance>0){if(r.getPathCount()>1){return this.bufferCleanup(r)}return W(r)}{const e=new k;if(r.queryLooseEnvelope(e),r.isEmpty())return W(r);{const t=Math.max(1,this.m_absDistance),s=e.clone();s.inflateCoords(t,t),r.addEnvelope(s,!1);const i=this.bufferCleanup(r);r=new S;const n=new S({vd:i.getDescription()});return ee(i,n,s,!1),W(n)}}}bufferPoint(){return this.bufferPointImpl(this.m_geometry)}bufferPointImpl(e){const t=new S({vd:e.getDescription()});return 0===this.m_caps?(this.addCircle(t.getImpl(),e),this.setStrongSimple(t)):2===this.m_caps?(this.addSquare(t.getImpl(),e),this.setStrongSimple(t)):t}bufferDegeneratePath(e,t){const s=new S({vd:e.getDescription()});return t&&0===this.m_joins||!t&&0===this.m_caps?(this.addCircle(s.getImpl(),e),this.setStrongSimple(s)):t||2!==this.m_caps?s:(this.addSquare(s.getImpl(),e),this.setStrongSimple(s))}bufferMultiPoint(){const e=new G(this,this.m_geometry,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle,this.m_progressTracker);return(new A).executeMany(e,this.m_spatialReference,this.m_progressTracker,2).next()}bufferEnvelope(){let e=new S({vd:this.m_geometry.getDescription()});if(this.m_distance<=0){if(0===this.m_distance)e.addEnvelope(this.m_geometry,!1),H(this.m_geometry,this.m_tolerance.total())&&(e=this.setStrongSimple(e));else{const t=new p;this.m_geometry.queryEnvelope(t),t.inflateCoords(this.m_distance,this.m_distance),e.addEnvelope(t,!1),H(t,this.m_tolerance.total())&&(e=this.setStrongSimple(e))}return e}if(1===this.m_joins){const t=new p({copy:this.m_geometry});return t.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(t,!1),e}const t=this.m_geometry.clone();if(0===t.width()||0===t.height()){if(0===t.width()&&0===t.height()){const e=new d({vd:this.m_geometry.getDescription()});return t.queryCornerByVal(0,e),this.m_geometry=e,this.bufferImpl()}const e=new I({vd:this.m_geometry.getDescription()}),s=new d;return t.queryCornerByVal(0,s),e.startPathPoint(s),t.queryCornerByVal(2,s),e.lineToPoint(s),this.m_geometry=e,this.bufferImpl()}return e.addEnvelope(this.m_geometry,!1),this.m_geometry=e,this.bufferConvexPath(e,0)}bufferConvexPath(e,t){this.generateCircleTemplate();const s=e.hasAttribute(10),i=new S({vd:e.getDescription()}),n=i.getImpl();i.reserve((this.m_circleTemplate.length/10+4)*e.getPathSize(t));const r=new x,m=new x,o=new x,a=new x(0,0),h=new x,l=new x,u=e.getImpl(),f=e.getPathSize(t),_=e.getPathStart(t);for(let g=0,d=e.getPathSize(t);g<d;g++){const e=u.getXY(_+g),t=u.getXY(_+(g+1)%f),i=u.getXY(_+(g+2)%f);h.setSub(t,e),0===h.length()&&c("");const d=s&&!!(1&u.getAttributeAsInt(10,(g+1)%f,0));h.normalize();const p=h.clone();h.leftPerpendicularThis(),h.scale(this.m_absDistance),r.setAdd(h,e),m.setAdd(h,t),0===g?n.startPath(r):n.lineTo(r),n.lineTo(m),l.setSub(i,t),0===l.length()&&c(""),l.normalize();const b=l.clone();l.leftPerpendicularThis(),l.scale(this.m_absDistance),o.setAdd(l,t);let y=q.enumArc;const P=d?0:this.m_joins;if(2===P)y=q.enumBevel;else if(1===P){const e=-p.crossProduct(b);a.setSub(p,b),a.scale(this.m_absDistance/e),a.length()<this.m_miterLimit*this.m_absDistance?(a.addThis(t),y=q.enumMiter):y=q.enumBevel}else a.assign(t);this.addJoin(y,n,a,m,o,!1,!1)}return W(i)}bufferPolylinePath(e,t,s){this.generateCircleTemplate();const i=e,n=i.getImpl();if(n.getPathSize(t)<1)return null;let r;if(r=this.m_bRoundBuffer?n.isClosedPathInXYPlane(t):n.isClosedPath(t),this.isDegeneratePath(n,t)&&this.m_distance>0){const e=new d;n.getPointByVal(n.getPathStart(t),e);const s=new k;return n.queryPathEnvelope(t,s),e.setXY(s.getCenter()),this.bufferDegeneratePath(e,r)}const m=new I({vd:e.getDescription()});m.reserve((Math.trunc(this.m_circleTemplate.length/10)+4)*n.getPathSize(t));const o=m.getImpl();return r?2!==this.bufferClosedPath(i,t,o,s,1)&&this.bufferClosedPath(i,t,o,s,-1):this.bufferOpenPath(i,t,o,s),this.bufferCleanup(m)}progress_(){}bufferCleanup(e,t=!1){const s=t?this.m_tolerance:this.m_smallTolerance;return Y(e,s,!0,!t,-1,this.m_progressTracker,0,!1)}calcN(){const e=4;if(0===this.m_densifyDist)return this.m_maxVertexInCompleteCircle;const t=1-this.m_densifyDist*Math.abs(this.m_absDistanceReversed);let s=e;return s=t<-1?e:2*Math.PI/Math.acos(t)+.5,s<e?s=e:s>this.m_maxVertexInCompleteCircle&&(s=this.m_maxVertexInCompleteCircle),Math.trunc(s)}addJoin(e,t,s,i,n,r,m){if(this.generateCircleTemplate(),r&&(t.startPath(i),r=!1),e===q.enumBevel)return void(m&&t.lineTo(n));if(e===q.enumMiter){const e=s.clone();return t.lineTo(e),void(m&&t.lineTo(n))}const o=new x;o.setSub(i,s),o.scale(this.m_absDistanceReversed);const a=new x;a.setSub(n,s),a.scale(this.m_absDistanceReversed);let h=Math.atan2(o.y,o.x)/this.m_dA;h<0&&(h=this.m_circleTemplate.length+h),h=this.m_circleTemplate.length-h;let l=Math.atan2(a.y,a.x)/this.m_dA;l<0&&(l=this.m_circleTemplate.length+l),l=this.m_circleTemplate.length-l,l<h&&(l+=this.m_circleTemplate.length);let c=Math.trunc(l),u=Math.ceil(h),f=this.m_circleTemplate[u%this.m_circleTemplate.length].clone();f.scaleAddThis(this.m_absDistance,s);const _=10*this.m_tolerance.total();f.sub(i).length()<_&&(u+=1),f=this.m_circleTemplate[c%this.m_circleTemplate.length].clone(),f.scaleAddThis(this.m_absDistance,s),f.sub(n).length()<_&&(c-=1);let g=c-u;g++;for(let d=0,p=u%this.m_circleTemplate.length;d<g;d++,p=(p+1)%this.m_circleTemplate.length)f=this.m_circleTemplate[p].clone(),f.scaleAddThis(this.m_absDistance,s),t.lineTo(f),this.progress_();m&&t.lineTo(n)}bufferClosedPath(e,t,s,i,n){const r=new E,m=r.addPathFromMultiPath(e,t,!0);return this.bufferClosedPathImpl(r,m,s,i,n)}bufferClosedPathImpl(e,t,s,i,n){const r=e.getFirstVertex(e.getFirstPath(t)),m=new d;e.queryPoint(r,m),e.filterClosePoints(this.m_filterTolerance,!1,!1,!1,-1);if(e.getPointCount(t)<2)return n<0?0:(this.m_bRoundBuffer&&this.addCircle(s,m),2);u(e.getFirstPath(t)!==V),u(e.getFirstVertex(e.getFirstPath(t))!==V);const o=e.getXY(e.getFirstVertex(e.getFirstPath(t))),a=new B;if(a.setShift(o.negate()),e.applyTransformation(a),i){const i=$(e,t,n,!0,this.m_absDistance,this.m_filterTolerance,this.m_densifyDist);if(u(1===i),e.getPointCount(t)<2)return n<0?0:(this.addCircle(s,m),2)}const h=0!==this.m_joins&&e.getVertexDescription().hasAttribute(10);this.m_bufferCommands.length=0;const l=e.getFirstPath(t);let c=e.getFirstVertex(l),f=1===n?e.getPrevVertex(c):e.getNextVertex(c),_=1===n?e.getNextVertex(c):e.getPrevVertex(c),g=!0;const p=new x,b=new x,y=new x,P=new x,C=new x,D=new x,w=new x,T=new x,v=this.m_absDistance,S=e.getPathSize(l),I=new x(0,0);for(let u=0;u<S;u++){b.assign(e.getXY(_)),g&&(p.assign(e.getXY(c)),y.assign(e.getXY(f)),D.setSub(p,y),D.normalize(),T.leftPerpendicularOther(D),T.scale(v),P.setAdd(T,p));const t=h&&!!(1&e.getAttributeAsDbl(10,c,0));C.setSub(b,p),C.normalize(),w.leftPerpendicularOther(C),w.scale(v);const s=new x;s.setAdd(p,w);const i=D.crossProduct(C),r=D.dotProduct(C);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8){let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;I.setSub(D,C),I.scale(this.m_absDistance/t),I.length()<this.m_miterLimit*this.m_absDistance&&(I.addThis(p),e=!0),this.m_bufferCommands.push(z(P,s,I,e?q.enumMiter:q.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(z(P,s,p,0===n?q.enumArc:q.enumBevel,this.m_bufferCommands.length+1))}else P.equals(s)||(this.m_bufferCommands.push(j(P,p,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(j(p,s,this.m_bufferCommands.length+1)));const m=new x;m.setAdd(b,w),this.m_bufferCommands.push(z(s,m,p,q.enumLine,this.m_bufferCommands.length+1)),P.setCoordsPoint2D(m),T.setCoordsPoint2D(w),y.setCoordsPoint2D(p),p.setCoordsPoint2D(b),D.setCoordsPoint2D(C),f=c,c=_,g=!1,_=1===n?e.getNextVertex(c):e.getPrevVertex(c)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),a.setShift(o),s.applyTransformationToPath(a,s.getPathCount()-1),1}bufferOpenPath(e,t,s,i){if(this.m_bRoundBuffer){const n=new I({vd:e.getDescription()});return n.addPath(e,t,!1),n.addSegmentsFromPath(e,t,0,e.getSegmentCountPath(t),!1),this.bufferClosedPath(n,0,s,i,1)}let n=0;const r=new I({vd:e.getDescription()}),m=new x(0,0);{const i=new E,o=i.addPathFromMultiPath(e,t,!1),a=i.getFirstVertex(i.getFirstPath(o)),h=new d;i.queryPoint(a,h),m.assign(h.getXY()),i.filterClosePoints(0,!1,!1,!1,-1);if(i.getPointCount(o)<2)return this.m_bRoundBuffer&&this.addCircle(s,h),2;const l=i.getGeometry(i.getFirstGeometry());r.addPath(l,0,!1),n=r.getPointCount()-1,r.addSegmentsFromPath(l,0,0,l.getSegmentCountPath(0)-1,!1)}const o=new E,a=o.addPathFromMultiPath(r,0,!0);u(o.getFirstPath(a)!==V),u(o.getFirstVertex(o.getFirstPath(a))!==V);const h=new B;h.setShift(m.negate()),o.applyTransformation(h),this.m_bufferCommands.length=0;const l=o.getFirstPath(a),c=0!==this.m_joins&&o.getVertexDescription().hasAttribute(10);let f=o.getFirstVertex(l),_=o.getPrevVertex(f),g=o.getNextVertex(f),p=!0;const b=new x,y=new x,P=new x,C=new x,D=new x,w=new x,T=new x,v=new x,S=this.m_absDistance,M=o.getPathSize(l),k=new x(0,0);for(let u=0;u<M;u++){let e=!1;0!==u&&u!==n||(e=!0),y.assign(o.getXY(g)),p&&(b.assign(o.getXY(f)),P.assign(o.getXY(_)),w.setSub(b,P),w.normalize(),v.leftPerpendicularOther(w),v.scale(S),C.setAdd(v,b));const t=c&&!!(1&o.getAttributeAsDbl(10,f,0));D.setSub(y,b),D.normalize(),T.leftPerpendicularOther(D),T.scale(S);const s=new x;s.setAdd(b,T);const i=w.crossProduct(D),r=w.dotProduct(D);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8)if(e)if(0===this.m_caps)this.m_bufferCommands.push(z(C,s,b,q.enumArc,this.m_bufferCommands.length+1));else if(1===this.m_caps)this.m_bufferCommands.push(z(C,s,b,q.enumLine,this.m_bufferCommands.length+1));else{const e=D.mul(this.m_absDistance).negate(),t=e.clone();e.addThis(C),t.addThis(s),this.m_bufferCommands.push(z(C,e,b,q.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(z(e,t,b,q.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(z(t,s,b,q.enumLine,this.m_bufferCommands.length+1))}else{let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;k.setSub(w,D),k.scale(this.m_absDistance/t),k.length()<this.m_miterLimit*this.m_absDistance&&(k.addThis(b),e=!0),this.m_bufferCommands.push(z(C,s,k,e?q.enumMiter:q.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(z(C,s,b,0===n?q.enumArc:q.enumBevel,this.m_bufferCommands.length+1))}else C.equals(s)||(this.m_bufferCommands.push(j(C,b,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(j(b,s,this.m_bufferCommands.length+1)));const m=new x;m.setAdd(y,T),this.m_bufferCommands.push(z(s,m,b,q.enumLine,this.m_bufferCommands.length+1)),C.setCoordsPoint2D(m),v.setCoordsPoint2D(T),P.setCoordsPoint2D(b),b.setCoordsPoint2D(y),w.setCoordsPoint2D(D),_=f,f=g,p=!1,g=o.getNextVertex(f)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),h.setShift(m),s.applyTransformationToPath(h,s.getPathCount()-1),1}processBufferCommands(e){const t=this.cleanupBufferCommands();let s=!0,i=t+1;for(let n=t;i!==t;n=i){const t=this.m_bufferCommands[n];i=-1!==t.m_next?t.m_next:(n+1)%this.m_bufferCommands.length,t.m_type&&(s&&(e.startPath(t.m_from),s=!1),t.m_type&q.enumJoinMask?this.addJoin(t.m_type,e,t.m_center,t.m_from,t.m_to,!1,!0):e.lineTo(t.m_to))}}cleanupBufferCommands(){this.m_helperArray=P(x,9);let e=0;for(let s=0,i=this.m_bufferCommands.length;s<i;){const t=this.m_bufferCommands[s];if(t.m_type&q.enumConnectionMask){e=s;break}s=t.m_next}let t=e+1;for(let s=e;t!==e;s=t){const e=this.m_bufferCommands[s];t=e.m_next;let i=1,n=null;for(;t!==s&&(n=this.m_bufferCommands[t],!(n.m_type&q.enumConnectionMask));)t=n.m_next,i++;if(1!==i&&(e.m_type&n.m_type)===q.enumLine){this.m_helperLine1.setStartXY(e.m_from),this.m_helperLine1.setEndXY(e.m_to),this.m_helperLine2.setStartXY(n.m_from),this.m_helperLine2.setEndXY(n.m_to);1===this.m_helperLine1.intersect(this.m_helperLine2,this.m_helperArray,null,null,this.m_smallTolerance.total())&&(e.m_to.assign(this.m_helperArray[0]),n.m_from.assign(this.m_helperArray[0]),e.m_next=t)}}return e}isDegeneratePath(e,t){if(1===e.getPathSize(t))return!0;if(0===this.m_joins&&0===this.m_caps){const s=new k;if(e.queryPathEnvelope(t,s),Math.max(s.width(),s.height())<.5*this.m_densifyDist)return!0}return!1}isDegenerateGeometry(e){if(0===this.m_joins&&0===this.m_caps){const t=new k;if(e.queryEnvelope(t),Math.max(t.width(),t.height())<.5*this.m_densifyDist)return!0}return!1}addCircle(e,t){const s=t.getXY();if(0!==this.m_circleTemplate.length){let t=this.m_circleTemplate[0].clone();t.scaleAddThis(this.m_absDistance,s),e.startPath(t);for(let i=1,n=this.m_circleTemplate.length;i<n;i++)t=this.m_circleTemplate[i].clone(),t.scaleAddThis(this.m_absDistance,s),e.lineTo(t);return}const i=this.m_circleTemplateSize,n=Math.trunc((i+3)/4),r=.5*Math.PI/n;e.reserve(4*n);const m=Math.cos(r),o=Math.sin(r);for(let a=3;a>=0;a--){const t=x.construct(0,this.m_absDistance);switch(a){case 0:for(let i=0;i<n;i++)e.lineToCoords(t.x+s.x,t.y+s.y),t.rotateReverse(m,o);break;case 1:for(let i=0;i<n;i++)e.lineToCoords(-t.y+s.x,t.x+s.y),t.rotateReverse(m,o);break;case 2:for(let i=0;i<n;i++)e.lineToCoords(-t.x+s.x,-t.y+s.y),t.rotateReverse(m,o);break;default:e.startPathCoords(t.y+s.x,-t.x+s.y);for(let i=1;i<n;i++)t.rotateReverse(m,o),e.lineToCoords(t.y+s.x,-t.x+s.y)}this.progress_()}}addSquare(e,t){const s=new p({vd:t.getDescription()});s.setCoords(t.getX(),t.getY(),t.getX(),t.getY()),s.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(s,!1)}setStrongSimple(e){return e.getImpl().setIsSimple(4,this.m_tolerance.total()),e.getImpl().updateOGCFlagsProtected(),e}}function W(e){return b(e,0),e}function H(e,t){return!!e.isEmpty()||Math.min(e.width(),e.height())>t}function K(e,t,s,i,n,r,m,o){const a=e.getXY(s),h=e.getXY(i);if(a.equals(h))return-1;const l=.25*m,c=.25*m,f=new x;f.setSub(h,a);const _=f.length(),g=_*_*.25,d=r*r-g;if(d<=g)return-1;const p=Math.sqrt(d);f.normalize();const b=f.clone();b.rightPerpendicularThis();const y=g/p,P=y<=c,C=x.lerp(h,a,.5),T=b.clone(),v=y-l;T.scaleAddThis(Math.max(0,v),C);b.negate().scaleAddThis(p,C);const S=3.61*w(r-c),I=T.sub(a),M=T.sub(h);let E=!1,V=0;const k=D(64,0);u(o===k.length);{for(let o=e.getPrevVertexEx(i,n);o!==s;){if(1===e.getUserIndex(o,t))return-1;if(e.getXY(o).equals(h)){const t=e.getPrevVertexEx(o,n);e.removeVertex(o,!1),o=t;continue}break}const r=new x,m=a.clone();k[V++]=1;for(let o=e.getNextVertexEx(s,n);o!==i;){if(1===e.getUserIndex(o,t))return-1;const s=e.getXY(o);if(s.equals(m)){const t=e.getNextVertexEx(o,n);e.removeVertex(o,!1),o=t;continue}k[V++]=0;const i=new x;if(i.setSub(s,a),i.dotProduct(b)<0)return 0;(x.sqrDistance(s,a)>S||x.sqrDistance(s,h)>S)&&(E=!0);let l=0;s.sub(a).crossProduct(I)>=0&&(l=1);if(s.sub(h).crossProduct(M)<=0&&(l|=2),0===l)return 0;k[V-1]=l,r.assign(m),m.assign(s),o=e.getNextVertexEx(o,n)}if(1===V)return 0;u(V<k.length),k[V++]=2}let B=!0;for(let u=1,x=0;u<V;u++)if(k[u]!==k[u-1]&&(x++,B=x<3&&(1===x&&3===k[u]||2===x&&2===k[u]),!B))return 0;if(V>2&&B&&(3===V||!E)){let t=0,r=e.getNextVertexEx(s,n);for(P||(e.setXY(r,T),r=e.getNextVertexEx(r,n));r!==i;){const s=e.getNextVertexEx(r,n);e.removeVertex(r,!1),r=s,++t}return t}if(u(3!==V),E&&V>3)return 0;const R=a.clone();let A=s;const X=a.clone();let Y=1,F=-1,L=A,q=0;for(V=1;L!==i;){L=e.getNextVertexEx(L,n);const t=k[V++];if(0===t){if(L===i)break;continue}const s=e.getXY(L);if(-1!==F){if(3&(F&Y&t)){e.removeVertex(A,!0),q++,A=L,X.setCoordsPoint2D(s),Y=t;continue}if(3===Y&&0!==F&&0!==t){if(X.setCoordsPoint2D(T),P||X.equals(R)){e.removeVertex(A,!0),q++,A=L,X.setCoordsPoint2D(s),Y=t;continue}e.setXY(A,X)}}F=Y,R.setCoordsPoint2D(X),A=L,Y=t,X.setCoordsPoint2D(s)}return q}function Q(e,t,s,i){let n=-1;const r=new x,m=new x,o=new x;for(let a=0,h=e.getPathSize(i),l=e.getFirstVertex(i);a<h;++a){-1===n&&(e.queryXY(l,m),n=e.getPrevVertex(l),-1!==n&&(e.queryXY(n,r),o.setSub(m,r),o.normalize()));const s=e.getNextVertex(l);if(-1===s)break;const i=e.getXY(s),a=i.sub(m);if(a.normalize(),-1!==n){a.dotProduct(o)<-.99&&Math.abs(a.crossProduct(o))<1e-7&&e.setUserIndex(l,t,1)}n=l,l=s,r.assign(m),m.assign(i),o.assign(a)}}function Z(s,i,n,r,m,o,a){const h={stack:[],error:void 0,hasError:!1};try{const t=s.getFirstPath(i),r=s.createUserIndex();e(h,C(()=>{s.removeUserIndex(r)},!1),!1),Q(s,r,i,t);for(let e=0;e<100;++e){if(0===s.getPathSize(t))return 1;let e=s.getFirstVertex(t),i=s.getPathSize(t);if(i<3)return 1;s.isClosedPath(t)||(i-=1);const o=64;let h=0,l=!1;for(let t=0;t<i&&e!==V;t++){let c=0,u=e;for(let h=1,l=Math.min(o,i-t);h<l;h++)if(u=s.getNextVertexEx(u,n),h>1){const t=K(s,r,e,u,n,m,a,o);if(-1===t)break;c+=t,i-=t}if(h+=c,l=c>0,l){const t=s.getPrevVertexEx(e,n);if(-1!==t){e=t,i++;continue}}e=s.getNextVertexEx(e,n)}if(0===h)break}return s.filterClosePoints(o,!1,!1,!1,-1),1}catch(l){h.error=l,h.hasError=!0}finally{t(h)}}function $(e,t,s,i,n,r,m){return Z(e,t,s,i,n,r,m)}function ee(e,t,s,i){for(let n=0,r=e.getPathCount();n<r;n++){const r=e.getXY(e.getPathStart(n));r.x!==s.xmin&&r.x!==s.xmax&&t.addPath(e,n,i)}}export{J as B};
|
|
5
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{G as s,a as i,j as n,t as r,k as m,e as o,l as a,m as h,f as l,d as c,g as u}from"./Geometry.js";import{G as f}from"./SimpleGeometryCursor.js";import{C as _,c as g,P as d,E as p,s as b}from"./Envelope.js";import{i as y,m as P,P as x,h as C,d as D,a as w}from"./Point2D.js";import{L as T,D as v,a as S,P as I,i as M,E,n as V}from"./MultiPathImpl.js";import{Envelope2D as k}from"./Envelope2D.js";import{T as B}from"./Transformation2D.js";import{c as R}from"./GeometryCleaner-BEJM7I4l.js";import{L as A,D as X,X as Y}from"./UnitFactory.js";import{O as F}from"./OperatorSimplifyOGC.js";import{O as L}from"./OperatorGeneralize.js";var q;function z(e,t,s,i,n,r){return{m_from:e.clone(),m_to:t.clone(),m_center:s.clone(),m_next:n,m_type:i}}function j(e,t,s,i,n){return{m_from:e.clone(),m_to:t.clone(),m_next:s,m_type:4,m_center:new x}}!function(e){e[e.enumDummy=256]="enumDummy",e[e.enumLine=1]="enumLine",e[e.enumArc=2]="enumArc",e[e.enumMiter=8]="enumMiter",e[e.enumBevel=16]="enumBevel",e[e.enumJoinMask=26]="enumJoinMask",e[e.enumConnectionMask=27]="enumConnectionMask"}(q||(q={}));class G extends f{constructor(e,t,s,i,n,r,m,o,a,h){super(),this.m_index=0,this.m_bufferedPolygon=null,this.m_x=0,this.m_y=0,this.m_progressTracker=h,this.m_parent=e,this.m_mp=t,this.m_distance=s,this.m_spatialReference=i,this.m_densifyDist=o,this.m_maxVertexInCompleteCircle=a,this.m_joins=n,this.m_caps=r,this.m_miterLimit=m}next(){const e=new d;for(;;){if(this.m_index===this.m_mp.getPointCount())return null;if(1===this.m_caps)return this.m_index=this.m_mp.getPointCount(),new S({vd:this.m_mp.getDescription()});if(this.m_mp.getPointByVal(this.m_index,e),this.m_index++,!e.isEmpty())break}let t,s=!1;if(null===this.m_bufferedPolygon&&(this.m_x=e.getX(),this.m_y=e.getY(),this.m_bufferedPolygon=this.m_parent.buffer(e,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle),s=!0),t=this.m_index<this.m_mp.getPointCount()?this.m_bufferedPolygon.clone():this.m_bufferedPolygon,!s){const s=new B,i=e.getX()-this.m_x,n=e.getY()-this.m_y;s.setShiftCoords(i,n),t.applyTransformation(s)}return b(t,0),t}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class N extends f{constructor(e){super(),this.m_currentPathIndex=0,this.m_polyline=e}next(){if(!this.m_polyline)return null;const e=this.m_polyline.getImpl(),t=e.getPathCount();if(this.m_currentPathIndex<t){const t=this.m_currentPathIndex;if(this.m_currentPathIndex++,!e.isClosedPathInXYPlane(t)){let s=e.getXY(e.getPathEnd(t)-1);for(;this.m_currentPathIndex<e.getPathCount();){const t=e.getXY(e.getPathStart(this.m_currentPathIndex));if(e.isClosedPathInXYPlane(this.m_currentPathIndex))break;if(!t.equals(s))break;s=e.getXY(e.getPathEnd(this.m_currentPathIndex)-1),this.m_currentPathIndex++}}if(0===t&&this.m_currentPathIndex===this.m_polyline.getPathCount()){const e=this.m_polyline;return this.m_polyline=null,e}const s=new I({vd:this.m_polyline.getDescription()});s.addPath(this.m_polyline,t,!0);for(let i=t+1;i<this.m_currentPathIndex;i++)s.addSegmentsFromPath(this.m_polyline,i,0,e.getSegmentCountPath(i),!1);return this.m_currentPathIndex===this.m_polyline.getPathCount()&&(this.m_polyline=null),s}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class O extends f{constructor(e,t,s){super(),this.m_geometry=null,this.m_index=0,this.m_bufferer=e,this.m_geoms=t,this.m_index=0,this.m_bFilter=s}next(){if(null===this.m_geometry&&(this.m_index=0,this.m_geometry=this.m_geoms.next(),!this.m_geometry))return null;const e=this.m_geometry.getImpl();if(this.m_index<e.getPathCount()){const e=this.m_index;this.m_index++;return this.m_bufferer.bufferPolylinePath(this.m_geometry,e,this.m_bFilter)}return this.m_geometry=null,this.next()}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class U extends f{constructor(e){super(),this.m_index=0,this.m_bufferer=e}next(){const e=this.m_bufferer.m_geometry;if(this.m_index<e.getPathCount()){const t=this.m_index,s=e.calculateRingArea2D(this.m_index);for(u(s>0),this.m_index++;this.m_index<e.getPathCount();){if(e.calculateRingArea2D(this.m_index)>0)break;this.m_index++}let i;return i=0===t&&this.m_index===e.getPathCount()?this.m_bufferer.bufferPolygonImpl(e,0,e.getPathCount()):this.m_bufferer.bufferPolygonImpl(e,t,this.m_index),i}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class J{constructor(e){this.m_geometry=null,this.m_bufferCommands=[],this.m_originalGeomType=s.enumUnknown,this.m_maxVertexInCompleteCircle=-1,this.m_circleTemplateSize=-1,this.m_oldCircleTemplateSize=0,this.m_spatialReference=null,this.m_tolerance=new _(0,0),this.m_smallTolerance=new _(0,0),this.m_filterTolerance=0,this.m_densifyDist=-1,this.m_distance=Number.NaN,this.m_absDistance=0,this.m_absDistanceReversed=0,this.m_dA=-1,this.m_miterLimit=4,this.m_joins=0,this.m_caps=0,this.m_bRoundBuffer=!0,this.m_bOutputLoops=!0,this.m_bFilter=!0,this.m_circleTemplate=[],this.m_leftStack=[],this.m_middleStack=[],this.m_helperLine1=new T,this.m_helperLine2=new T,this.m_helperArray=[],this.m_progressCounter=0,this.m_densificator=v.constructDefault(e),this.m_progressTracker=e}buffer(e,t,s,l,c,u,f,_){if(e||i("Geometry.Bufferer.Impl.Buffer"),f<0&&i("Geometry.Bufferer.Impl.Buffer"),n(e.getGeometryType())&&r("Unsupported geometry type."),e.isEmpty())return new S({vd:e.getDescription()});if(this.m_joins=l,this.m_caps=c,this.m_bRoundBuffer=!1,this.m_miterLimit=u,this.m_originalGeomType=e.getGeometryType(),m(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_joins:o(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_caps:a(this.m_originalGeomType)&&(this.m_bRoundBuffer=0===this.m_joins&&0===this.m_caps),this.m_bFilter=this.m_bRoundBuffer,this.m_geometry=R(e),this.m_geometry.isEmpty())return new S({vd:e.getDescription()});const d=new k;this.m_geometry.queryLooseEnvelope(d),t>0&&d.inflateCoords(t,t),this.m_tolerance=g(s,d,!0),this.m_smallTolerance=g(null,d,!0),_<=0&&(_=96),this.m_spatialReference=s,this.m_distance=t,this.m_absDistance=Math.abs(this.m_distance),this.m_absDistanceReversed=0!==this.m_absDistance?1/this.m_absDistance:0,Number.isNaN(f)||0===f?f=1e-5*this.m_absDistance:f>.5*this.m_absDistance&&(f=.5*this.m_absDistance),_<12&&(_=12);const p=Math.abs(t)*(1-Math.cos(Math.PI/_));if(p>f)f=p;else if(0!==t){const e=Math.PI/Math.acos(1-f/Math.abs(t));e<_-1&&(_=Math.trunc(e))<12&&(_=12,f=Math.abs(t)*(1-Math.cos(Math.PI/_)))}this.m_densifyDist=f,this.m_maxVertexInCompleteCircle=_,this.m_filterTolerance=this.m_bRoundBuffer?Math.min(this.m_smallTolerance.total(),.25*this.m_densifyDist):0,this.m_circleTemplateSize=this.calcN(),this.m_circleTemplateSize!==this.m_oldCircleTemplateSize&&(this.m_circleTemplate.length=0,this.m_oldCircleTemplateSize=this.m_circleTemplateSize),this.m_densifyDist>0&&h(this.m_geometry)&&(this.m_geometry=this.m_densificator.densifyEx(this.m_geometry,0,this.m_densifyDist,0,0!==this.m_joins,y()));const b=this.bufferImpl();return this.m_geometry=null,b}generateCircleTemplate(){if(this.m_circleTemplate.length)return;const e=this.m_circleTemplateSize,t=Math.trunc((e+3)/4),s=.5*Math.PI/t;this.m_dA=s,this.m_circleTemplate=P(x,4*t);const i=Math.cos(s),n=Math.sin(s),r=x.construct(0,1);for(let m=0;m<t;m++)this.m_circleTemplate[m+0*t].setCoords(r.y,-r.x),this.m_circleTemplate[m+1*t].setCoords(-r.x,-r.y),this.m_circleTemplate[m+2*t].setCoords(-r.y,r.x),this.m_circleTemplate[m+3*t].setCoords(r.x,r.y),r.rotateReverse(i,n)}bufferImpl(){const e=this.m_geometry.getGeometryType();if(l(e)){const e=new I({vd:this.m_geometry.getDescription()});return e.addSegment(this.m_geometry,!0),this.m_geometry=e,this.bufferImpl()}if(this.m_distance<=this.m_tolerance.total()){if(!m(e))return new S({vd:this.m_geometry.getDescription()});if(this.m_distance<0){const e=new k;if(this.m_geometry.queryEnvelope(e),e.width()<=2*this.m_absDistance||e.height()<=2*this.m_absDistance)return new S({vd:this.m_geometry.getDescription()})}}switch(this.m_geometry.getGeometryType()){case s.enumPoint:return this.bufferPoint();case s.enumMultiPoint:return this.bufferMultiPoint();case s.enumPolyline:return this.bufferPolyline();case s.enumPolygon:return this.bufferPolygon();case s.enumEnvelope:return this.bufferEnvelope();default:c("")}}bufferPolyline(){if(this.isDegenerateGeometry(this.m_geometry)){const e=new d;this.m_geometry.getPointByVal(0,e);const t=new k;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const e=this.m_geometry,t=this.m_geometry.getDescription();this.m_geometry=null;const s=new N(e);let i,n;i=0===this.m_joins?(new L).executeMany(s,.25*this.m_densifyDist,!1,this.m_progressTracker):s,n=this.m_bRoundBuffer?(new F).executeMany(i,null,!0,this.m_progressTracker):i;const r=new O(this,n,this.m_bFilter),m=(new A).executeMany(r,this.m_spatialReference,this.m_progressTracker,2),o=(new X).executeMany(m,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==o?o:new S({vd:t})}bufferPolygon(){if(0===this.m_distance)return this.m_geometry;this.generateCircleTemplate();const e=(new X).execute(this.m_geometry,null,!1,this.m_progressTracker);if(this.m_distance<0){if(this.m_geometry=e,this.m_geometry.isEmpty())return this.m_geometry;const t=this.m_geometry,s=this.bufferPolygonImpl(t,0,t.getPathCount());return(new X).execute(s,this.m_spatialReference,!1,this.m_progressTracker)}{if(this.m_geometry=e,this.isDegenerateGeometry(this.m_geometry)){const e=new d;this.m_geometry.getPointByVal(0,e);const t=new k;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const t=new U(this),s=(new A).executeMany(t,this.m_spatialReference,this.m_progressTracker,2),i=(new X).executeMany(s,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==i?i:new S({vd:this.m_geometry.getDescription()})}}bufferPolygonImpl(e,t,s){const i=e,n=i.getImpl();let r=new S({vd:e.getDescription()});for(let m=t;m<s;m++){if(n.getPathSize(m)<1)continue;const t=n.calculateRingArea2D(m),s=new k;if(n.queryPathEnvelope(m,s),this.m_distance>0)if(t>0)if(this.isDegeneratePath(n,m)){const e=new d;n.getPointByVal(n.getPathStart(m),e),e.setXY(s.getCenter()),r.add(this.bufferDegeneratePath(e,!0),!1)}else{const t=new I({vd:e.getDescription()}),s=t.getImpl();if(M(this.m_geometry,m)){const e=this.bufferConvexPath(i,m);r.add(e,!1)}else{this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,1);const e=this.bufferCleanup(t);r.add(e,!1)}}else{if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new I({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,1),!t.isEmpty()){const e=s,n=Math.max(1,this.m_absDistance),m=e.clone();m.inflateCoords(n,n),i.addEnvelope(m,!1);const o=this.bufferCleanup(t);r.reserve(r.getPointCount()+o.getPointCount()-4),ee(o,r,m,!0)}}else if(t>0){if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new I({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,-1),!t.isEmpty()){const e=new k;i.queryLooseEnvelope(e);const s=Math.max(1,this.m_absDistance),n=e.clone();n.inflateCoords(s,s),i.addEnvelope(n,!1);ee(this.bufferCleanup(t),r,n,!0)}}else{const t=new I({vd:e.getDescription()}),s=t.getImpl();this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,-1);const i=this.bufferCleanup(t);for(let e=0,n=i.getPathCount();e<n;e++)r.addPath(i,e,!0)}}if(this.m_distance>0){if(r.getPathCount()>1){return this.bufferCleanup(r)}return H(r)}{const e=new k;if(r.queryLooseEnvelope(e),r.isEmpty())return H(r);{const t=Math.max(1,this.m_absDistance),s=e.clone();s.inflateCoords(t,t),r.addEnvelope(s,!1);const i=this.bufferCleanup(r);r=new S;const n=new S({vd:i.getDescription()});return ee(i,n,s,!1),H(n)}}}bufferPoint(){return this.bufferPointImpl(this.m_geometry)}bufferPointImpl(e){const t=new S({vd:e.getDescription()});return 0===this.m_caps?(this.addCircle(t.getImpl(),e),this.setStrongSimple(t)):2===this.m_caps?(this.addSquare(t.getImpl(),e),this.setStrongSimple(t)):t}bufferDegeneratePath(e,t){const s=new S({vd:e.getDescription()});return t&&0===this.m_joins||!t&&0===this.m_caps?(this.addCircle(s.getImpl(),e),this.setStrongSimple(s)):t||2!==this.m_caps?s:(this.addSquare(s.getImpl(),e),this.setStrongSimple(s))}bufferMultiPoint(){const e=new G(this,this.m_geometry,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle,this.m_progressTracker);return(new A).executeMany(e,this.m_spatialReference,this.m_progressTracker,2).next()}bufferEnvelope(){let e=new S({vd:this.m_geometry.getDescription()});if(this.m_distance<=0){if(0===this.m_distance)e.addEnvelope(this.m_geometry,!1),K(this.m_geometry,this.m_tolerance.total())&&(e=this.setStrongSimple(e));else{const t=new p;this.m_geometry.queryEnvelope(t),t.inflateCoords(this.m_distance,this.m_distance),e.addEnvelope(t,!1),K(t,this.m_tolerance.total())&&(e=this.setStrongSimple(e))}return e}if(1===this.m_joins){const t=new p({copy:this.m_geometry});return t.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(t,!1),e}const t=this.m_geometry.clone();if(0===t.width()||0===t.height()){if(0===t.width()&&0===t.height()){const e=new d({vd:this.m_geometry.getDescription()});return t.queryCornerByVal(0,e),this.m_geometry=e,this.bufferImpl()}const e=new I({vd:this.m_geometry.getDescription()}),s=new d;return t.queryCornerByVal(0,s),e.startPathPoint(s),t.queryCornerByVal(2,s),e.lineToPoint(s),this.m_geometry=e,this.bufferImpl()}return e.addEnvelope(this.m_geometry,!1),this.m_geometry=e,this.bufferConvexPath(e,0)}bufferConvexPath(e,t){this.generateCircleTemplate();const s=e.hasAttribute(10),i=new S({vd:e.getDescription()}),n=i.getImpl();i.reserve((this.m_circleTemplate.length/10+4)*e.getPathSize(t));const r=new x,m=new x,o=new x,a=new x(0,0),h=new x,l=new x,u=e.getImpl(),f=e.getPathSize(t),_=e.getPathStart(t);for(let g=0,d=e.getPathSize(t);g<d;g++){const e=u.getXY(_+g),t=u.getXY(_+(g+1)%f),i=u.getXY(_+(g+2)%f);h.setSub(t,e),0===h.length()&&c("");const d=s&&!!(1&u.getAttributeAsInt(10,(g+1)%f,0));h.normalize();const p=h.clone();h.leftPerpendicularThis(),h.scale(this.m_absDistance),r.setAdd(h,e),m.setAdd(h,t),0===g?n.startPath(r):n.lineTo(r),n.lineTo(m),l.setSub(i,t),0===l.length()&&c(""),l.normalize();const b=l.clone();l.leftPerpendicularThis(),l.scale(this.m_absDistance),o.setAdd(l,t);let y=q.enumArc;const P=d?0:this.m_joins;if(2===P)y=q.enumBevel;else if(1===P){const e=-p.crossProduct(b);a.setSub(p,b),a.scale(this.m_absDistance/e),a.length()<this.m_miterLimit*this.m_absDistance?(a.addThis(t),y=q.enumMiter):y=q.enumBevel}else a.assign(t);this.addJoin(y,n,a,m,o,!1,!1)}return H(i)}bufferPolylinePath(e,t,s){this.generateCircleTemplate();const i=e,n=i.getImpl();if(n.getPathSize(t)<1)return null;let r;if(r=this.m_bRoundBuffer?n.isClosedPathInXYPlane(t):n.isClosedPath(t),this.isDegeneratePath(n,t)&&this.m_distance>0){const e=new d;n.getPointByVal(n.getPathStart(t),e);const s=new k;return n.queryPathEnvelope(t,s),e.setXY(s.getCenter()),this.bufferDegeneratePath(e,r)}const m=new I({vd:e.getDescription()});m.reserve((Math.trunc(this.m_circleTemplate.length/10)+4)*n.getPathSize(t));const o=m.getImpl();return r?2!==this.bufferClosedPath(i,t,o,s,1)&&this.bufferClosedPath(i,t,o,s,-1):this.bufferOpenPath(i,t,o,s),this.bufferCleanup(m)}progress_(){}bufferCleanup(e,t=!1){const s=t?this.m_tolerance:this.m_smallTolerance;return Y(e,s,!0,!t,-1,this.m_progressTracker,0,!1)}calcN(){const e=4;if(0===this.m_densifyDist)return this.m_maxVertexInCompleteCircle;const t=1-this.m_densifyDist*Math.abs(this.m_absDistanceReversed);let s=e;return s=t<-1?e:2*Math.PI/Math.acos(t)+.5,s<e?s=e:s>this.m_maxVertexInCompleteCircle&&(s=this.m_maxVertexInCompleteCircle),Math.trunc(s)}addJoin(e,t,s,i,n,r,m){if(this.generateCircleTemplate(),r&&(t.startPath(i),r=!1),e===q.enumBevel)return void(m&&t.lineTo(n));if(e===q.enumMiter){const e=s.clone();return t.lineTo(e),void(m&&t.lineTo(n))}const o=new x;o.setSub(i,s),o.scale(this.m_absDistanceReversed);const a=new x;a.setSub(n,s),a.scale(this.m_absDistanceReversed);let h=Math.atan2(o.y,o.x)/this.m_dA;h<0&&(h=this.m_circleTemplate.length+h),h=this.m_circleTemplate.length-h;let l=Math.atan2(a.y,a.x)/this.m_dA;l<0&&(l=this.m_circleTemplate.length+l),l=this.m_circleTemplate.length-l,l<h&&(l+=this.m_circleTemplate.length);let c=Math.trunc(l),u=Math.ceil(h),f=this.m_circleTemplate[u%this.m_circleTemplate.length].clone();f.scaleAddThis(this.m_absDistance,s);const _=10*this.m_tolerance.total();f.sub(i).length()<_&&(u+=1),f=this.m_circleTemplate[c%this.m_circleTemplate.length].clone(),f.scaleAddThis(this.m_absDistance,s),f.sub(n).length()<_&&(c-=1);let g=c-u;g++;for(let d=0,p=u%this.m_circleTemplate.length;d<g;d++,p=(p+1)%this.m_circleTemplate.length)f=this.m_circleTemplate[p].clone(),f.scaleAddThis(this.m_absDistance,s),t.lineTo(f),this.progress_();m&&t.lineTo(n)}bufferClosedPath(e,t,s,i,n){const r=new E,m=r.addPathFromMultiPath(e,t,!0);return this.bufferClosedPathImpl(r,m,s,i,n)}bufferClosedPathImpl(e,t,s,i,n){const r=e.getFirstVertex(e.getFirstPath(t)),m=new d;e.queryPoint(r,m),e.filterClosePoints(this.m_filterTolerance,!1,!1,!1,-1);if(e.getPointCount(t)<2)return n<0?0:(this.m_bRoundBuffer&&this.addCircle(s,m),2);u(e.getFirstPath(t)!==V),u(e.getFirstVertex(e.getFirstPath(t))!==V);const o=e.getXY(e.getFirstVertex(e.getFirstPath(t))),a=new B;if(a.setShift(o.negate()),e.applyTransformation(a),i){const i=$(e,t,n,!0,this.m_absDistance,this.m_filterTolerance,this.m_densifyDist);if(u(1===i),e.getPointCount(t)<2)return n<0?0:(this.addCircle(s,m),2)}const h=0!==this.m_joins&&e.getVertexDescription().hasAttribute(10);this.m_bufferCommands.length=0;const l=e.getFirstPath(t);let c=e.getFirstVertex(l),f=1===n?e.getPrevVertex(c):e.getNextVertex(c),_=1===n?e.getNextVertex(c):e.getPrevVertex(c),g=!0;const p=new x,b=new x,y=new x,P=new x,C=new x,D=new x,w=new x,T=new x,v=this.m_absDistance,S=e.getPathSize(l),I=new x(0,0);for(let u=0;u<S;u++){b.assign(e.getXY(_)),g&&(p.assign(e.getXY(c)),y.assign(e.getXY(f)),D.setSub(p,y),D.normalize(),T.leftPerpendicularOther(D),T.scale(v),P.setAdd(T,p));const t=h&&!!(1&e.getAttributeAsDbl(10,c,0));C.setSub(b,p),C.normalize(),w.leftPerpendicularOther(C),w.scale(v);const s=new x;s.setAdd(p,w);const i=D.crossProduct(C),r=D.dotProduct(C);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8){let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;I.setSub(D,C),I.scale(this.m_absDistance/t),I.length()<this.m_miterLimit*this.m_absDistance&&(I.addThis(p),e=!0),this.m_bufferCommands.push(z(P,s,I,e?q.enumMiter:q.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(z(P,s,p,0===n?q.enumArc:q.enumBevel,this.m_bufferCommands.length+1))}else P.equals(s)||(this.m_bufferCommands.push(j(P,p,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(j(p,s,this.m_bufferCommands.length+1)));const m=new x;m.setAdd(b,w),this.m_bufferCommands.push(z(s,m,p,q.enumLine,this.m_bufferCommands.length+1)),P.setCoordsPoint2D(m),T.setCoordsPoint2D(w),y.setCoordsPoint2D(p),p.setCoordsPoint2D(b),D.setCoordsPoint2D(C),f=c,c=_,g=!1,_=1===n?e.getNextVertex(c):e.getPrevVertex(c)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),a.setShift(o),s.applyTransformationToPath(a,s.getPathCount()-1),1}bufferOpenPath(e,t,s,i){if(this.m_bRoundBuffer){const n=new I({vd:e.getDescription()});return n.addPath(e,t,!1),n.addSegmentsFromPath(e,t,0,e.getSegmentCountPath(t),!1),this.bufferClosedPath(n,0,s,i,1)}let n=0;const r=new I({vd:e.getDescription()}),m=new x(0,0);{const i=new E,o=i.addPathFromMultiPath(e,t,!1),a=i.getFirstVertex(i.getFirstPath(o)),h=new d;i.queryPoint(a,h),m.assign(h.getXY()),i.filterClosePoints(0,!1,!1,!1,-1);if(i.getPointCount(o)<2)return this.m_bRoundBuffer&&this.addCircle(s,h),2;const l=i.getGeometry(i.getFirstGeometry());r.addPath(l,0,!1),n=r.getPointCount()-1,r.addSegmentsFromPath(l,0,0,l.getSegmentCountPath(0)-1,!1)}const o=new E,a=o.addPathFromMultiPath(r,0,!0);u(o.getFirstPath(a)!==V),u(o.getFirstVertex(o.getFirstPath(a))!==V);const h=new B;h.setShift(m.negate()),o.applyTransformation(h),this.m_bufferCommands.length=0;const l=o.getFirstPath(a),c=0!==this.m_joins&&o.getVertexDescription().hasAttribute(10);let f=o.getFirstVertex(l),_=o.getPrevVertex(f),g=o.getNextVertex(f),p=!0;const b=new x,y=new x,P=new x,C=new x,D=new x,w=new x,T=new x,v=new x,S=this.m_absDistance,M=o.getPathSize(l),k=new x(0,0);for(let u=0;u<M;u++){let e=!1;0!==u&&u!==n||(e=!0),y.assign(o.getXY(g)),p&&(b.assign(o.getXY(f)),P.assign(o.getXY(_)),w.setSub(b,P),w.normalize(),v.leftPerpendicularOther(w),v.scale(S),C.setAdd(v,b));const t=c&&!!(1&o.getAttributeAsDbl(10,f,0));D.setSub(y,b),D.normalize(),T.leftPerpendicularOther(D),T.scale(S);const s=new x;s.setAdd(b,T);const i=w.crossProduct(D),r=w.dotProduct(D);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8)if(e)if(0===this.m_caps)this.m_bufferCommands.push(z(C,s,b,q.enumArc,this.m_bufferCommands.length+1));else if(1===this.m_caps)this.m_bufferCommands.push(z(C,s,b,q.enumLine,this.m_bufferCommands.length+1));else{const e=D.mul(this.m_absDistance).negate(),t=e.clone();e.addThis(C),t.addThis(s),this.m_bufferCommands.push(z(C,e,b,q.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(z(e,t,b,q.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(z(t,s,b,q.enumLine,this.m_bufferCommands.length+1))}else{let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;k.setSub(w,D),k.scale(this.m_absDistance/t),k.length()<this.m_miterLimit*this.m_absDistance&&(k.addThis(b),e=!0),this.m_bufferCommands.push(z(C,s,k,e?q.enumMiter:q.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(z(C,s,b,0===n?q.enumArc:q.enumBevel,this.m_bufferCommands.length+1))}else C.equals(s)||(this.m_bufferCommands.push(j(C,b,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(j(b,s,this.m_bufferCommands.length+1)));const m=new x;m.setAdd(y,T),this.m_bufferCommands.push(z(s,m,b,q.enumLine,this.m_bufferCommands.length+1)),C.setCoordsPoint2D(m),v.setCoordsPoint2D(T),P.setCoordsPoint2D(b),b.setCoordsPoint2D(y),w.setCoordsPoint2D(D),_=f,f=g,p=!1,g=o.getNextVertex(f)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),h.setShift(m),s.applyTransformationToPath(h,s.getPathCount()-1),1}processBufferCommands(e){const t=this.cleanupBufferCommands();let s=!0,i=t+1;for(let n=t;i!==t;n=i){const t=this.m_bufferCommands[n];i=-1!==t.m_next?t.m_next:(n+1)%this.m_bufferCommands.length,t.m_type&&(s&&(e.startPath(t.m_from),s=!1),t.m_type&q.enumJoinMask?this.addJoin(t.m_type,e,t.m_center,t.m_from,t.m_to,!1,!0):e.lineTo(t.m_to))}}cleanupBufferCommands(){this.m_helperArray=P(x,9);let e=0;for(let s=0,i=this.m_bufferCommands.length;s<i;){const t=this.m_bufferCommands[s];if(t.m_type&q.enumConnectionMask){e=s;break}s=t.m_next}let t=e+1;for(let s=e;t!==e;s=t){const e=this.m_bufferCommands[s];t=e.m_next;let i=1,n=null;for(;t!==s&&(n=this.m_bufferCommands[t],!(n.m_type&q.enumConnectionMask));)t=n.m_next,i++;if(1!==i&&(e.m_type&n.m_type)===q.enumLine){this.m_helperLine1.setStartXY(e.m_from),this.m_helperLine1.setEndXY(e.m_to),this.m_helperLine2.setStartXY(n.m_from),this.m_helperLine2.setEndXY(n.m_to);1===this.m_helperLine1.intersect(this.m_helperLine2,this.m_helperArray,null,null,this.m_smallTolerance.total())&&(e.m_to.assign(this.m_helperArray[0]),n.m_from.assign(this.m_helperArray[0]),e.m_next=t)}}return e}isDegeneratePath(e,t){if(1===e.getPathSize(t))return!0;if(0===this.m_joins&&0===this.m_caps){const s=new k;if(e.queryPathEnvelope(t,s),Math.max(s.width(),s.height())<.5*this.m_densifyDist)return!0}return!1}isDegenerateGeometry(e){if(0===this.m_joins&&0===this.m_caps){const t=new k;if(e.queryEnvelope(t),Math.max(t.width(),t.height())<.5*this.m_densifyDist)return!0}return!1}addCircle(e,t){const s=t.getXY();if(0!==this.m_circleTemplate.length){let t=this.m_circleTemplate[0].clone();t.scaleAddThis(this.m_absDistance,s),e.startPath(t);for(let i=1,n=this.m_circleTemplate.length;i<n;i++)t=this.m_circleTemplate[i].clone(),t.scaleAddThis(this.m_absDistance,s),e.lineTo(t);return}const i=this.m_circleTemplateSize,n=Math.trunc((i+3)/4),r=.5*Math.PI/n;e.reserve(4*n);const m=Math.cos(r),o=Math.sin(r);for(let a=3;a>=0;a--){const t=x.construct(0,this.m_absDistance);switch(a){case 0:for(let i=0;i<n;i++)e.lineToCoords(t.x+s.x,t.y+s.y),t.rotateReverse(m,o);break;case 1:for(let i=0;i<n;i++)e.lineToCoords(-t.y+s.x,t.x+s.y),t.rotateReverse(m,o);break;case 2:for(let i=0;i<n;i++)e.lineToCoords(-t.x+s.x,-t.y+s.y),t.rotateReverse(m,o);break;default:e.startPathCoords(t.y+s.x,-t.x+s.y);for(let i=1;i<n;i++)t.rotateReverse(m,o),e.lineToCoords(t.y+s.x,-t.x+s.y)}this.progress_()}}addSquare(e,t){const s=new p({vd:t.getDescription()});s.setCoords(t.getX(),t.getY(),t.getX(),t.getY()),s.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(s,!1)}setStrongSimple(e){return e.getImpl().setIsSimple(4,this.m_tolerance.total()),e.getImpl().updateOGCFlagsProtected(),e}}function H(e){return b(e,0),e}function K(e,t){return!!e.isEmpty()||Math.min(e.width(),e.height())>t}function Q(e,t,s,i,n,r,m,o){const a=e.getXY(s),h=e.getXY(i);if(a.equals(h))return-1;const l=.25*m,c=.25*m,f=new x;f.setSub(h,a);const _=f.length(),g=_*_*.25,d=r*r-g;if(d<=g)return-1;const p=Math.sqrt(d);f.normalize();const b=f.clone();b.rightPerpendicularThis();const y=g/p,P=y<=c,C=x.lerp(h,a,.5),T=b.clone(),v=y-l;T.scaleAddThis(Math.max(0,v),C);b.negate().scaleAddThis(p,C);const S=3.61*w(r-c),I=T.sub(a),M=T.sub(h);let E=!1,V=0;const k=D(64,0);u(o===k.length);{for(let o=e.getPrevVertexEx(i,n);o!==s;){if(1===e.getUserIndex(o,t))return-1;if(e.getXY(o).equals(h)){const t=e.getPrevVertexEx(o,n);e.removeVertex(o,!1),o=t;continue}break}const r=new x,m=a.clone();k[V++]=1;for(let o=e.getNextVertexEx(s,n);o!==i;){if(1===e.getUserIndex(o,t))return-1;const s=e.getXY(o);if(s.equals(m)){const t=e.getNextVertexEx(o,n);e.removeVertex(o,!1),o=t;continue}k[V++]=0;const i=new x;if(i.setSub(s,a),i.dotProduct(b)<0)return 0;(x.sqrDistance(s,a)>S||x.sqrDistance(s,h)>S)&&(E=!0);let l=0;s.sub(a).crossProduct(I)>=0&&(l=1);if(s.sub(h).crossProduct(M)<=0&&(l|=2),0===l)return 0;k[V-1]=l,r.assign(m),m.assign(s),o=e.getNextVertexEx(o,n)}if(1===V)return 0;u(V<k.length),k[V++]=2}let B=!0;for(let u=1,x=0;u<V;u++)if(k[u]!==k[u-1]&&(x++,B=x<3&&(1===x&&3===k[u]||2===x&&2===k[u]),!B))return 0;if(V>2&&B&&(3===V||!E)){let t=0,r=e.getNextVertexEx(s,n);for(P||(e.setXY(r,T),r=e.getNextVertexEx(r,n));r!==i;){const s=e.getNextVertexEx(r,n);e.removeVertex(r,!1),r=s,++t}return t}if(u(3!==V),E&&V>3)return 0;const R=a.clone();let A=s;const X=a.clone();let Y=1,F=-1,L=A,q=0;for(V=1;L!==i;){L=e.getNextVertexEx(L,n);const t=k[V++];if(0===t){if(L===i)break;continue}const s=e.getXY(L);if(-1!==F){if(3&(F&Y&t)){e.removeVertex(A,!0),q++,A=L,X.setCoordsPoint2D(s),Y=t;continue}if(3===Y&&0!==F&&0!==t){if(X.setCoordsPoint2D(T),P||X.equals(R)){e.removeVertex(A,!0),q++,A=L,X.setCoordsPoint2D(s),Y=t;continue}e.setXY(A,X)}}F=Y,R.setCoordsPoint2D(X),A=L,Y=t,X.setCoordsPoint2D(s)}return q}function W(e,t,s,i){let n=-1;const r=new x,m=new x,o=new x;for(let a=0,h=e.getPathSize(i),l=e.getFirstVertex(i);a<h;++a){-1===n&&(e.queryXY(l,m),n=e.getPrevVertex(l),-1!==n&&(e.queryXY(n,r),o.setSub(m,r),o.normalize()));const s=e.getNextVertex(l);if(-1===s)break;const i=e.getXY(s),a=i.sub(m);if(a.normalize(),-1!==n){a.dotProduct(o)<-.99&&Math.abs(a.crossProduct(o))<1e-7&&e.setUserIndex(l,t,1)}n=l,l=s,r.assign(m),m.assign(i),o.assign(a)}}function Z(s,i,n,r,m,o,a){const h={stack:[],error:void 0,hasError:!1};try{const t=s.getFirstPath(i),r=s.createUserIndex();e(h,C(()=>{s.removeUserIndex(r)},!1),!1),W(s,r,i,t);for(let e=0;e<100;++e){if(0===s.getPathSize(t))return 1;let e=s.getFirstVertex(t),i=s.getPathSize(t);if(i<3)return 1;s.isClosedPath(t)||(i-=1);const o=64;let h=0,l=!1;for(let t=0;t<i&&e!==V;t++){let c=0,u=e;for(let h=1,l=Math.min(o,i-t);h<l;h++)if(u=s.getNextVertexEx(u,n),h>1){const t=Q(s,r,e,u,n,m,a,o);if(-1===t)break;c+=t,i-=t}if(h+=c,l=c>0,l){const t=s.getPrevVertexEx(e,n);if(-1!==t){e=t,i++;continue}}e=s.getNextVertexEx(e,n)}if(0===h)break}return s.filterClosePoints(o,!1,!1,!1,-1),1}catch(l){h.error=l,h.hasError=!0}finally{t(h)}}function $(e,t,s,i,n,r,m){return Z(e,t,s,i,n,r,m)}function ee(e,t,s,i){for(let n=0,r=e.getPathCount();n<r;n++){const r=e.getXY(e.getPathStart(n));r.x!==s.xmin&&r.x!==s.xmax&&t.addPath(e,n,i)}}export{J as B};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{G as n,v as i}from"./Geometry.js";import{S as r,a as s,s as o}from"./MultiPathImpl.js";import{R as m}from"./UnitFactory.js";import{P as a,c as u,s as c,i as h,h as l,j as g,d as y}from"./Point2D.js";import{Envelope2D as _}from"./Envelope2D.js";import{P as D,E as p}from"./Envelope.js";function v(){return{outPoint:new a,index:-1,t:Number.NaN}}function N(e,t,n){return{outPoint:e.clone(),index:t,t:n}}function f(e,t,n,i){e.outPoint.assign(t),e.index=n,e.t=i}function P(e,t){e.outPoint.assign(t.outPoint),e.index=t.index,e.t=t.t}function I(e,t,n,i){e.index=n,e.t=i,t.queryCoord2D(e.t,e.outPoint)}function d(e,t){const n=v();P(n,e),P(e,t),P(t,n)}function q(e,t,i,r,s,o){if(e.getGeometryType()===n.enumPolygon){for(;r.nextPath();)if(r.hasNextSegment()){const t=r.nextSegment();if(0!==m(e,t.getEndXY(),0))return f(s,t.getEndXY(),-1,Number.NaN),f(o,t.getEndXY(),-1,Number.NaN),!0}r.resetToFirstPath()}if(t.getGeometryType()===n.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const e=i.nextSegment();if(0!==m(t,e.getEndXY(),0))return f(s,e.getEndXY(),-1,Number.NaN),f(o,e.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function M(e){const t=e.getPathCount(),n=y(e.getSegmentCount(),0);let i=0;for(let r=0;r<t;++r){const t=i+e.getSegmentCountPath(r);for(let s=i,o=e.getPathStart(r);s<t;++s,++o)n[s]=o;i=t}return o(e.getPointCount(),n),n}function x(e,t){return!!Number.isNaN(t)||e<=t}function E(e){const t=new s;return t.addEnvelope(e,!1),t}class b{constructor(e,t){if(this.m_env2DgeometryA=null,this.m_env2DgeometryB=null,this.m_progressCounter=0,this.m_progressTracker=t,this.m_maxSqrDistance=e*e,this.m_maxDistance=e,this.m_bIsNearCalc=!1,Number.isNaN(this.m_maxDistance)?this.m_maxDistance=Number.POSITIVE_INFINITY:this.m_maxDistance=e,this.m_maxSqrDistance=this.m_maxDistance*this.m_maxDistance,Number.isFinite(this.m_maxSqrDistance)){let e=Math.sqrt(this.m_maxSqrDistance);for(;e<this.m_maxDistance;)this.m_maxSqrDistance*=1+Number.EPSILON,e=Math.sqrt(this.m_maxSqrDistance)}}calculate(e,t,n,i){if(e.getGeometryType()!==D.type||t.getGeometryType()!==D.type){this.m_env2DgeometryA=new _,this.m_env2DgeometryB=new _,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB);if(!x(this.m_env2DgeometryA.distanceFromEnvelope(this.m_env2DgeometryB),this.m_maxDistance))return Number.POSITIVE_INFINITY}const r=N(new a,g(),Number.NaN),s=N(new a,g(),Number.NaN),o=this._ExecuteBruteForce(e,t,r,s);return x(o,this.m_maxDistance)?(null!==n&&P(n,r),null!==i&&P(i,s),o):Number.POSITIVE_INFINITY}isNear(e,t){if(this.m_bIsNearCalc=!0,e.isEmpty()||t.isEmpty())return!1;if(e===t)return!0;let n=!0;if(e.getGeometryType()!==D.type&&e.getGeometryType()!==p.type||t.getGeometryType()!==D.type&&t.getGeometryType()!==p.type||(n=!1),n){if(this.m_env2DgeometryA=new _,this.m_env2DgeometryB=new _,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB),!(this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)>this.m_maxSqrDistance))return!0;if(this.m_env2DgeometryA.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>this.m_maxSqrDistance)return!1}const i=N(new a,g(),Number.NaN),r=N(new a,g(),Number.NaN);return this._ExecuteBruteForce(e,t,i,r)<=this.m_maxDistance}progress_(e=!1){}_ExecuteBruteForce(e,t,i,r){switch(e.getGeometryType()){case n.enumPoint:return this.distancePointGeometry(e,t,i,r);case n.enumMultiPoint:return this.distanceMultipointGeometry(e,t,i,r);case n.enumEnvelope:return this.distanceEnvelopeGeometry(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathGeometry(e,t,i,r);default:return Number.NaN}}distancePointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointPoint(e,t,i,r);case n.enumMultiPoint:return this.distancePointMultipoint(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distancePointMultipath(e,t,i,r);case n.enumEnvelope:return this.distancePointEnvelope(e,t,i,r);default:return Number.NaN}}distancePointPoint(e,t,n,i){const r=e.getXY(),s=t.getXY();return f(n,r,0,0),f(i,s,0,0),Math.sqrt(a.sqrDistance(r,s))}distancePointMultipoint(e,t,n,i){const r=e.getXY();let s=this.m_maxSqrDistance,o=s,m=!1;const u=t.getPointCount(),c=new a;for(let h=0;h<u;++h)if(t.queryXY(h,c),o=a.sqrDistance(r,c),this.m_bIsNearCalc){if(o<=s)return 0}else if(!(o>s)&&(!m&&o===s||o<s)&&(s=o,f(n,r,0,0),f(i,c,h,0),m=!0,0===s))return 0;return m?Math.sqrt(s):Number.POSITIVE_INFINITY}distancePointMultipath(e,t,i,r){const s=!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB),o=e.getXY();if(!s&&t.getGeometryType()===n.enumPolygon&&0!==m(t,o,0))return f(i,o,0,0),f(r,o,-1,Number.NaN),0;t.getImpl().getAccelerators();let u=this.m_maxSqrDistance,c=u,h=-1;const l=new _,g=t.querySegmentIterator();let y=!1;for(;g.nextPath();)for(;g.hasNextSegment();){const e=g.nextSegment();e.queryEnvelope(l);const t=l.sqrDistance(o);if(t>u)continue;if(!this.m_bIsNearCalc&&y&&t===u)continue;h=e.getClosestCoordinate(o,!1);const n=e.getCoord2D(h);if(c=a.sqrDistance(o,n),this.m_bIsNearCalc){if(c<=u)return 0}else if(!(c>u)&&(!y||c<u)&&(u=c,f(i,o,0,0),f(r,n,g.getStartPointIndex(),h),y=!0,0===u))return 0}return y?Math.sqrt(u):Number.POSITIVE_INFINITY}distancePointEnvelope(e,t,n,i){const r=e.getXY();f(n,r,0,0),f(i,r,-1,Number.NaN);const s=t.asEnvelope2D();return!s.contains(r)?Math.sqrt(s.sqrDistance(r,i.outPoint)):0}distanceMultipointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipoint(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:return this.distanceMultipointMultipoint(e,t,i,r,1,1);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipointMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipointMultipath(e,E(t),i,r);default:return Number.NaN}}distanceMultipointMultipoint(n,i,r,s,o,m){const g={stack:[],error:void 0,hasError:!1};try{if(this.m_bIsNearCalc&&1===o&&1===m){const e=Math.trunc(c(Math.sqrt(n.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(i.getPointCount())+1,1,h()));if((e>=4||t>=4)&&this.distanceMultipointMultipoint(n,i,r,s,e,t)<=this.m_maxSqrDistance)return 0}let t=this.m_maxSqrDistance;const y=[n],_=[i],D=this.swapGeometriesIfBGtA(y,_);D&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),m=u(o,o=m),d(r,s)),e(g,l(()=>{d(r,s),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!D),!1);const p=y[0].getImpl(),v=_[0].getImpl(),N=p.getPointCount(),P=v.getPointCount(),I=P>1;let q=!1;const M=new a,x=new a;for(let e=0;e<N;e+=o){if(p.queryXY(e,M),I){const e=this.m_env2DgeometryB.sqrDistance(M);if(this.m_bIsNearCalc){if(e>t)continue;if(this.m_env2DgeometryB.sqrMaxMinDistance(M)<=t)return 0}else if(e>=t)continue}for(let n=0;n<P;n+=m){v.queryXY(n,x);const i=a.sqrDistance(M,x);if(this.m_bIsNearCalc){if(i<=t)return 0}else if(!(i>t||q&&i===t)&&(!q||i<t)&&(f(r,M,e,0),f(s,x,n,0),q=!0,t=i,0===t))return q?Math.sqrt(t):Number.POSITIVE_INFINITY}}return q?Math.sqrt(t):Number.POSITIVE_INFINITY}catch(y){g.error=y,g.hasError=!0}finally{t(g)}}distanceMultipointMultipath(e,t,i,r){let s=!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)&&t.getGeometryType()===n.enumPolygon;const o=t.querySegmentIterator();o.stripAttributes();const u=new _,c=new a;let h=this.m_maxSqrDistance;const l=e.getImpl(),g=l.getPointCount(),y=g>1;let D=!1;for(;o.nextPath();)for(;o.hasNextSegment();){const e=o.nextSegment();if(e.queryLooseEnvelope(u),y){const e=u.sqrDistanceEnvelope(this.m_env2DgeometryA,null,null);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h||D&&e===h)continue}for(let n=0;n<g;n++){if(l.queryXY(n,c),s&&0!==m(t,c,0))return f(i,c,-1,Number.NaN),f(r,c,n,0),0;{const e=u.sqrDistance(c);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h)continue}const a=e.getClosestCoordinate(c,!1),g=e.getCoord2D(a);c.subThis(g);const y=c.sqrLength();if(this.m_bIsNearCalc){if(y<=h)return 0}else if(!(y>h)&&(!D||y<h)&&(h=y,f(i,l.getXY(n),n,0),f(r,g,o.getStartPointIndex(),a),D=!0,0===h))return 0}s=!1}return D?Math.sqrt(h):Number.POSITIVE_INFINITY}distanceEnvelopeGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointEnvelope(t,e,r,i);case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,E(e),r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(E(e),t,i,r);case n.enumEnvelope:return this.distanceEnvelopeEnvelope(e,t,i,r);default:return Number.NaN}}distanceEnvelopeEnvelope(e,t,n,i){n.t=Number.NaN,n.index=-1,i.t=Number.NaN,i.index=-1;const r=e.asEnvelope2D(),s=t.asEnvelope2D();return Math.sqrt(r.sqrDistanceEnvelope(s,n.outPoint,i.outPoint))}distanceMultipathGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipathMultipath(e,E(t),i,r);default:return Number.NaN}}distanceMultipathMultipath(n,i,s,o){const m={stack:[],error:void 0,hasError:!1};try{const t=[n],a=[i],g=this.swapGeometriesIfAGtB(t,a);g&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),d(s,o)),e(m,l(()=>{d(s,o),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!g),!1);const y=t[0],D=a[0],p=y.querySegmentIterator();p.stripAttributes();const N=D.querySegmentIterator();if(N.stripAttributes(),this.m_bIsNearCalc&&this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)<=this.m_maxSqrDistance)return 0;if(this.m_bIsNearCalc){const e=Math.trunc(c(Math.sqrt(y.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(y.getPointCount())+1,1,h()));if(this.distanceMultipointMultipoint(y,D,s,o,e,t)<=this.m_maxSqrDistance)return 0}if(!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)){const e=v(),t=v();if(q(y,D,p,N,e,t))return P(s,e),P(o,t),0}const f=M(y),x=[],E=new r,b=new _,S=new _,B=new _;let A=this.m_maxSqrDistance,T=!0,C=!1;for(let e=0,n=f.length;e<n;++e){y.querySegment(f[e],E,!0);const t=E.get();if(t.queryEnvelope(b),!(b.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>A)){if(this.m_bIsNearCalc&&b.sqrMaxDistanceEnvelope(this.m_env2DgeometryB)<=A)return 0;for(;N.nextPath();){if(this.progress_(),T)D.queryPathEnvelope(N.getPathIndex(),B),x[N.getPathIndex()]=B.clone();else if(b.sqrDistanceEnvelope(x[N.getPathIndex()],null,null)>A)continue;for(;N.hasNextSegment();){const n=N.nextSegment();if(n.queryEnvelope(S),b.sqrDistanceEnvelope(S,null,null)<=A){const i=!b.isIntersecting(S),r=[0],m=[0];let a=t.distance(n,i,r,m);if(a*=a,this.m_bIsNearCalc&&a<=this.m_maxSqrDistance)return 0;if(a<A||a===A&&f[e]<s.index){if(C=!0,I(s,t,f[e],r[0]),I(o,n,N.getStartPointIndex(),m[0]),0===a)return 0;A=a}}}}N.resetToFirstPath(),T=!1}}return C?Math.sqrt(A):Number.POSITIVE_INFINITY}catch(a){m.error=a,m.hasError=!0}finally{t(m)}}swapGeometriesIfAGtB(e,t){return i(e[0])>i(t[0])&&(t[0]=u(e[0],e[0]=t[0]),!0)}swapGeometriesIfBGtA(e,t){return this.swapGeometriesIfAGtB(t,e)}}export{b as D,v as m,M as s,q as w};
|
|
5
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{G as n,v as i}from"./Geometry.js";import{S as r,a as s,s as o}from"./MultiPathImpl.js";import{H as m}from"./UnitFactory.js";import{P as a,c as u,s as c,i as h,h as l,j as g,d as y}from"./Point2D.js";import{Envelope2D as _}from"./Envelope2D.js";import{P as D,E as p}from"./Envelope.js";function v(){return{outPoint:new a,index:-1,t:Number.NaN}}function N(e,t,n){return{outPoint:e.clone(),index:t,t:n}}function f(e,t,n,i){e.outPoint.assign(t),e.index=n,e.t=i}function P(e,t){e.outPoint.assign(t.outPoint),e.index=t.index,e.t=t.t}function I(e,t,n,i){e.index=n,e.t=i,t.queryCoord2D(e.t,e.outPoint)}function d(e,t){const n=v();P(n,e),P(e,t),P(t,n)}function q(e,t,i,r,s,o){if(e.getGeometryType()===n.enumPolygon){for(;r.nextPath();)if(r.hasNextSegment()){const t=r.nextSegment();if(0!==m(e,t.getEndXY(),0))return f(s,t.getEndXY(),-1,Number.NaN),f(o,t.getEndXY(),-1,Number.NaN),!0}r.resetToFirstPath()}if(t.getGeometryType()===n.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const e=i.nextSegment();if(0!==m(t,e.getEndXY(),0))return f(s,e.getEndXY(),-1,Number.NaN),f(o,e.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function M(e){const t=e.getPathCount(),n=y(e.getSegmentCount(),0);let i=0;for(let r=0;r<t;++r){const t=i+e.getSegmentCountPath(r);for(let s=i,o=e.getPathStart(r);s<t;++s,++o)n[s]=o;i=t}return o(e.getPointCount(),n),n}function x(e,t){return!!Number.isNaN(t)||e<=t}function E(e){const t=new s;return t.addEnvelope(e,!1),t}class b{constructor(e,t){if(this.m_env2DgeometryA=null,this.m_env2DgeometryB=null,this.m_progressCounter=0,this.m_progressTracker=t,this.m_maxSqrDistance=e*e,this.m_maxDistance=e,this.m_bIsNearCalc=!1,Number.isNaN(this.m_maxDistance)?this.m_maxDistance=Number.POSITIVE_INFINITY:this.m_maxDistance=e,this.m_maxSqrDistance=this.m_maxDistance*this.m_maxDistance,Number.isFinite(this.m_maxSqrDistance)){let e=Math.sqrt(this.m_maxSqrDistance);for(;e<this.m_maxDistance;)this.m_maxSqrDistance*=1+Number.EPSILON,e=Math.sqrt(this.m_maxSqrDistance)}}calculate(e,t,n,i){if(e.getGeometryType()!==D.type||t.getGeometryType()!==D.type){this.m_env2DgeometryA=new _,this.m_env2DgeometryB=new _,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB);if(!x(this.m_env2DgeometryA.distanceFromEnvelope(this.m_env2DgeometryB),this.m_maxDistance))return Number.POSITIVE_INFINITY}const r=N(new a,g(),Number.NaN),s=N(new a,g(),Number.NaN),o=this._ExecuteBruteForce(e,t,r,s);return x(o,this.m_maxDistance)?(null!==n&&P(n,r),null!==i&&P(i,s),o):Number.POSITIVE_INFINITY}isNear(e,t){if(this.m_bIsNearCalc=!0,e.isEmpty()||t.isEmpty())return!1;if(e===t)return!0;let n=!0;if(e.getGeometryType()!==D.type&&e.getGeometryType()!==p.type||t.getGeometryType()!==D.type&&t.getGeometryType()!==p.type||(n=!1),n){if(this.m_env2DgeometryA=new _,this.m_env2DgeometryB=new _,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB),!(this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)>this.m_maxSqrDistance))return!0;if(this.m_env2DgeometryA.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>this.m_maxSqrDistance)return!1}const i=N(new a,g(),Number.NaN),r=N(new a,g(),Number.NaN);return this._ExecuteBruteForce(e,t,i,r)<=this.m_maxDistance}progress_(e=!1){}_ExecuteBruteForce(e,t,i,r){switch(e.getGeometryType()){case n.enumPoint:return this.distancePointGeometry(e,t,i,r);case n.enumMultiPoint:return this.distanceMultipointGeometry(e,t,i,r);case n.enumEnvelope:return this.distanceEnvelopeGeometry(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathGeometry(e,t,i,r);default:return Number.NaN}}distancePointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointPoint(e,t,i,r);case n.enumMultiPoint:return this.distancePointMultipoint(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distancePointMultipath(e,t,i,r);case n.enumEnvelope:return this.distancePointEnvelope(e,t,i,r);default:return Number.NaN}}distancePointPoint(e,t,n,i){const r=e.getXY(),s=t.getXY();return f(n,r,0,0),f(i,s,0,0),Math.sqrt(a.sqrDistance(r,s))}distancePointMultipoint(e,t,n,i){const r=e.getXY();let s=this.m_maxSqrDistance,o=s,m=!1;const u=t.getPointCount(),c=new a;for(let h=0;h<u;++h)if(t.queryXY(h,c),o=a.sqrDistance(r,c),this.m_bIsNearCalc){if(o<=s)return 0}else if(!(o>s)&&(!m&&o===s||o<s)&&(s=o,f(n,r,0,0),f(i,c,h,0),m=!0,0===s))return 0;return m?Math.sqrt(s):Number.POSITIVE_INFINITY}distancePointMultipath(e,t,i,r){const s=!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB),o=e.getXY();if(!s&&t.getGeometryType()===n.enumPolygon&&0!==m(t,o,0))return f(i,o,0,0),f(r,o,-1,Number.NaN),0;t.getImpl().getAccelerators();let u=this.m_maxSqrDistance,c=u,h=-1;const l=new _,g=t.querySegmentIterator();let y=!1;for(;g.nextPath();)for(;g.hasNextSegment();){const e=g.nextSegment();e.queryEnvelope(l);const t=l.sqrDistance(o);if(t>u)continue;if(!this.m_bIsNearCalc&&y&&t===u)continue;h=e.getClosestCoordinate(o,!1);const n=e.getCoord2D(h);if(c=a.sqrDistance(o,n),this.m_bIsNearCalc){if(c<=u)return 0}else if(!(c>u)&&(!y||c<u)&&(u=c,f(i,o,0,0),f(r,n,g.getStartPointIndex(),h),y=!0,0===u))return 0}return y?Math.sqrt(u):Number.POSITIVE_INFINITY}distancePointEnvelope(e,t,n,i){const r=e.getXY();f(n,r,0,0),f(i,r,-1,Number.NaN);const s=t.asEnvelope2D();return!s.contains(r)?Math.sqrt(s.sqrDistance(r,i.outPoint)):0}distanceMultipointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipoint(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:return this.distanceMultipointMultipoint(e,t,i,r,1,1);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipointMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipointMultipath(e,E(t),i,r);default:return Number.NaN}}distanceMultipointMultipoint(n,i,r,s,o,m){const g={stack:[],error:void 0,hasError:!1};try{if(this.m_bIsNearCalc&&1===o&&1===m){const e=Math.trunc(c(Math.sqrt(n.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(i.getPointCount())+1,1,h()));if((e>=4||t>=4)&&this.distanceMultipointMultipoint(n,i,r,s,e,t)<=this.m_maxSqrDistance)return 0}let t=this.m_maxSqrDistance;const y=[n],_=[i],D=this.swapGeometriesIfBGtA(y,_);D&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),m=u(o,o=m),d(r,s)),e(g,l(()=>{d(r,s),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!D),!1);const p=y[0].getImpl(),v=_[0].getImpl(),N=p.getPointCount(),P=v.getPointCount(),I=P>1;let q=!1;const M=new a,x=new a;for(let e=0;e<N;e+=o){if(p.queryXY(e,M),I){const e=this.m_env2DgeometryB.sqrDistance(M);if(this.m_bIsNearCalc){if(e>t)continue;if(this.m_env2DgeometryB.sqrMaxMinDistance(M)<=t)return 0}else if(e>=t)continue}for(let n=0;n<P;n+=m){v.queryXY(n,x);const i=a.sqrDistance(M,x);if(this.m_bIsNearCalc){if(i<=t)return 0}else if(!(i>t||q&&i===t)&&(!q||i<t)&&(f(r,M,e,0),f(s,x,n,0),q=!0,t=i,0===t))return q?Math.sqrt(t):Number.POSITIVE_INFINITY}}return q?Math.sqrt(t):Number.POSITIVE_INFINITY}catch(y){g.error=y,g.hasError=!0}finally{t(g)}}distanceMultipointMultipath(e,t,i,r){let s=!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)&&t.getGeometryType()===n.enumPolygon;const o=t.querySegmentIterator();o.stripAttributes();const u=new _,c=new a;let h=this.m_maxSqrDistance;const l=e.getImpl(),g=l.getPointCount(),y=g>1;let D=!1;for(;o.nextPath();)for(;o.hasNextSegment();){const e=o.nextSegment();if(e.queryLooseEnvelope(u),y){const e=u.sqrDistanceEnvelope(this.m_env2DgeometryA,null,null);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h||D&&e===h)continue}for(let n=0;n<g;n++){if(l.queryXY(n,c),s&&0!==m(t,c,0))return f(i,c,-1,Number.NaN),f(r,c,n,0),0;{const e=u.sqrDistance(c);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h)continue}const a=e.getClosestCoordinate(c,!1),g=e.getCoord2D(a);c.subThis(g);const y=c.sqrLength();if(this.m_bIsNearCalc){if(y<=h)return 0}else if(!(y>h)&&(!D||y<h)&&(h=y,f(i,l.getXY(n),n,0),f(r,g,o.getStartPointIndex(),a),D=!0,0===h))return 0}s=!1}return D?Math.sqrt(h):Number.POSITIVE_INFINITY}distanceEnvelopeGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointEnvelope(t,e,r,i);case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,E(e),r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(E(e),t,i,r);case n.enumEnvelope:return this.distanceEnvelopeEnvelope(e,t,i,r);default:return Number.NaN}}distanceEnvelopeEnvelope(e,t,n,i){n.t=Number.NaN,n.index=-1,i.t=Number.NaN,i.index=-1;const r=e.asEnvelope2D(),s=t.asEnvelope2D();return Math.sqrt(r.sqrDistanceEnvelope(s,n.outPoint,i.outPoint))}distanceMultipathGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipathMultipath(e,E(t),i,r);default:return Number.NaN}}distanceMultipathMultipath(n,i,s,o){const m={stack:[],error:void 0,hasError:!1};try{const t=[n],a=[i],g=this.swapGeometriesIfAGtB(t,a);g&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),d(s,o)),e(m,l(()=>{d(s,o),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!g),!1);const y=t[0],D=a[0],p=y.querySegmentIterator();p.stripAttributes();const N=D.querySegmentIterator();if(N.stripAttributes(),this.m_bIsNearCalc&&this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)<=this.m_maxSqrDistance)return 0;if(this.m_bIsNearCalc){const e=Math.trunc(c(Math.sqrt(y.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(y.getPointCount())+1,1,h()));if(this.distanceMultipointMultipoint(y,D,s,o,e,t)<=this.m_maxSqrDistance)return 0}if(!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)){const e=v(),t=v();if(q(y,D,p,N,e,t))return P(s,e),P(o,t),0}const f=M(y),x=[],E=new r,b=new _,S=new _,B=new _;let A=this.m_maxSqrDistance,T=!0,C=!1;for(let e=0,n=f.length;e<n;++e){y.querySegment(f[e],E,!0);const t=E.get();if(t.queryEnvelope(b),!(b.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>A)){if(this.m_bIsNearCalc&&b.sqrMaxDistanceEnvelope(this.m_env2DgeometryB)<=A)return 0;for(;N.nextPath();){if(this.progress_(),T)D.queryPathEnvelope(N.getPathIndex(),B),x[N.getPathIndex()]=B.clone();else if(b.sqrDistanceEnvelope(x[N.getPathIndex()],null,null)>A)continue;for(;N.hasNextSegment();){const n=N.nextSegment();if(n.queryEnvelope(S),b.sqrDistanceEnvelope(S,null,null)<=A){const i=!b.isIntersecting(S),r=[0],m=[0];let a=t.distance(n,i,r,m);if(a*=a,this.m_bIsNearCalc&&a<=this.m_maxSqrDistance)return 0;if(a<A||a===A&&f[e]<s.index){if(C=!0,I(s,t,f[e],r[0]),I(o,n,N.getStartPointIndex(),m[0]),0===a)return 0;A=a}}}}N.resetToFirstPath(),T=!1}}return C?Math.sqrt(A):Number.POSITIVE_INFINITY}catch(a){m.error=a,m.hasError=!0}finally{t(m)}}swapGeometriesIfAGtB(e,t){return i(e[0])>i(t[0])&&(t[0]=u(e[0],e[0]=t[0]),!0)}swapGeometriesIfBGtA(e,t){return this.swapGeometriesIfAGtB(t,e)}}export{b as D,v as m,M as s,q as w};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
5
|
+
import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{GaussianSplatUnpacking as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as d,If as u}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as p}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{NoParameters as g}from"../views/webgl/NoParameters.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";class x extends g{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.minSplatOpacity=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function w(e){const n=new h;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new f("splatOrderTexture",e=>e.splatOrder),new f("splatAtlasTexture",e=>e.splatAtlas),new v("numSplats",e=>e.totalGaussians),new l("focalLength",e=>e.focalLength),new l("minSplatRadius",e=>e.minSplatRadius),new l("minSplatOpacity",e=>e.minSplatOpacity),new r("tanFov",e=>e.tanFov),new c("cameraDelta",e=>e.cameraDelta),new c("cameraPos8k",e=>e.cameraPos8k),new p("fullWidth",({camera:e})=>e.viewport[2]),new p("fullHeight",({camera:e})=>e.viewport[3]),new m("proj",e=>e.camera.projectionMatrix),new m("view",e=>e.camera.viewMatrix),new s("cameraPosition",e=>e.camera.eye)),n.vertex.include(t),n.vertex.include(o),n.vertex.include(i),n.include(a,e),n.vertex.code.add(d`float ndcToPixel(float ndcCoord, float screenSize) {
|
|
6
6
|
return ((ndcCoord + 1.0) * screenSize - 1.0) * 0.5;
|
|
7
|
-
}`),n.vertex.main.add("\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasSize = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % uint(splatAtlasSize);\n uint gaussianIndexY = gaussianIndex / uint(splatAtlasSize);\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % uint(splatAtlasSize);\n uint headerIndexY = headerIndex / uint(splatAtlasSize);\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(vColor.a < minSplatOpacity) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian); \n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n \n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n \n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix). \n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float lambda1 = mid + sqrt(max(0.1, mid * mid - determinant));\n float lambda2 = mid - sqrt(max(0.1, mid * mid - determinant));\n float radius = ceil(3. * sqrt(max(lambda1, lambda2)));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = radius * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + radius * corner;\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n \n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n ");const
|
|
7
|
+
}`),n.vertex.main.add("\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasSize = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % uint(splatAtlasSize);\n uint gaussianIndexY = gaussianIndex / uint(splatAtlasSize);\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % uint(splatAtlasSize);\n uint headerIndexY = headerIndex / uint(splatAtlasSize);\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(vColor.a < minSplatOpacity) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian); \n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n \n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n \n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix). \n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float lambda1 = mid + sqrt(max(0.1, mid * mid - determinant));\n float lambda2 = mid - sqrt(max(0.1, mid * mid - determinant));\n float radius = ceil(3. * sqrt(max(lambda1, lambda2)));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = radius * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + radius * corner;\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n \n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n ");const g=e.depthPass;return n.fragment.main.add(`\n discardByTerrainDepth();\n vec2 offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float A = conicOpacity.x;\n float B = conicOpacity.y;\n float C = conicOpacity.z;\n float opacityScale = conicOpacity.w;\n float gaussianExponent = -0.5 * (A * x * x + 2.0 * B * x * y + C * y * y);\n\n // A positive exponent indicates alpha > 1, this should not happen\n if (gaussianExponent > 0.0) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n \n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, opacityScale * gaussianFalloff);\n\n // discard low alpha fragments since their contribution would not be visible\n if (alpha < 1./255.) {\n discard;\n }\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently \n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using \n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${u(g,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const y=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:x,build:w},Symbol.toStringTag,{value:"Module"}));export{x as G,y as a,w as b};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{a as i,G as s,g as n,d as o,v as a,h as m}from"./Geometry.js";import{S as r,a as u}from"./MultiPathImpl.js";import{r as h,O as c,E as l,aa as _,ab as p,ad as d,ae as g,af as x,ag as y,ah as P,ai as S,a7 as f,aj as D,ak as G,al as v}from"./UnitFactory.js";import{d as T,a as b}from"./Envelope.js";import{Envelope2D as w}from"./Envelope2D.js";import{P as M,c as E,l as R,E as I,n as C}from"./Point2D.js";import{T as B}from"./Transformation2D.js";import{s as A,w as q,m as N}from"./Distance2DCalculator-CXhBP-8I.js";import{O as F}from"./OperatorShapePreservingDensify.js";import{O as X}from"./OperatorClip.js";function Y(){return new w}class k{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new _,this.m_peR2=new _,this.m_peR3=new _,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,s){const n=this.m_peR1,o=this.m_peR2,a=this.m_peR3;p.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,s*this.m_unitToRad,a,n,o,0);const m=Math.cos(n.val),r=Math.cos(o.val+3.141592653589793),u=e*this.m_unitToRad,h=v.phiToEta(this.m_e2,u),c=Math.sin(n.val)*Math.cos(h);let l=e;if(m*r<0){const t=m<0?-1:1,e=Math.acos(Math.abs(c))*t;l=v.etaToPhi(this.m_e2,e)/this.m_unitToRad}let _=C((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(_)>Math.PI&&(_=_>0?_-2*Math.PI:_+2*Math.PI),_/=this.m_unitToRad,i=t+_;const d=Y();return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,s),d.ymin=Math.min(d.ymin,l),d.ymax=Math.max(e,s),d.ymax=Math.max(d.ymax,l),d}minDistanceGeodesic(t,e){const i=O(t),s=O(e);if(i&&s)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const n=this.normalizeGeodesic_(e,t);return U(t,n)?t.ymin>=n.ymax?this.minDistanceGeodesicUpDown_(t,n):n.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(n,t):t.xmin>n.xmax?this.minDistanceGeodesicLeftRight_(n,t):this.minDistanceGeodesicLeftRight_(t,n):0}normalizeGeodesic_(t,e){const i=t.clone(),s=t.clone();let n=V(i,e);if(0===n)return i;for(;s.xmax>e.xmin;){s.xmin-=this.m_u360,s.xmax-=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}for(s.assign(t);s.xmin<e.xmax;){s.xmin+=this.m_u360,s.xmax+=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}return i}lowerDistanceGeodetic_(t,e,i,s){const n=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,a=v.phiToPhig(this.m_e2,this.m_unitToRad*e),m=v.phiToPhig(this.m_e2,this.m_unitToRad*s);p.geodeticDistance(o,0,this.m_unitToRad*t,a,this.m_unitToRad*i,m,n,null,null,0)}return n.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,s)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,s)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let s=Math.abs(t.xmin-e.xmax);for(;s>this.m_u180;)s-=this.m_u360;return Math.abs(i)<=Math.abs(s)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,s;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),s=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,s),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,s,n,o){let a=this.lowerDistanceGeodeticPtMeridional_(t,e,s,n,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,s,n,o);let r=this.lowerDistanceGeodeticPtMeridional_(s,n,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(s,o,t,e,i);return a=Math.min(a,m),r=Math.min(r,u),Math.min(a,r)}lowerDistanceGeodeticPtMeridional_(t,e,i,s,n){const o=this.m_b*this.m_b/this.m_a,a=v.phiToPhig(this.m_e2,this.m_unitToRad*e),m=v.phiToPhig(this.m_e2,this.m_unitToRad*s),r=v.phiToPhig(this.m_e2,this.m_unitToRad*n),u=this.m_peR1,h=this.m_peR2;p.geodeticDistance(o,0,this.m_unitToRad*i,m,this.m_unitToRad*t,a,u,null,null,0),p.geodeticDistance(o,0,this.m_unitToRad*i,r,this.m_unitToRad*t,a,h,null,null,0);const c=d(1,0,new M(this.m_unitToRad*t,a)),l=d(1,0,new M(this.m_unitToRad*i,m)),_=d(1,0,new M(this.m_unitToRad*i,r));let g=new T;g.setCrossProductVector(l,_);const x=l.dotProduct(_);if(g.length()<1.568e-10)return x>=0?Math.min(u.val,h.val):0;g=g.getUnitVector();let y=new T;if(y.setCrossProductVector(g,c),y.length()<1.568e-10){return Math.min(u.val,h.val)-1e-5*o}y=y.getUnitVector();let P=c.sub(g.mul(c.dotProduct(g)));{const e=new T;e.setCrossProductVector(l,P);const i=new T;i.setCrossProductVector(P,_);let s=g.dotProduct(e)>0&&g.dotProduct(i)>0;if(s||(P.negateThis(),e.setCrossProductVector(l,P),i.setCrossProductVector(P,_),s=g.dotProduct(e)>0&&g.dotProduct(i)>0),s){P=P.getUnitVector();const e=G(1,0,P),i=this.m_peR3;p.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const s=Math.min(u.val,h.val);return Math.min(s,i.val)}}return Math.min(u.val,h.val)}}function O(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function U(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}function V(t,e){let i,s=0;return i=t.xmin-e.xmax,i>s&&(s=i),i=e.xmin-t.xmax,i>s&&(s=i),s}class L{}function j(t){return{outPoint:void 0===t?new M:t.clone()}}function z(t,e){t.outPoint.assign(e.outPoint)}function H(){return new w}class J{constructor(t,e,i,s,n=0,o=4){this.m_ptDistFrom=new M,this.m_segStartPt=new M,this.m_segEndPt=new M,this.m_geodeticLength=new _,this.m_az12=new _,this.m_minGeodeticDist=new _,this.m_segStartPt3d=new T,this.m_segEndPt3d=new T,this.m_sr=s,this.m_distCurveType=n,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=h();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return i=>{let s;switch(this.m_segCurveType){case 0:case 1:case 3:{const o={stack:[],error:void 0,hasError:!1};try{const e=t(o,new _,!1),n=t(o,new _,!1);p.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*i,this.m_az12.val,e,n,this.m_segCurveType),s=new M(e.val,n.val);break}catch(n){o.error=n,o.hasError=!0}finally{e(o)}}case 2:{const t=T.lerp(this.m_segStartPt3d,this.m_segEndPt3d,i);s=G(this.m_a,this.m_eSquared,t);break}case 4:s=M.lerp(this.m_segStartPt,this.m_segEndPt,i),this.m_bIsPannablePcs&&(x(this.m_sr,0,[s],1),s.mulThis(this.m_rpu));break;default:o("Invalid curve type")}return p.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,s.x,s.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:p.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=M.distance(this.m_segStartPt,this.m_segEndPt);break;default:o("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function K(){return new L}class Q{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,s,n){this.m_boxGeomA=H(),this.m_boxGeomB=H(),this.m_envGeomA=new w,this.m_envGeomB=new w,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new B,this.m_scaleToDegrees=new B,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=s,this.m_maxDeviation=n,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=h();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new k(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,s){const n=j(),o=j();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,n,o))return i&&z(i,n),s&&z(s,o),0;const a=this.prepareGeometry(t);if(a.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(a,m);const r=this._ExecuteBruteForce(a,m,n,o);return r>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(n),z(i,n)),s&&(this.prepareOutput(o),z(s,o)),r)}createDistanceFunctor(t,e,i){const s=new J(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||s.setSegmentCurveType(2),s}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new c).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=l(this.m_inputSR,this.m_inputGCS,null);t=(new c).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,n,o){switch(t.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointPoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=i.getXY();e.scale(this.m_rpu);const m=s.getXY();m.scale(this.m_rpu),n.outPoint.assign(e),o.outPoint.assign(m);const r=t(a,new _,!1);return p.geodeticDistance(this.m_a,this.m_eSquared,e.x,e.y,m.x,m.y,r,null,null,this.m_distCurveType),r.val}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(i,s);const e=this.estimateMinimumDistance(n,o);let m=e<this.m_maxDistance?e:this.m_maxDistance;const r=i.getXY();r.scale(this.m_rpu),n.outPoint.assign(r);const u=d(this.m_a,this.m_eSquared,r),h=new M,c=s.getImpl(),l=t(a,new _,!1),g=c.getPointCount();for(let t=0;t<g;++t){c.queryXY(t,h),h.scale(this.m_rpu);const e=d(this.m_a,this.m_eSquared,h);if(!(T.distance(u,e)>m)&&(!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>m)&&(p.geodeticDistance(this.m_a,this.m_eSquared,r.x,r.y,h.x,h.y,l,null,null,this.m_distCurveType),l.val<m&&(m=l.val,o.outPoint=h,0===m))))return m}return m===this.m_maxDistance?Number.POSITIVE_INFINITY:m}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=new M,r=new M;e.assign(i.getXY()),r.assign(i.getXY()),o.outPoint.assign(r.mul(this.m_rpu)),this.m_bIsPannablePcs&&g(this.m_inputSR,[e],1,!1),this.computeEnvelopesAndBoxes(i,s);const u=this.estimateMinimumDistance(o,a);let h=u<this.m_maxDistance?u:this.m_maxDistance;const c=s.getImpl(),l=new M(0,0),_=new M(0,0),p=[1],d=this.canUseSpatialTree(i,s),x=K();d&&this.buildSpatialTree(x,s);const y=H();y.setCoords({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y});const P=t(m,this.createDistanceFunctor(r,l,_),!1),S=c.querySegmentIterator();if(S.stripAttributes(),d)n(0);else for(;S.nextPath();)for(;S.hasNextSegment();){const t=S.nextSegment(),i=this.findOrComputeBoxSegment(S.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(y,i)>h)continue;const s=this.calculateDistanceGeodeticPointSegment(e,r,t,p,P);if(s.second<h&&(this.updateOutputSegment(a,t,s.first),h=s.second,0===h))return 0}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=t(a,new _,!1);this.computeEnvelopesAndBoxes(i,s);const m=this.estimateMinimumDistance(n,o);let r=m<this.m_maxDistance?m:this.m_maxDistance;const u=new M,h=new M,c=i.getImpl(),l=s.getImpl(),g=H(),x=c.getPointCount(),y=l.getPointCount();for(let t=0;t<x;++t){if(u.assign(c.getXY(t)),g.setCoords({xmin:u.x,ymin:u.y,xmax:u.x,ymax:u.y}),this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>r)continue;u.scale(this.m_rpu);const i=d(this.m_a,this.m_eSquared,u);for(let t=0;t<y;++t){h.assign(l.getXY(t)),h.scale(this.m_rpu);const s=d(this.m_a,this.m_eSquared,h);if(!(T.distance(i,s)>=r)&&(p.geodeticDistance(this.m_a,this.m_eSquared,u.x,u.y,h.x,h.y,e,null,null,this.m_distCurveType),e.val<r&&(n.outPoint.assign(u),o.outPoint.assign(h),r=e.val,0===r)))return r}}return r===this.m_maxDistance?Number.POSITIVE_INFINITY:r}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticMultipointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=s.getImpl().querySegmentIterator();e.stripAttributes(),this.computeEnvelopesAndBoxes(i,s);const r=this.estimateMinimumDistance(o,a);let u=r<this.m_maxDistance?r:this.m_maxDistance;const h=new M,c=new M(0,0),l=new M(0,0),_=new M(0,0),p=[0],d=H(),x=t(m,this.createDistanceFunctor(c,l,_),!1),y=K(),P=this.canUseSpatialTree(i,s);P&&this.buildSpatialTree(y,s);const S=i.getPointCount();for(let t=0;t<S;++t)if(h.assign(i.getXY(t)),c.assign(i.getXY(t)),this.m_bIsPannablePcs&&g(this.m_inputSR,[h],1,!1),d.setCoords({xmin:c.x,ymin:c.y,xmax:c.x,ymax:c.y}),!(this.m_envHelper.minDistanceGeodesic(d,this.m_boxGeomB)>u))if(x.setPointDistFrom(c),P)n(0);else{for(;e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(this.m_envHelper.minDistanceGeodesic(d,this.findOrComputeBoxSegment(e.getStartPointIndex(),t,this.m_segmentBoxesB))>u)continue;const i=this.calculateDistanceGeodeticPointSegment(h,c,t,p,x);if(i.second<u&&(o.outPoint.assign(c.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),u=i.second,0===u))return 0}e.resetToFirstPath()}return u===this.m_maxDistance?Number.POSITIVE_INFINITY:u}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,o,n);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,s){const n=[t],o=[e],a=this.swapGeometries(n,o),m=n[0],r=o[0];this.computeEnvelopesAndBoxes(n[0],o[0]);const u=this.estimateMinimumDistance(i,s),h=this.calculateDistanceGeodeticMultipathMultipath_(m,r,i,s,u);return a&&(s.outPoint=E(i.outPoint,i.outPoint=s.outPoint)),h}calculateDistanceGeodeticMultipathMultipath_(i,s,o,a,m=Number.MAX_VALUE){const u={stack:[],error:void 0,hasError:!1};try{let e=m;const h=new M(0,0),c=new M,l=new M(0,0),_=new M,p=new M(0,0),d=new M,g=new M,P=new M,S=[new M],f=[0],D=[0],G=H(),v=H(),T=t(u,this.createDistanceFunctor(p,h,l),!1),b=K(),w=this.canUseSpatialTree(i,s);w&&this.buildSpatialTree(b,s);const E=s.querySegmentIterator();E.stripAttributes();const R=new r,I=A(i);for(let t=0;t<I.length;++t){const s=I[t];i.getSegmentBuffer(s,R,!0);const m=R.get();if(G.assign(this.findOrComputeBoxSegment(s,m,this.m_segmentBoxesA)),w)n(0);else{if(p.assign(m.getStartXY()),d.assign(m.getStartXY()),g.assign(m.getEndXY()),P.assign(m.getEndXY()),this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[d],1),x(this.m_inputSR,0,[P],1)),this.m_envHelper.minDistanceGeodesic(G,this.m_boxGeomB)>e)continue;for(;E.nextPath();){for(;E.hasNextSegment();){const t=E.nextSegment();if(h.assign(t.getStartXY()),c.assign(t.getStartXY()),l.assign(t.getEndXY()),_.assign(t.getEndXY()),m.intersect(t,S,f,D,this.m_tolerance))return this.updateOutputSegment(o,m,f[0]),this.updateOutputSegment(a,t,D[0]),0;if(this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[c],1),x(this.m_inputSR,0,[_],1)),v.assign(this.findOrComputeBoxPoint(E.getStartPointIndex(),c,_,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(G,v)>e)continue;T.setSegmentEndPoints(h,l),T.setPointDistFrom(d);let i=y(T.makeFunctor(),0,1,1e-10);if(i.second<e&&(o.outPoint.assign(d.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setPointDistFrom(P),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(o.outPoint.assign(P.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setSegmentEndPoints(p,g),T.setPointDistFrom(c),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(c.mul(this.m_rpu)),e=i.second,0===e))break;if(T.setPointDistFrom(_),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(_.mul(this.m_rpu)),e=i.second,0===e))break}if(0===e)return 0}E.resetToFirstPath()}}return e===this.m_maxDistance?Number.POSITIVE_INFINITY:e}catch(h){u.error=h,u.hasError=!0}finally{e(u)}}calculateDistanceGeodeticPointSegment(t,e,i,s,n){const o=i.getStartXY(),a=i.getEndXY();return i.intersectPoint(t,s,this.m_tolerance)?R(s[0],0):(n.setPointDistFrom(e),n.setSegmentEndPoints(o,a),y(n.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.enumPoint||i===s.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=P(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new F).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new c).execute(e,t,this.m_progressTracker)}const n=new w;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new w(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new X).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=S(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new w;t.queryEnvelope(i);const s=this.m_inputSR.getPannableExtent();if(s.containsEnvelope(i))return t;const n=new I;s.queryIntervalX(n);const o=new I;return i.queryIntervalX(o),t=n.contains(o)?f(t,this.m_inputSR):(new c).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&g(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&x(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new w(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),b(null,i)}envelopeToPolygon(t){const e=new u;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.enumPoint:return this.computeBoxPoint(t,e);case s.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.enumPolyline:case s.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:o("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const s=H();return s.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),s}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let n=0;n<e.length;++n)e[n].mulThis(this.m_rpu);const s=H();return t.queryEnvelope(s),s}computeBoxMultiPath(t,e,i){let s=!0;const n=H();n.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),a=t.getStartXY(),m=t.getEndXY();if(this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[a],1),x(this.m_inputSR,0,[m],1)),s){for(let t=0;t<4;++t)e.push(a.clone());s=!1}a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a),m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m);const r=this.findOrComputeBoxPoint(o.getStartPointIndex(),a,m,i);n.mergeEnvelope2D(r)}for(let a=0;a<e.length;++a)e[a].mulThis(this.m_rpu);return n}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let s=H();if(e.queryEnvelope(s),this.m_bIsPannablePcs){const t=M.construct(s.xmin,s.ymin),e=M.construct(s.xmax,s.ymax);x(this.m_inputSR,0,[t],1),x(this.m_inputSR,0,[e],1),s=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,s),s}return i.get(t)}findOrComputeBoxPoint(t,e,i,s){if(!s.has(t)){let n=H();return n.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(n=this.m_envHelper.calculateBbox(n.xmin,n.ymin,n.xmax,n.ymax)),s.set(t,n),n}return s.get(t)}estimateMinimumDistance(i,s){const n={stack:[],error:void 0,hasError:!1};try{const e=t=>d(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(e),a=this.m_boundaryPtsB.map(e);let m=Number.MAX_VALUE,r=0,u=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=T.distance(o[t],a[e]);i<m&&(m=i,r=t,u=e)}i.outPoint.assign(this.m_boundaryPtsA[r]),s.outPoint.assign(this.m_boundaryPtsB[u]);const h=t(n,new _,!1);return p.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[r].x,this.m_boundaryPtsA[r].y,this.m_boundaryPtsB[u].x,this.m_boundaryPtsB[u].y,h,null,null,this.m_distCurveType),h.val}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}swapGeometries(t,e){return a(t[0])>a(e[0])&&(e[0]=E(t[0],t[0]=e[0]),this.m_envGeomB=E(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),a=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if(D(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(a===s.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if(D(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(a===s.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let r,u,h=t,c=e;if(o===s.enumEnvelope&&(r=this.envelopeToPolygon(t),h=r,o=s.enumPolygon),a===s.enumEnvelope&&(u=this.envelopeToPolygon(e),c=u,a=s.enumPolygon),m(o)&&m(a)){const t=h.querySegmentIterator(),e=c.querySegmentIterator(),s=N(),o=N();if(q(h,c,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,s){const n=t.getPointCount();for(let o=0;o<n;++o){const n=[2],a=t.getXY(o);if(D(e,[a],1,this.m_tolerance,n),0!==n[0])return i.outPoint.assign(a),s.outPoint.assign(a),!0}return!1}getNearestNeighbourVisitor(t,e,i,s,o,a,m){return n(0),{}}buildSpatialTree(t,e){n(0)}}export{Q as G,J as a,j as m};
|
|
5
|
+
import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{a as i,G as s,g as n,d as o,v as a,h as m}from"./Geometry.js";import{S as r,a as u}from"./MultiPathImpl.js";import{r as h,O as c,x as l,a6 as _,a7 as p,a9 as d,aa as g,ab as x,ac as y,ad as P,ae as S,a3 as f,af as D,ag as G,ah as v}from"./UnitFactory.js";import{d as T,a as b}from"./Envelope.js";import{Envelope2D as w}from"./Envelope2D.js";import{P as M,c as E,l as R,E as I,n as C}from"./Point2D.js";import{T as B}from"./Transformation2D.js";import{s as A,w as q,m as N}from"./Distance2DCalculator-CXhBP-8I.js";import{O as F}from"./OperatorShapePreservingDensify.js";import{O as X}from"./OperatorClip.js";function Y(){return new w}class k{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new _,this.m_peR2=new _,this.m_peR3=new _,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,s){const n=this.m_peR1,o=this.m_peR2,a=this.m_peR3;p.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,s*this.m_unitToRad,a,n,o,0);const m=Math.cos(n.val),r=Math.cos(o.val+3.141592653589793),u=e*this.m_unitToRad,h=v.phiToEta(this.m_e2,u),c=Math.sin(n.val)*Math.cos(h);let l=e;if(m*r<0){const t=m<0?-1:1,e=Math.acos(Math.abs(c))*t;l=v.etaToPhi(this.m_e2,e)/this.m_unitToRad}let _=C((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(_)>Math.PI&&(_=_>0?_-2*Math.PI:_+2*Math.PI),_/=this.m_unitToRad,i=t+_;const d=Y();return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,s),d.ymin=Math.min(d.ymin,l),d.ymax=Math.max(e,s),d.ymax=Math.max(d.ymax,l),d}minDistanceGeodesic(t,e){const i=O(t),s=O(e);if(i&&s)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const n=this.normalizeGeodesic_(e,t);return U(t,n)?t.ymin>=n.ymax?this.minDistanceGeodesicUpDown_(t,n):n.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(n,t):t.xmin>n.xmax?this.minDistanceGeodesicLeftRight_(n,t):this.minDistanceGeodesicLeftRight_(t,n):0}normalizeGeodesic_(t,e){const i=t.clone(),s=t.clone();let n=V(i,e);if(0===n)return i;for(;s.xmax>e.xmin;){s.xmin-=this.m_u360,s.xmax-=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}for(s.assign(t);s.xmin<e.xmax;){s.xmin+=this.m_u360,s.xmax+=this.m_u360;const t=V(s,e);if(t<n&&(i.assign(s),n=t,0===n))return i}return i}lowerDistanceGeodetic_(t,e,i,s){const n=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,a=v.phiToPhig(this.m_e2,this.m_unitToRad*e),m=v.phiToPhig(this.m_e2,this.m_unitToRad*s);p.geodeticDistance(o,0,this.m_unitToRad*t,a,this.m_unitToRad*i,m,n,null,null,0)}return n.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,s)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const s=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,s)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let s=Math.abs(t.xmin-e.xmax);for(;s>this.m_u180;)s-=this.m_u360;return Math.abs(i)<=Math.abs(s)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,s;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),s=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,s),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,s)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(s=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,s)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,s,n,o){let a=this.lowerDistanceGeodeticPtMeridional_(t,e,s,n,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,s,n,o);let r=this.lowerDistanceGeodeticPtMeridional_(s,n,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(s,o,t,e,i);return a=Math.min(a,m),r=Math.min(r,u),Math.min(a,r)}lowerDistanceGeodeticPtMeridional_(t,e,i,s,n){const o=this.m_b*this.m_b/this.m_a,a=v.phiToPhig(this.m_e2,this.m_unitToRad*e),m=v.phiToPhig(this.m_e2,this.m_unitToRad*s),r=v.phiToPhig(this.m_e2,this.m_unitToRad*n),u=this.m_peR1,h=this.m_peR2;p.geodeticDistance(o,0,this.m_unitToRad*i,m,this.m_unitToRad*t,a,u,null,null,0),p.geodeticDistance(o,0,this.m_unitToRad*i,r,this.m_unitToRad*t,a,h,null,null,0);const c=d(1,0,new M(this.m_unitToRad*t,a)),l=d(1,0,new M(this.m_unitToRad*i,m)),_=d(1,0,new M(this.m_unitToRad*i,r));let g=new T;g.setCrossProductVector(l,_);const x=l.dotProduct(_);if(g.length()<1.568e-10)return x>=0?Math.min(u.val,h.val):0;g=g.getUnitVector();let y=new T;if(y.setCrossProductVector(g,c),y.length()<1.568e-10){return Math.min(u.val,h.val)-1e-5*o}y=y.getUnitVector();let P=c.sub(g.mul(c.dotProduct(g)));{const e=new T;e.setCrossProductVector(l,P);const i=new T;i.setCrossProductVector(P,_);let s=g.dotProduct(e)>0&&g.dotProduct(i)>0;if(s||(P.negateThis(),e.setCrossProductVector(l,P),i.setCrossProductVector(P,_),s=g.dotProduct(e)>0&&g.dotProduct(i)>0),s){P=P.getUnitVector();const e=G(1,0,P),i=this.m_peR3;p.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const s=Math.min(u.val,h.val);return Math.min(s,i.val)}}return Math.min(u.val,h.val)}}function O(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function U(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}function V(t,e){let i,s=0;return i=t.xmin-e.xmax,i>s&&(s=i),i=e.xmin-t.xmax,i>s&&(s=i),s}class L{}function j(t){return{outPoint:void 0===t?new M:t.clone()}}function z(t,e){t.outPoint.assign(e.outPoint)}function H(){return new w}class J{constructor(t,e,i,s,n=0,o=4){this.m_ptDistFrom=new M,this.m_segStartPt=new M,this.m_segEndPt=new M,this.m_geodeticLength=new _,this.m_az12=new _,this.m_minGeodeticDist=new _,this.m_segStartPt3d=new T,this.m_segEndPt3d=new T,this.m_sr=s,this.m_distCurveType=n,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=h();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign(d(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return i=>{let s;switch(this.m_segCurveType){case 0:case 1:case 3:{const o={stack:[],error:void 0,hasError:!1};try{const e=t(o,new _,!1),n=t(o,new _,!1);p.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*i,this.m_az12.val,e,n,this.m_segCurveType),s=new M(e.val,n.val);break}catch(n){o.error=n,o.hasError=!0}finally{e(o)}}case 2:{const t=T.lerp(this.m_segStartPt3d,this.m_segEndPt3d,i);s=G(this.m_a,this.m_eSquared,t);break}case 4:s=M.lerp(this.m_segStartPt,this.m_segEndPt,i),this.m_bIsPannablePcs&&(x(this.m_sr,0,[s],1),s.mulThis(this.m_rpu));break;default:o("Invalid curve type")}return p.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,s.x,s.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:p.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=M.distance(this.m_segStartPt,this.m_segEndPt);break;default:o("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function K(){return new L}class Q{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,s,n){this.m_boxGeomA=H(),this.m_boxGeomB=H(),this.m_envGeomA=new w,this.m_envGeomB=new w,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new B,this.m_scaleToDegrees=new B,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=s,this.m_maxDeviation=n,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=h();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new k(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,s){const n=j(),o=j();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,n,o))return i&&z(i,n),s&&z(s,o),0;const a=this.prepareGeometry(t);if(a.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(a,m);const r=this._ExecuteBruteForce(a,m,n,o);return r>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(n),z(i,n)),s&&(this.prepareOutput(o),z(s,o)),r)}createDistanceFunctor(t,e,i){const s=new J(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||s.setSegmentCurveType(2),s}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new c).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=l(this.m_inputSR,this.m_inputGCS,null);t=(new c).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,n,o){switch(t.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,n,o);case s.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticPointPoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=i.getXY();e.scale(this.m_rpu);const m=s.getXY();m.scale(this.m_rpu),n.outPoint.assign(e),o.outPoint.assign(m);const r=t(a,new _,!1);return p.geodeticDistance(this.m_a,this.m_eSquared,e.x,e.y,m.x,m.y,r,null,null,this.m_distCurveType),r.val}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(i,s);const e=this.estimateMinimumDistance(n,o);let m=e<this.m_maxDistance?e:this.m_maxDistance;const r=i.getXY();r.scale(this.m_rpu),n.outPoint.assign(r);const u=d(this.m_a,this.m_eSquared,r),h=new M,c=s.getImpl(),l=t(a,new _,!1),g=c.getPointCount();for(let t=0;t<g;++t){c.queryXY(t,h),h.scale(this.m_rpu);const e=d(this.m_a,this.m_eSquared,h);if(!(T.distance(u,e)>m)&&(!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>m)&&(p.geodeticDistance(this.m_a,this.m_eSquared,r.x,r.y,h.x,h.y,l,null,null,this.m_distCurveType),l.val<m&&(m=l.val,o.outPoint=h,0===m))))return m}return m===this.m_maxDistance?Number.POSITIVE_INFINITY:m}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticPointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=new M,r=new M;e.assign(i.getXY()),r.assign(i.getXY()),o.outPoint.assign(r.mul(this.m_rpu)),this.m_bIsPannablePcs&&g(this.m_inputSR,[e],1,!1),this.computeEnvelopesAndBoxes(i,s);const u=this.estimateMinimumDistance(o,a);let h=u<this.m_maxDistance?u:this.m_maxDistance;const c=s.getImpl(),l=new M(0,0),_=new M(0,0),p=[1],d=this.canUseSpatialTree(i,s),x=K();d&&this.buildSpatialTree(x,s);const y=H();y.setCoords({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y});const P=t(m,this.createDistanceFunctor(r,l,_),!1),S=c.querySegmentIterator();if(S.stripAttributes(),d)n(0);else for(;S.nextPath();)for(;S.hasNextSegment();){const t=S.nextSegment(),i=this.findOrComputeBoxSegment(S.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(y,i)>h)continue;const s=this.calculateDistanceGeodeticPointSegment(e,r,t,p,P);if(s.second<h&&(this.updateOutputSegment(a,t,s.first),h=s.second,0===h))return 0}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,n,o);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipointMultipoint(i,s,n,o){const a={stack:[],error:void 0,hasError:!1};try{const e=t(a,new _,!1);this.computeEnvelopesAndBoxes(i,s);const m=this.estimateMinimumDistance(n,o);let r=m<this.m_maxDistance?m:this.m_maxDistance;const u=new M,h=new M,c=i.getImpl(),l=s.getImpl(),g=H(),x=c.getPointCount(),y=l.getPointCount();for(let t=0;t<x;++t){if(u.assign(c.getXY(t)),g.setCoords({xmin:u.x,ymin:u.y,xmax:u.x,ymax:u.y}),this.m_envHelper.minDistanceGeodesic(g,this.m_boxGeomB)>r)continue;u.scale(this.m_rpu);const i=d(this.m_a,this.m_eSquared,u);for(let t=0;t<y;++t){h.assign(l.getXY(t)),h.scale(this.m_rpu);const s=d(this.m_a,this.m_eSquared,h);if(!(T.distance(i,s)>=r)&&(p.geodeticDistance(this.m_a,this.m_eSquared,u.x,u.y,h.x,h.y,e,null,null,this.m_distCurveType),e.val<r&&(n.outPoint.assign(u),o.outPoint.assign(h),r=e.val,0===r)))return r}}return r===this.m_maxDistance?Number.POSITIVE_INFINITY:r}catch(m){a.error=m,a.hasError=!0}finally{e(a)}}calculateDistanceGeodeticMultipointMultipath(i,s,o,a){const m={stack:[],error:void 0,hasError:!1};try{const e=s.getImpl().querySegmentIterator();e.stripAttributes(),this.computeEnvelopesAndBoxes(i,s);const r=this.estimateMinimumDistance(o,a);let u=r<this.m_maxDistance?r:this.m_maxDistance;const h=new M,c=new M(0,0),l=new M(0,0),_=new M(0,0),p=[0],d=H(),x=t(m,this.createDistanceFunctor(c,l,_),!1),y=K(),P=this.canUseSpatialTree(i,s);P&&this.buildSpatialTree(y,s);const S=i.getPointCount();for(let t=0;t<S;++t)if(h.assign(i.getXY(t)),c.assign(i.getXY(t)),this.m_bIsPannablePcs&&g(this.m_inputSR,[h],1,!1),d.setCoords({xmin:c.x,ymin:c.y,xmax:c.x,ymax:c.y}),!(this.m_envHelper.minDistanceGeodesic(d,this.m_boxGeomB)>u))if(x.setPointDistFrom(c),P)n(0);else{for(;e.nextPath();)for(;e.hasNextSegment();){const t=e.nextSegment();if(this.m_envHelper.minDistanceGeodesic(d,this.findOrComputeBoxSegment(e.getStartPointIndex(),t,this.m_segmentBoxesB))>u)continue;const i=this.calculateDistanceGeodeticPointSegment(h,c,t,p,x);if(i.second<u&&(o.outPoint.assign(c.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),u=i.second,0===u))return 0}e.resetToFirstPath()}return u===this.m_maxDistance?Number.POSITIVE_INFINITY:u}catch(r){m.error=r,m.hasError=!0}finally{e(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,n,o){switch(e.getGeometryType()){case s.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,o,n);case s.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,o,n);case s.enumPolyline:case s.enumPolygon:case s.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,n,o);default:i("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,s){const n=[t],o=[e],a=this.swapGeometries(n,o),m=n[0],r=o[0];this.computeEnvelopesAndBoxes(n[0],o[0]);const u=this.estimateMinimumDistance(i,s),h=this.calculateDistanceGeodeticMultipathMultipath_(m,r,i,s,u);return a&&(s.outPoint=E(i.outPoint,i.outPoint=s.outPoint)),h}calculateDistanceGeodeticMultipathMultipath_(i,s,o,a,m=Number.MAX_VALUE){const u={stack:[],error:void 0,hasError:!1};try{let e=m;const h=new M(0,0),c=new M,l=new M(0,0),_=new M,p=new M(0,0),d=new M,g=new M,P=new M,S=[new M],f=[0],D=[0],G=H(),v=H(),T=t(u,this.createDistanceFunctor(p,h,l),!1),b=K(),w=this.canUseSpatialTree(i,s);w&&this.buildSpatialTree(b,s);const E=s.querySegmentIterator();E.stripAttributes();const R=new r,I=A(i);for(let t=0;t<I.length;++t){const s=I[t];i.getSegmentBuffer(s,R,!0);const m=R.get();if(G.assign(this.findOrComputeBoxSegment(s,m,this.m_segmentBoxesA)),w)n(0);else{if(p.assign(m.getStartXY()),d.assign(m.getStartXY()),g.assign(m.getEndXY()),P.assign(m.getEndXY()),this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[d],1),x(this.m_inputSR,0,[P],1)),this.m_envHelper.minDistanceGeodesic(G,this.m_boxGeomB)>e)continue;for(;E.nextPath();){for(;E.hasNextSegment();){const t=E.nextSegment();if(h.assign(t.getStartXY()),c.assign(t.getStartXY()),l.assign(t.getEndXY()),_.assign(t.getEndXY()),m.intersect(t,S,f,D,this.m_tolerance))return this.updateOutputSegment(o,m,f[0]),this.updateOutputSegment(a,t,D[0]),0;if(this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[c],1),x(this.m_inputSR,0,[_],1)),v.assign(this.findOrComputeBoxPoint(E.getStartPointIndex(),c,_,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(G,v)>e)continue;T.setSegmentEndPoints(h,l),T.setPointDistFrom(d);let i=y(T.makeFunctor(),0,1,1e-10);if(i.second<e&&(o.outPoint.assign(d.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setPointDistFrom(P),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(o.outPoint.assign(P.mul(this.m_rpu)),this.updateOutputSegment(a,t,i.first),e=i.second,0===e))break;if(T.setSegmentEndPoints(p,g),T.setPointDistFrom(c),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(c.mul(this.m_rpu)),e=i.second,0===e))break;if(T.setPointDistFrom(_),i=y(T.makeFunctor(),0,1,1e-10),i.second<e&&(this.updateOutputSegment(o,m,i.first),a.outPoint.assign(_.mul(this.m_rpu)),e=i.second,0===e))break}if(0===e)return 0}E.resetToFirstPath()}}return e===this.m_maxDistance?Number.POSITIVE_INFINITY:e}catch(h){u.error=h,u.hasError=!0}finally{e(u)}}calculateDistanceGeodeticPointSegment(t,e,i,s,n){const o=i.getStartXY(),a=i.getEndXY();return i.intersectPoint(t,s,this.m_tolerance)?R(s[0],0):(n.setPointDistFrom(e),n.setSegmentEndPoints(o,a),y(n.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.enumPoint||i===s.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=P(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new F).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new c).execute(e,t,this.m_progressTracker)}const n=new w;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new w(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new X).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=S(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new w;t.queryEnvelope(i);const s=this.m_inputSR.getPannableExtent();if(s.containsEnvelope(i))return t;const n=new I;s.queryIntervalX(n);const o=new I;return i.queryIntervalX(o),t=n.contains(o)?f(t,this.m_inputSR):(new c).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&g(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&x(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new w(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),b(null,i)}envelopeToPolygon(t){const e=new u;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.enumPoint:return this.computeBoxPoint(t,e);case s.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.enumPolyline:case s.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:o("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const s=H();return s.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),s}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let n=0;n<e.length;++n)e[n].mulThis(this.m_rpu);const s=H();return t.queryEnvelope(s),s}computeBoxMultiPath(t,e,i){let s=!0;const n=H();n.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),a=t.getStartXY(),m=t.getEndXY();if(this.m_bIsPannablePcs&&(x(this.m_inputSR,0,[a],1),x(this.m_inputSR,0,[m],1)),s){for(let t=0;t<4;++t)e.push(a.clone());s=!1}a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a),m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m);const r=this.findOrComputeBoxPoint(o.getStartPointIndex(),a,m,i);n.mergeEnvelope2D(r)}for(let a=0;a<e.length;++a)e[a].mulThis(this.m_rpu);return n}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let s=H();if(e.queryEnvelope(s),this.m_bIsPannablePcs){const t=M.construct(s.xmin,s.ymin),e=M.construct(s.xmax,s.ymax);x(this.m_inputSR,0,[t],1),x(this.m_inputSR,0,[e],1),s=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,s),s}return i.get(t)}findOrComputeBoxPoint(t,e,i,s){if(!s.has(t)){let n=H();return n.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(n=this.m_envHelper.calculateBbox(n.xmin,n.ymin,n.xmax,n.ymax)),s.set(t,n),n}return s.get(t)}estimateMinimumDistance(i,s){const n={stack:[],error:void 0,hasError:!1};try{const e=t=>d(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(e),a=this.m_boundaryPtsB.map(e);let m=Number.MAX_VALUE,r=0,u=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=T.distance(o[t],a[e]);i<m&&(m=i,r=t,u=e)}i.outPoint.assign(this.m_boundaryPtsA[r]),s.outPoint.assign(this.m_boundaryPtsB[u]);const h=t(n,new _,!1);return p.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[r].x,this.m_boundaryPtsA[r].y,this.m_boundaryPtsB[u].x,this.m_boundaryPtsB[u].y,h,null,null,this.m_distCurveType),h.val}catch(o){n.error=o,n.hasError=!0}finally{e(n)}}swapGeometries(t,e){return a(t[0])>a(e[0])&&(e[0]=E(t[0],t[0]=e[0]),this.m_envGeomB=E(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),a=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if(D(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(a===s.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if(D(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(a===s.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let r,u,h=t,c=e;if(o===s.enumEnvelope&&(r=this.envelopeToPolygon(t),h=r,o=s.enumPolygon),a===s.enumEnvelope&&(u=this.envelopeToPolygon(e),c=u,a=s.enumPolygon),m(o)&&m(a)){const t=h.querySegmentIterator(),e=c.querySegmentIterator(),s=N(),o=N();if(q(h,c,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,s){const n=t.getPointCount();for(let o=0;o<n;++o){const n=[2],a=t.getXY(o);if(D(e,[a],1,this.m_tolerance,n),0!==n[0])return i.outPoint.assign(a),s.outPoint.assign(a),!0}return!1}getNearestNeighbourVisitor(t,e,i,s,o,a,m){return n(0),{}}buildSpatialTree(t,e){n(0)}}export{Q as G,J as a,j as m};
|
package/chunks/GeodeticUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as r,__disposeResources as t}from"tslib";import{t as s}from"./Geometry.js";import{m as
|
|
5
|
+
import{__addDisposableResource as r,__disposeResources as t}from"tslib";import{t as s}from"./Geometry.js";import{m as e,P as o}from"./Point2D.js";import"./MultiPathImpl.js";import{h as a,r as n,a6 as i,O as l,a7 as c,ay as m}from"./UnitFactory.js";import"./Envelope.js";function f(m,f,g,u,y,h){const N={stack:[],error:void 0,hasError:!1};try{4===u&&s("");const t=m,p=a(t),S=n();p.querySpheroidData(S);const v=S.e2,T=S.majorSemiAxis,d=p.getUnit().getUnitToBaseFactor(),j=r(N,new i,!1),x=r(N,new i,!1),w=r(N,new i,!1);if(f.isNAN()||g.isNAN())return Number.NaN;const A=e(o,2);A[0].assign(f),A[1].assign(g);const C=e(o,2),E=t.getGCS()!==t?t.getSRToGCSTransform():null;if(E){if(2!==(new l).transform(E,A,2,C))return Number.NaN}else C[0].assign(A[0]),C[1].assign(A[1]);return C[0].scale(d),C[1].scale(d),c.geodeticDistance(T,v,C[0].x,C[0].y,C[1].x,C[1].y,j,x,w,u),y[0]=x.val,h[0]=w.val,j.val}catch(p){N.error=p,N.hasError=!0}finally{t(N)}}function g(l,f,g,u,y,h){const N={stack:[],error:void 0,hasError:!1};try{4===h&&s("");const t=l,p=a(t),S=n();p.querySpheroidData(S);const v=S.e2,T=S.majorSemiAxis,d=p.getUnit().getUnitToBaseFactor(),j=r(N,new i,!1),x=r(N,new i,!1),w=t.getSRToGCSTransform(),A=t.getGCSToSRTransform(),C=e(o,100),E=e(o,100);let G=0;for(let r=0,s=0;r<g;){let t=g-r;t>C.length&&(t=C.length);for(let s=0;s<t;s++)C[s].assign(f[r+s]);if(m(w,C,t,E,null)>0){for(let r=0;r<t;r++){const t=E[r].clone();t.isNAN()?C[r].assign(t):(t.scale(d),c.geodeticCoordinate(T,v,t.x,t.y,u,y,j,x,h),t.x=j.val,t.y=x.val,t.scale(1/d),C[r].assign(t))}G+=m(A,C,t,E,null)}for(let r=0;r<t;r++)f[s+r].assign(E[r]);r+=t,s+=t}return G}catch(p){N.error=p,N.hasError=!0}finally{t(N)}}export{f as calculateDistanceAndAzimuth,g as movePointsByDistance};
|
package/chunks/GlowBlur.glsl.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js";import{NoParameters as
|
|
6
|
-
float locations1D[${t.int(
|
|
7
|
-
float locations1DWeights[${t.int(
|
|
5
|
+
import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js";import{NoParameters as n}from"../views/webgl/NoParameters.js";import{ShaderBuilder as a}from"../views/webgl/ShaderBuilder.js";class c extends n{constructor(){super(...arguments),this.blurRadius=l.sunny}}function u(l){const n=new a,c=n.fragment;n.include(r),c.include(o),c.uniforms.add(new i("colorTexture",e=>e.emissionsToDownsample),new s("blurRadius",e=>e.blurRadius));let u="";const m=15;for(let e=0;e<m;e++){u+=`locations1D[${e}] = ${(e/(m-1)*2-1).toFixed(3).toString()};`}const d=2;let f="";for(let r=0;r<m;r++){f+=`locations1DWeights[${r}] = ${e(r-Math.floor(m/2),d).toFixed(7).toString()};`}const v=0===l.glowStage;return c.code.add(t`
|
|
6
|
+
float locations1D[${t.int(m)}];
|
|
7
|
+
float locations1DWeights[${t.int(m)}];
|
|
8
8
|
|
|
9
9
|
vec4 blurUniformSamples(sampler2D toBlur) {
|
|
10
10
|
vec4 res = vec4(0.0);
|
|
@@ -16,7 +16,7 @@ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"..
|
|
|
16
16
|
${f}
|
|
17
17
|
vec2 pixelCenterShift = 0.5 / size;
|
|
18
18
|
|
|
19
|
-
for(int i=0;i < ${t.int(
|
|
19
|
+
for(int i=0;i < ${t.int(m)}; i++) {
|
|
20
20
|
float uv1D = locations1D[i] + ${v?"pixelCenterShift.x":"pixelCenterShift.y"};
|
|
21
21
|
vec2 uvOffset = ${v?"vec2(uv1D, 0.0)":"vec2(0.0, uv1D)"};
|
|
22
22
|
|
|
@@ -27,4 +27,4 @@ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"..
|
|
|
27
27
|
res.a = clamp(res.a, 0.0, 1.0);
|
|
28
28
|
return res;
|
|
29
29
|
}
|
|
30
|
-
`).main.add(t`fragColor = blurUniformSamples(colorTexture);`),
|
|
30
|
+
`).main.add(t`fragColor = blurUniformSamples(colorTexture);`),n}const m=Object.freeze(Object.defineProperty({__proto__:null,GlowBlurPassParameters:c,build:u},Symbol.toStringTag,{value:"Module"}));export{c as G,m as a,u as b};
|