@arcgis/core 5.0.0-next.86 → 5.0.0-next.88
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/Ground.js +1 -1
- package/Map.d.ts +4 -0
- package/WebLinkChart.d.ts +6 -3
- package/WebScene.js +1 -1
- package/analysis/ShadowCastAnalysis.d.ts +1 -0
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +14 -2
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.js +1 -1
- package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +80 -0
- package/applications/Components/OrientedImageryViewer/galleryUtils.js +5 -0
- package/applications/Components/clipboard.d.ts +106 -0
- package/applications/Components/clipboard.js +5 -0
- package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
- package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
- package/assets/esri/core/t9n/Units.json +1 -1
- package/assets/esri/core/t9n/Units_ar.json +1 -1
- package/assets/esri/core/t9n/Units_bg.json +1 -1
- package/assets/esri/core/t9n/Units_bs.json +1 -1
- package/assets/esri/core/t9n/Units_ca.json +1 -1
- package/assets/esri/core/t9n/Units_cs.json +1 -1
- package/assets/esri/core/t9n/Units_da.json +1 -1
- package/assets/esri/core/t9n/Units_de.json +1 -1
- package/assets/esri/core/t9n/Units_el.json +1 -1
- package/assets/esri/core/t9n/Units_en.json +1 -1
- package/assets/esri/core/t9n/Units_es.json +1 -1
- package/assets/esri/core/t9n/Units_et.json +1 -1
- package/assets/esri/core/t9n/Units_fi.json +1 -1
- package/assets/esri/core/t9n/Units_fr.json +1 -1
- package/assets/esri/core/t9n/Units_he.json +1 -1
- package/assets/esri/core/t9n/Units_hr.json +1 -1
- package/assets/esri/core/t9n/Units_hu.json +1 -1
- package/assets/esri/core/t9n/Units_id.json +1 -1
- package/assets/esri/core/t9n/Units_it.json +1 -1
- package/assets/esri/core/t9n/Units_ja.json +1 -1
- package/assets/esri/core/t9n/Units_ko.json +1 -1
- package/assets/esri/core/t9n/Units_lt.json +1 -1
- package/assets/esri/core/t9n/Units_lv.json +1 -1
- package/assets/esri/core/t9n/Units_nl.json +1 -1
- package/assets/esri/core/t9n/Units_no.json +1 -1
- package/assets/esri/core/t9n/Units_pl.json +1 -1
- package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
- package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
- package/assets/esri/core/t9n/Units_ro.json +1 -1
- package/assets/esri/core/t9n/Units_ru.json +1 -1
- package/assets/esri/core/t9n/Units_sk.json +1 -1
- package/assets/esri/core/t9n/Units_sl.json +1 -1
- package/assets/esri/core/t9n/Units_sr.json +1 -1
- package/assets/esri/core/t9n/Units_sv.json +1 -1
- package/assets/esri/core/t9n/Units_th.json +1 -1
- package/assets/esri/core/t9n/Units_tr.json +1 -1
- package/assets/esri/core/t9n/Units_uk.json +1 -1
- package/assets/esri/core/t9n/Units_vi.json +1 -1
- package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
- package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
- package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6298e71e6c480d6f46e3.js → 0276e689e1371b40cff3.js} +1 -1
- package/assets/esri/core/workers/chunks/045a9cc900bb4ac8afde.js +1 -0
- package/assets/esri/core/workers/chunks/048173088bbeb1f6b8b6.js +1 -0
- package/assets/esri/core/workers/chunks/0be8b9d9ef56c37e74c3.js +1 -0
- package/assets/esri/core/workers/chunks/0bef671165e64f90ac86.js +1 -0
- package/assets/esri/core/workers/chunks/0c025d2b0d3162b07feb.js +1 -0
- package/assets/esri/core/workers/chunks/0c4ed18d67dea0c99f01.js +1 -0
- package/assets/esri/core/workers/chunks/0e0208b87566f4470f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{981f05b5ef6f9c3f7e8a.js → 0fc0fd7618ef25dd6b67.js} +1 -1
- package/assets/esri/core/workers/chunks/{1facc1b45345a095b9a7.js → 149c4181eaea32e9ac15.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1e1666bede364c069fc.js → 15c180deb8d09127ad31.js} +1 -1
- package/assets/esri/core/workers/chunks/1616ee2f6dce0203f1d5.js +1 -0
- package/assets/esri/core/workers/chunks/21bb414cb0623ffad577.js +1 -0
- package/assets/esri/core/workers/chunks/21c84e014c73bd85f4a3.js +1 -0
- package/assets/esri/core/workers/chunks/262677294d8c653e2b0b.js +1 -0
- package/assets/esri/core/workers/chunks/{5139bbe8f94df01467c7.js → 28a6a59033baa44bafab.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d56b85d34026507902.js → 28c273f34ffde25cebc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7e40118b4d645e9f8e1.js → 2a12026f1ca9e8900a8b.js} +1 -1
- package/assets/esri/core/workers/chunks/2bc9f407f89d554a43ce.js +1 -0
- package/assets/esri/core/workers/chunks/2f21c5ae4fbe85c2792b.js +1 -0
- package/assets/esri/core/workers/chunks/3332ee9727874953523c.js +1 -0
- package/assets/esri/core/workers/chunks/{c477b0ce55211339c4cb.js → 33f44cc192c72064b5b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{1cf27708d17a4de75b68.js → 3672125daca3df24c8ab.js} +1 -1
- package/assets/esri/core/workers/chunks/37a607f3835ec6f60834.js +1 -0
- package/assets/esri/core/workers/chunks/{3ebd4cdafa7682062447.js → 39dd80c184ac48f877f1.js} +1 -1
- package/assets/esri/core/workers/chunks/3a3adf9b6502ad698aea.js +1 -0
- package/assets/esri/core/workers/chunks/{4a857a7f5e00dfab2b44.js → 3c663035cf872b66cb98.js} +1 -1
- package/assets/esri/core/workers/chunks/{32b09ca094377a305881.js → 3d924488471601a17915.js} +1 -1
- package/assets/esri/core/workers/chunks/{743165f9bc4d85748a0d.js → 42b56932340b6d0bc712.js} +1 -1
- package/assets/esri/core/workers/chunks/4de93e9f91fd891ed96f.js +1 -0
- package/assets/esri/core/workers/chunks/4eb02a03956d1c9c77ee.js +1 -0
- package/assets/esri/core/workers/chunks/{15132d36e7ccbb3c009e.js → 555a252bdb87e340bd02.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d791bfca20791d8e0af.js → 5670e430584f020a3530.js} +1 -1
- package/assets/esri/core/workers/chunks/{70df4331ed29d823bf38.js → 5b297353b058323f8080.js} +1 -1
- package/assets/esri/core/workers/chunks/5ef5dcca7c9b376f7f77.js +1 -0
- package/assets/esri/core/workers/chunks/{c12c095937b21e39ad3c.js → 614c63dae0158da0ed3d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5734aefbce8b6425630c.js → 63b46983155b1672e07a.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b575ac55bc396c0c477.js → 687677acc05b5e87effe.js} +1 -1
- package/assets/esri/core/workers/chunks/{1aee859eaffa54ef2515.js → 727321c615f35d708d46.js} +1 -1
- package/assets/esri/core/workers/chunks/731cab5887c05f221279.js +1 -0
- package/assets/esri/core/workers/chunks/779fe8ccc4041f0b65a0.js +1 -0
- package/assets/esri/core/workers/chunks/782c24211daacb47b0b2.js +1 -0
- package/assets/esri/core/workers/chunks/79067e7d1ebc46afd775.js +1 -0
- package/assets/esri/core/workers/chunks/7a454e4d6df3360e0ab9.js +1 -0
- package/assets/esri/core/workers/chunks/7da56ba34c81d2bbaf25.js +1 -0
- package/assets/esri/core/workers/chunks/{d8b72c6f5f9b2d013b7f.js → 824b45b04b4f4f91dbce.js} +1 -1
- package/assets/esri/core/workers/chunks/836d10ceb93ed19f0aa6.js +1 -0
- package/assets/esri/core/workers/chunks/{68d0bae1816061d96307.js → 837d39e70880e4310bda.js} +1 -1
- package/assets/esri/core/workers/chunks/{746190bb70aa78ba0bfc.js → 8936f9398414be26b83f.js} +4 -4
- package/assets/esri/core/workers/chunks/8bcb2180ecc88a39b317.js +1 -0
- package/assets/esri/core/workers/chunks/{e95f90d59041640727da.js → 8c5d827cbf8869defb87.js} +1 -1
- package/assets/esri/core/workers/chunks/{7449af8f3637c1694660.js → 97155c8ac832d7c46f24.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbf21fda283836e8633c.js → 98cb131b62e30aee35e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{e067bbf12f711fd5b9a6.js → 9b3b9df0aa0fdcc77aa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{5852d291ef41201030d5.js → 9fa1512baa6e95d3f878.js} +21 -21
- package/assets/esri/core/workers/chunks/{8cb13b3776f07536c79f.js → a0d459bdb91ee892d4b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{96616126aaf319cd1c6f.js → a5ed35f53769feb751db.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6530c66804bede649d7.js → aa09e261d1f7dffaad8c.js} +1 -1
- package/assets/esri/core/workers/chunks/b268b4cbf5b0c856f88e.js +1 -0
- package/assets/esri/core/workers/chunks/b2f6cee006788ce3bd16.js +1 -0
- package/assets/esri/core/workers/chunks/{198ae9e02366870d3ec8.js → b46e772e415e2cfca896.js} +1 -1
- package/assets/esri/core/workers/chunks/{cee29c3a94376f6740d7.js → b4ab715a3c506e122f35.js} +1 -1
- package/assets/esri/core/workers/chunks/{b5ca894a6cb1a19676d5.js → b9756dce0b3af1a9dc54.js} +1 -1
- package/assets/esri/core/workers/chunks/baa7e90ec5259057d86b.js +1 -0
- package/assets/esri/core/workers/chunks/{52ae2073604deef63ea2.js → c083045d21636b95f26f.js} +1 -1
- package/assets/esri/core/workers/chunks/c267e57eb7f779115aba.js +1 -0
- package/assets/esri/core/workers/chunks/{5a0c5271304189a2401d.js → c38098f7073a10efdb1e.js} +1 -1
- package/assets/esri/core/workers/chunks/{adecd31fd64d6753682d.js → c7c865dc1a93e781a3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/c8e56dc1239118ac2a60.js +1 -0
- package/assets/esri/core/workers/chunks/cb6083f7294c8de297e1.js +1 -0
- package/assets/esri/core/workers/chunks/cb6c9469d7c16727cd12.js +1 -0
- package/assets/esri/core/workers/chunks/{e7e508258ad27468a6a5.js → cc6d9b2062b9de629111.js} +1 -1
- package/assets/esri/core/workers/chunks/d5386c0e77063c87fddd.js +1 -0
- package/assets/esri/core/workers/chunks/d782671235af2db1c458.js +1 -0
- package/assets/esri/core/workers/chunks/de33ce9b6f4e6c0e1389.js +1 -0
- package/assets/esri/core/workers/chunks/{0abb084b8a137f4fcdfc.js → e1c5773c12d9947bdc5f.js} +1 -1
- package/assets/esri/core/workers/chunks/e55ce8466aa979ac1e6b.js +1 -0
- package/assets/esri/core/workers/chunks/{21739c37160061f229ef.js → e585883d0036aa866420.js} +1 -1
- package/assets/esri/core/workers/chunks/e6d6d664fc9f2cd6a042.js +1 -0
- package/assets/esri/core/workers/chunks/e7cdc2a21104d84aec4a.js +1 -0
- package/assets/esri/core/workers/chunks/e9edf3987039def65859.js +1 -0
- package/assets/esri/core/workers/chunks/{3b434f318fdbbe4111e3.js → edbe52c2848486d64b16.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f8895eb57ec6ab4b318.js → f5a61fa75ac877b5bb74.js} +1 -1
- package/assets/esri/core/workers/chunks/feba6c9ae162a0a8ea3a.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +9 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/{TextureOnly.glsl.js → Texture.glsl.js} +2 -2
- package/chunks/{WaterSurface.glsl.js → Water.glsl.js} +6 -6
- package/chunks/bundle.js +1 -1
- package/chunks/libtess-f32.js +1 -1
- package/chunks/libtess-f64.js +1 -1
- package/config.js +1 -1
- package/copyright.txt +84 -0
- package/core/Promise.d.ts +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/quantity.js +1 -1
- package/core/quantityFormatUtils.js +1 -1
- package/core/units.d.ts +1 -1
- package/core/units.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/editing/Clipboard.js +5 -0
- package/effects/FocusAreas.d.ts +1 -0
- package/form/FormTemplate.js +1 -1
- package/geometry/ellipsoidUtils.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/operators/geodesicBufferOperator.d.ts +1 -0
- package/geometry/operators/geodesicProximityOperator.d.ts +1 -0
- package/geometry/operators/geodeticAreaOperator.d.ts +1 -0
- package/geometry/operators/geodeticDensifyOperator.d.ts +1 -0
- package/geometry/operators/geodeticDistanceOperator.d.ts +1 -0
- package/geometry/operators/geodeticLengthOperator.d.ts +1 -0
- package/geometry/operators/geodeticUtilsOperator.d.ts +1 -0
- package/geometry/operators/shapePreservingProjectOperator.d.ts +1 -0
- package/geometry/operators/support/geographicTransformationUtils.d.ts +1 -0
- package/geometry/projection/projectors.js +1 -1
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/meshUtils/projection.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/planetGCSUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +2 -2
- package/kernel.js +1 -1
- package/layers/CatalogLayer.d.ts +1 -0
- package/layers/FeatureLayer.d.ts +6 -0
- package/layers/GeoJSONLayer.d.ts +1 -0
- package/layers/Layer.d.ts +1 -0
- package/layers/LinkChartLayer.d.ts +2 -2
- package/layers/MediaLayer.d.ts +1 -0
- package/layers/OGCFeatureLayer.d.ts +1 -0
- package/layers/ParquetLayer.d.ts +6 -0
- package/layers/SubtypeGroupLayer.d.ts +1 -0
- package/layers/WFSLayer.d.ts +1 -0
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.d.ts +30 -16
- package/layers/mixins/BlendLayer.d.ts +1 -0
- package/layers/mixins/FeatureEffectLayer.d.ts +2 -0
- package/layers/mixins/ImageryTileMixin.d.ts +2 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/ScaleRangeLayer.d.ts +0 -42
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/raster/datasets/RawBlockCache.js +1 -1
- package/layers/raster/functions/SpectralConversionFunction.js +5 -0
- package/layers/raster/functions/SpectralConversionFunctionArguments.js +5 -0
- package/layers/raster/functions/conversionUtils.js +1 -1
- package/layers/raster/functions/rasterFunctionHelper.js +1 -1
- package/layers/raster/functions/vectorFieldUtils.js +1 -1
- package/layers/support/FeatureFilter.d.ts +4 -0
- package/layers/support/parquetUtils.d.ts +44 -1
- package/layers/support/rasterFunctionUtils.d.ts +0 -4
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/networks/CircuitManager.d.ts +6 -5
- package/networks/CircuitManager.js +1 -1
- package/networks/Network.d.ts +1 -0
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/Circuit.d.ts +2 -4
- package/networks/support/CircuitLocation.d.ts +1 -7
- package/networks/support/CircuitLocation.js +1 -1
- package/networks/support/CircuitPathConnectivityElement.js +1 -1
- package/networks/support/CircuitSection.d.ts +2 -4
- package/networks/support/Subcircuit.d.ts +2 -2
- package/package.json +4 -4
- package/renderers/FlowRenderer.d.ts +1 -0
- package/renderers/support/colorRampUtils.js +1 -1
- package/rest/featureService/types.d.ts +2 -2
- package/rest/imageService.d.ts +36 -19
- package/rest/imageService.js +1 -1
- package/rest/knowledgeGraph/GraphSearch.d.ts +0 -1
- package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +0 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +30 -0
- package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
- package/rest/networks/circuits/verifyCircuits.js +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/rest/networks/support/NetworkElement.d.ts +2 -1
- package/rest/networks/support/TelecomNetworkElement.js +1 -1
- package/rest/networks/support/TraceLocation.d.ts +1 -1
- package/rest/query.d.ts +4 -0
- package/rest/support/BinParametersBase.d.ts +9 -28
- package/rest/support/DateBinParameters.d.ts +0 -17
- package/rest/support/TopFeaturesQuery.d.ts +1 -0
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -0
- package/symbols/LineSymbolMarker.d.ts +2 -2
- package/symbols/SimpleFillSymbol.d.ts +2 -1
- package/symbols/SimpleLineSymbol.d.ts +4 -4
- package/symbols/support/cimSymbolUtils.d.ts +2 -0
- package/symbols/types.d.ts +140 -28
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
- package/views/2d/engine/rasterBrushes.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterProcessorTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SpectralConversionShader.js +5 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
- package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
- package/views/2d/types.d.ts +6 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementRawResult.js +5 -0
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +5 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/emissiveUtils.js +5 -0
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/support/layerUtils.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/mathUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/support/supportedSpatialReference.js +1 -1
- package/views/3d/terrain/BlendLayers.glsl.js +5 -0
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/RasterColorizer.glsl.js +5 -0
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/{Water.glsl.js → WaterColor.glsl.js} +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApply.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightBlur.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightDownsample.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightToSingle.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/Laserline.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/BlendWeights.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/smaa/Blur.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/smaa/EdgeDetect.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOBlur.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.glsl.js +5 -0
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +5 -0
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/{shaders → materials}/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/{shaders/WaterSurface.glsl.js → materials/Water.glsl.js} +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +31 -23
- package/views/3d/webgl.js +1 -1
- package/views/VideoView.d.ts +1 -0
- package/views/VideoView.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
- package/views/input/types.d.ts +94 -0
- package/views/interactive/snapping/FeatureSnappingLayerSource.d.ts +1 -0
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/layers/FeatureLayerViewMixin.d.ts +1 -0
- package/views/support/MeasurementWorker.js +1 -1
- package/views/support/MeasurementWorkerHandle.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/measurementUtils.js +1 -1
- package/views/support/screenUtils.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D.d.ts +1 -0
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/Attachments.d.ts +1 -0
- package/widgets/BasemapLayerList.d.ts +1 -0
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BuildingExplorer.d.ts +1 -1
- package/widgets/CatalogLayerList.d.ts +1 -0
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Directions.d.ts +1 -0
- package/widgets/Directions.js +1 -1
- package/widgets/DistanceMeasurement2D.d.ts +1 -0
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor.d.ts +1 -0
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.d.ts +1 -0
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable.d.ts +1 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FloorFilter.d.ts +1 -0
- package/widgets/FloorFilter.js +1 -1
- package/widgets/LayerList.d.ts +1 -0
- package/widgets/LayerList.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/TransformationService.js +5 -0
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +5 -0
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +5 -0
- package/widgets/OrientedImageryViewer/support/typeUtils.js +5 -0
- package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +43 -1
- package/widgets/ScaleRangeSlider.d.ts +1 -0
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Sketch.d.ts +1 -0
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Swipe.d.ts +1 -1
- package/widgets/TableList.d.ts +2 -0
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.d.ts +1 -0
- package/widgets/TimeSlider.js +1 -1
- package/widgets/UtilityNetworkAssociations.d.ts +2 -0
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/UtilityNetworkTrace.d.ts +2 -0
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.d.ts +2 -0
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.d.ts +1 -0
- package/widgets/ValuePicker.js +1 -1
- package/widgets/support/SnappingControls.d.ts +1 -0
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
- package/assets/esri/core/workers/chunks/00e135dc1b4cb024973d.js +0 -1
- package/assets/esri/core/workers/chunks/03d037f9f04f165aac63.js +0 -1
- package/assets/esri/core/workers/chunks/03da31c7635d077e8d99.js +0 -1
- package/assets/esri/core/workers/chunks/0dcf1f3b6aa84cbe03a9.js +0 -1
- package/assets/esri/core/workers/chunks/165cf8031af160c99d70.js +0 -1
- package/assets/esri/core/workers/chunks/185c97bc63ce546995ce.js +0 -1
- package/assets/esri/core/workers/chunks/1a62c456e791c82050fe.js +0 -1
- package/assets/esri/core/workers/chunks/21163137e345badb1aaf.js +0 -1
- package/assets/esri/core/workers/chunks/25dead73dfc5a4c19285.js +0 -1
- package/assets/esri/core/workers/chunks/2767b69085c9f7a1e1af.js +0 -1
- package/assets/esri/core/workers/chunks/43e9eaedf65921b58eb2.js +0 -1
- package/assets/esri/core/workers/chunks/4caec60ac0a5851730c6.js +0 -1
- package/assets/esri/core/workers/chunks/4f4bdf9f5323fa702e6c.js +0 -1
- package/assets/esri/core/workers/chunks/5119e3159617b8e1ea13.js +0 -1
- package/assets/esri/core/workers/chunks/59d3f3fbae775fd7686e.js +0 -1
- package/assets/esri/core/workers/chunks/5a706eecd8a988fae6b7.js +0 -1
- package/assets/esri/core/workers/chunks/5ba2bbbb42ef1920579d.js +0 -1
- package/assets/esri/core/workers/chunks/5cc731f161012b63c77a.js +0 -1
- package/assets/esri/core/workers/chunks/5fa8fe6353dbdda0b06a.js +0 -1
- package/assets/esri/core/workers/chunks/6107b58457a70c8de9da.js +0 -1
- package/assets/esri/core/workers/chunks/654eef3ad30f34c42e12.js +0 -1
- package/assets/esri/core/workers/chunks/6d9e92d9c2503d5dc8dd.js +0 -1
- package/assets/esri/core/workers/chunks/7130b09300032d3a5925.js +0 -1
- package/assets/esri/core/workers/chunks/7f7c4ffbdf7b20dc7a54.js +0 -1
- package/assets/esri/core/workers/chunks/804c9666d0dc548b9f79.js +0 -1
- package/assets/esri/core/workers/chunks/8258b1c8ba6d44ba19c3.js +0 -1
- package/assets/esri/core/workers/chunks/8f2fc50eb988c0228b05.js +0 -1
- package/assets/esri/core/workers/chunks/8f3abaabc61858e929a5.js +0 -1
- package/assets/esri/core/workers/chunks/97ad3eb25ad003c16148.js +0 -1
- package/assets/esri/core/workers/chunks/a270e34bb248114ec280.js +0 -1
- package/assets/esri/core/workers/chunks/a56a5e00964d4cd59a66.js +0 -1
- package/assets/esri/core/workers/chunks/a774b4fc7df801503bea.js +0 -1
- package/assets/esri/core/workers/chunks/b1015e1f25b60c08d2cf.js +0 -1
- package/assets/esri/core/workers/chunks/c18a2948ae3cb527d8bb.js +0 -1
- package/assets/esri/core/workers/chunks/cb66a74448a6c0c20d5d.js +0 -1
- package/assets/esri/core/workers/chunks/d4f4c0201d8b641709c0.js +0 -1
- package/assets/esri/core/workers/chunks/d6d9d56b3733622deab6.js +0 -1
- package/assets/esri/core/workers/chunks/dedd9d47ccc019ffc484.js +0 -1
- package/assets/esri/core/workers/chunks/e271065410ba5c872f53.js +0 -1
- package/assets/esri/core/workers/chunks/e8a0654cebafa22b5b56.js +0 -1
- package/assets/esri/core/workers/chunks/ecf7d34b37ce6f0877af.js +0 -1
- package/assets/esri/core/workers/chunks/f25eb512592a84a508c1.js +0 -1
- package/assets/esri/core/workers/chunks/f64ec13167eb51da2f9b.js +0 -1
- package/layers/graphics/sources/ParquetSource.d.ts +0 -45
- package/views/2d/engine/imagery/BrushVectorField.js +0 -5
- package/views/3d/analysis/AreaMeasurement/support/utils.js +0 -5
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementUtils.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/TextureOnly.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/BlendWeights.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/Blur.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/EdgeDetect.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/Laserlines.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/SSAO.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +0 -5
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +0 -5
- /package/chunks/{Laserlines.glsl.js → Laserline.glsl.js} +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as s,multiply as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{sub as m,add as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import g from"../../../geometry/Point.js";import{projectAsync as v}from"../../../geometry/projectionUtils.js";import{earth as M}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as z}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,m,h]=a;P(e,o,r,c);const p=P(s,l,m,h),g=R(e,o,r,c),v=R(s,l,m,h),M=f(i(),g),d=u(i(),M,v),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=S(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function R(t,n,a,e){const c=N(r([...e,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],m=i();return m[0]=s*t[0],m[1]=l*n[0],m[2]=u*a[0],m[3]=0,m[4]=s*t[1],m[5]=l*n[1],m[6]=u*a[1],m[7]=0,m[8]=s*t[2],m[9]=l*n[2],m[10]=u*a[2],m[11]=0,m[12]=s,m[13]=l,m[14]=u,m[15]=1,m}function D(t,n,a,e,i=c()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function H(t,n,a){const e=c();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function L(t,n){const[a,e,i]=t,o=c();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function N(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function A(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const I={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function k(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=A(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return k(t,I.OPK,n)}function U(t,n=!0){return k(t,I.HPR,n)}function C(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),m=a(s),h=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/h,g=o/h,v=r/h,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*h*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(h*x))},b=y(u),j=Math.atan(i/(h*M))+m,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-m))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function T(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function W(t,n,a,e=F/2){const{heading:i,pitch:o}=Y(t,e);return X(i,o,n,a)}function X(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e),heading:t,pitch:n}}function Y(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function Z(t,n,e=F/2){return[e*(Math.sin(a(t))*Math.sin(a(n))),e*(Math.cos(a(t))*Math.sin(a(n))),e*Math.cos(a(180-n))]}function G(t,n,a,e=F/2){const{heading:i,pitch:o}=T(t,n,a);return Z(i,o,e)}async function J(t,a,e){const i=await v(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function $(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const B=t=>t.toArray(),Q=(...t)=>t.some(t=>t);function _(t,n){if(Q(0===t.length,t.some(({x:t,y:n})=>Q(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function tt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function nt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function at(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/M.radius))):1}const et=t=>n=>new g(n,t),it=t=>null!=t&&"queryExtent"in t;function ot(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(x(c(),a,[n,i,0]),e,t))}function rt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ct);return null!=s&&st(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ct(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function st(t){return null!=t[1]&&null!=t[5]}function lt(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=jt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...mt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ft(t,n,a,e){return wt(e)?q([e.omega,e.phi,e.kappa]):yt(e)?U([e.heading,e.pitch,e.roll]):U([t,n,a??0])}function ut(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=jt(t,t.location.spatialReference);return{averageElevation:(c.z??0)-i,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s}}function mt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:m,focalLength:h,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=rt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,h),O=v??ft(l,u,m,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const ht=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,pt=t=>b(t?.elevationSource)&&null!=t?.extent,gt=t=>w(t?.elevationSource),vt=async(t,n,a,e,i)=>{const o=j(t),r=n-a/o;return gt(e)?(e.elevationSource=new y({constantElevation:e.elevationSource.constantElevation/o}),e):ht(e)?e:pt(e)?{elevationSample:await O({...p(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},Mt=t=>z(t?.heading)&&z(t?.pitch),dt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function xt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:l,verticalFieldOfView:f}=t,u=e();s(u,r);const p=2*Math.tan(a(f)/2)*i*l,g=2*Math.tan(a(o)/2)*i*l,v=L([0,0,-1],u),M=D([n.x,n.y,n.z],v,t.farDistance*l,l),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,l),y=H(x,g/2,l),b=m(c(),w,y),j=h(c(),w,y);return[h(c(),M,b),h(c(),M,j),m(c(),M,b),m(c(),M,j)]}const wt=t=>2===t?.type,yt=t=>1===t?.type;function bt(t,n,a){if("panoramic"===t){const[t,e]=a;return W({x:n.x,y:n.y,z:n.z},t,e)}return{x:n.x+.5,y:.5-n.y}}function jt(t,n,a=!0){const e=j(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,w(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}export{xt as computeFarplaneVertices,C as computeHFOVAndVFOV,ot as computeNewReferenceCoordinates,Z as convertHeadingPitchToSphereVertex,X as convertOrientationToPixelLocation,G as convertPixelLocationToSphereVertex,T as convertPixelToHeadingPitch,Y as convertSphereVertexToOrientation,W as convertSphereVertexToPixelLocation,jt as convertToSRUnits,k as createRotationMatrix,U as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,rt as getAffinesAndFocalLength,ut as getImageToWorldPanoramicProperties,lt as getImageToWorldProperties,J as getInitialAngle,vt as getUpdateElevationProps,at as getWebMercatorScalingFactor,mt as getWorldToImageProperties,Mt as hasAngles,yt as hasHeadingPitchRoll,wt as hasOmegaPhiKappa,it as isElevationSampler,ht as isUpdateElevationWithElevationSampler,pt as isUpdateElevationWithElevationSource,gt as isUpdateUsingConstantElevation,st as isValidAffines,R as linearEquationSolve,K as ltpToGeographic,Q as or,B as pointToArray,E as projectiveTransform,dt as reducerFn,$ as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,bt as transformGraphicCoordinatesToPixel,L as transformMat3,N as transformMat4,_ as validatePixelsToTransform,tt as validatePointsToTransform,nt as validateRotationMatrix,et as vecToPoint};
|
|
5
|
+
import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as s,multiply as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{sub as m,add as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import g from"../../../geometry/Point.js";import{projectAsync as v}from"../../../geometry/projectionUtils.js";import{earth as M}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as F}from"../../../support/guards.js";import{defaultImageSphereSize as E}from"../../../widgets/PanoramicViewer/constants.js";function z(t,n,a){const[e,o,r,c]=n,[s,l,m,h]=a;P(e,o,r,c);const p=P(s,l,m,h),g=R(e,o,r,c),v=R(s,l,m,h),M=f(i(),g),d=u(i(),M,v),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=S(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function R(t,n,a,e){const c=N(r([...e,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],m=i();return m[0]=s*t[0],m[1]=l*n[0],m[2]=u*a[0],m[3]=0,m[4]=s*t[1],m[5]=l*n[1],m[6]=u*a[1],m[7]=0,m[8]=s*t[2],m[9]=l*n[2],m[10]=u*a[2],m[11]=0,m[12]=s,m[13]=l,m[14]=u,m[15]=1,m}function D(t,n,a,e,i=c()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function H(t,n,a){const e=c();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function L(t,n){const[a,e,i]=t,o=c();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function N(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function A(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const I={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function k(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=A(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return k(t,I.OPK,n)}function U(t,n=!0){return k(t,I.HPR,n)}function C(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),m=a(s),h=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/h,g=o/h,v=r/h,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*h*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(h*x))},b=y(u),j=Math.atan(i/(h*M))+m,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-m))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function T(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function W(t,n,a,e=E/2){const{heading:i,pitch:o}=Y(t,e);return X(i,o,n,a)}function X(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e),heading:t,pitch:n}}function Y(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function Z(t,n,e=E/2){return[e*(Math.sin(a(t))*Math.sin(a(n))),e*(Math.cos(a(t))*Math.sin(a(n))),e*Math.cos(a(180-n))]}function G(t,n,a,e=E/2){const{heading:i,pitch:o}=T(t,n,a);return Z(i,o,e)}async function J(t,a,e){const i=await v(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function $(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const B=t=>t.toArray(),Q=(...t)=>t.some(t=>t);function _(t,n){if(Q(0===t.length,t.some(({x:t,y:n})=>Q(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function tt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function nt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function at(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/M.radius))):1}const et=t=>n=>new g(n,t),it=t=>null!=t&&"queryExtent"in t;function ot(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>z(x(c(),a,[n,i,0]),e,t))}function rt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ct);return null!=s&&st(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ct(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function st(t){return null!=t[1]&&null!=t[5]}function lt(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=bt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...mt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ft(t,n,a,e){return wt(e)?q([e.omega,e.phi,e.kappa]):yt(e)?U([e.heading,e.pitch,e.roll]):U([t,n,a??0])}function ut(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=bt(t,t.location.spatialReference);return{averageElevation:(c.z??0)-i,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s}}function mt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:m,focalLength:h,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=rt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,h),O=v??ft(l,u,m,f),F=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??F,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const ht=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,pt=t=>b(t?.elevationSource)&&null!=t?.extent,gt=t=>w(t?.elevationSource),vt=async(t,n,a,e,i)=>{const o=j(t),r=n-a/o;return gt(e)?(e.elevationSource=new y({constantElevation:e.elevationSource.constantElevation/o}),e):ht(e)?e:pt(e)?{elevationSample:await O({...p(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},Mt=t=>F(t?.heading)&&F(t?.pitch),dt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function xt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:l,verticalFieldOfView:f}=t,u=e();s(u,r);const p=2*Math.tan(a(f)/2)*i*l,g=2*Math.tan(a(o)/2)*i*l,v=L([0,0,-1],u),M=D([n.x,n.y,n.z],v,t.farDistance*l,l),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,l),y=H(x,g/2,l),b=m(c(),w,y),j=h(c(),w,y);return[h(c(),M,b),h(c(),M,j),m(c(),M,b),m(c(),M,j)]}const wt=t=>2===t?.type,yt=t=>1===t?.type;function bt(t,n,a=!0){const e=j(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,w(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}export{xt as computeFarplaneVertices,C as computeHFOVAndVFOV,ot as computeNewReferenceCoordinates,Z as convertHeadingPitchToSphereVertex,X as convertOrientationToPixelLocation,G as convertPixelLocationToSphereVertex,T as convertPixelToHeadingPitch,Y as convertSphereVertexToOrientation,W as convertSphereVertexToPixelLocation,bt as convertToSRUnits,k as createRotationMatrix,U as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,rt as getAffinesAndFocalLength,ut as getImageToWorldPanoramicProperties,lt as getImageToWorldProperties,J as getInitialAngle,vt as getUpdateElevationProps,at as getWebMercatorScalingFactor,mt as getWorldToImageProperties,Mt as hasAngles,yt as hasHeadingPitchRoll,wt as hasOmegaPhiKappa,it as isElevationSampler,ht as isUpdateElevationWithElevationSampler,pt as isUpdateElevationWithElevationSource,gt as isUpdateUsingConstantElevation,st as isValidAffines,R as linearEquationSolve,K as ltpToGeographic,Q as or,B as pointToArray,z as projectiveTransform,dt as reducerFn,$ as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,L as transformMat3,N as transformMat4,_ as validatePixelsToTransform,tt as validatePointsToTransform,nt as validateRotationMatrix,et as vecToPoint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../geometry/Point.js";import n from"./EphemeralBlockCache.js";import{projectExtent as t,projectResolution as o,snapPyramid as l}from"../functions/rasterProjectionHelper.js";const r=new Map,c=new n;function i(e,n,t){const o=[];return null!=n&&o.push(`sliceId=${n}`),null!=t&&o.push(`bandIds=${t.join(",")}`),o.length?`${e}?${o.join("&")}`:e}function u(e,n){const t={extent:null,rasterInfo:n,cache:new Map},o=r.get(e);return o?(o.push(t),o.length-1):(r.set(e,[t]),0)}function a(e,n){const t=r.get(e);t&&(t[n]=null,t.some(e=>null!=e)||r.delete(e))}function f(e){r.delete(e)}function s(e,n,t){const o=r.get(e);if(!o)return null==n?c.decreaseRefCount(e,t):0;if(null==n||null==o[n])return c.decreaseRefCount(e,t);const l=o[n]?.cache,i=l?.get(t);if(l&&i){if(i.refCount--,0===i.refCount){l.delete(t);for(let e=0;e<o.length;e++)o[e]?.cache.delete(t);i.controller&&i.controller.abort()}return i.refCount}return 0}function m(e,n,t){const o=r.get(e);if(!o)return null==n?c.getBlock(e,t):null;if(null==n||null==o[n]){for(let e=0;e<o.length;e++){const n=o[e]?.cache.get(t);if(n)return n.refCount++,n.block}return c.getBlock(e,t)}const l=o[n]?.cache.get(t);if(l)return l.refCount++,l.block;for(let r=0;r<o.length;r++){if(r===n||!o[r])continue;const e=o[r]?.cache,l=e?.get(t);if(e&&l)return l.refCount++,e.set(t,l),l.block}return null}function h(e,n,t,o,l=null){const i=r.get(e);if(!i)return void(null==n&&c.putBlock(e,t,o,l));if(null==n||null==i[n])return void c.putBlock(e,t,o,l);const u={refCount:1,block:o,isResolved:!1,isRejected:!1,controller:l};o.then(()=>u.isResolved=!0).catch(()=>u.isRejected=!0),i[n]?.cache.set(t,u)}function x(e,n,t){const o=r.get(e);o?null!=n&&null!=o[n]?o[n]?.cache.delete(t):c.deleteBlock(e,t):null==n&&c.deleteBlock(e,t)}function d(e,n){const t=r.get(e);return t?t[n]??null:null}function g(n,r,c,i,u,a,f=null){const s=d(n,r);if(!s)return;const m=s.extent,{cache:h,rasterInfo:x}=s;if(m
|
|
5
|
+
import e from"../../../geometry/Point.js";import n from"./EphemeralBlockCache.js";import{projectExtent as t,projectResolution as o,snapPyramid as l}from"../functions/rasterProjectionHelper.js";const r=new Map,c=new n;function i(e,n,t){const o=[];return null!=n&&o.push(`sliceId=${n}`),null!=t&&o.push(`bandIds=${t.join(",")}`),o.length?`${e}?${o.join("&")}`:e}function u(e,n){const t={extent:null,rasterInfo:n,cache:new Map},o=r.get(e);return o?(o.push(t),o.length-1):(r.set(e,[t]),0)}function a(e,n){const t=r.get(e);t&&(t[n]=null,t.some(e=>null!=e)||r.delete(e))}function f(e){r.delete(e)}function s(e,n,t){const o=r.get(e);if(!o)return null==n?c.decreaseRefCount(e,t):0;if(null==n||null==o[n])return c.decreaseRefCount(e,t);const l=o[n]?.cache,i=l?.get(t);if(l&&i){if(i.refCount--,0===i.refCount){l.delete(t);for(let e=0;e<o.length;e++)o[e]?.cache.delete(t);i.controller&&i.controller.abort()}return i.refCount}return 0}function m(e,n,t){const o=r.get(e);if(!o)return null==n?c.getBlock(e,t):null;if(null==n||null==o[n]){for(let e=0;e<o.length;e++){const n=o[e]?.cache.get(t);if(n)return n.refCount++,n.block}return c.getBlock(e,t)}const l=o[n]?.cache.get(t);if(l)return l.refCount++,l.block;for(let r=0;r<o.length;r++){if(r===n||!o[r])continue;const e=o[r]?.cache,l=e?.get(t);if(e&&l)return l.refCount++,e.set(t,l),l.block}return null}function h(e,n,t,o,l=null){const i=r.get(e);if(!i)return void(null==n&&c.putBlock(e,t,o,l));if(null==n||null==i[n])return void c.putBlock(e,t,o,l);const u={refCount:1,block:o,isResolved:!1,isRejected:!1,controller:l};o.then(()=>u.isResolved=!0).catch(()=>u.isRejected=!0),i[n]?.cache.set(t,u)}function x(e,n,t){const o=r.get(e);o?null!=n&&null!=o[n]?o[n]?.cache.delete(t):c.deleteBlock(e,t):null==n&&c.deleteBlock(e,t)}function d(e,n){const t=r.get(e);return t?t[n]??null:null}function g(n,r,c,i,u,a,f=null){const s=d(n,r);if(!s)return;const m=s.extent,{cache:h,rasterInfo:x}=s;if(m?.xmin===c.xmin&&m.xmax===c.xmax&&m.ymin===c.ymin&&m.ymax===c.ymax)return;i=i??0;const g=c.clone().normalize(),{spatialReference:p,transform:y}=x,k=new Set;for(let d=0;d<g.length;d++){const n=g[d];if(n.xmax-n.xmin<=i||n.ymax-n.ymin<=i)continue;let r=t(n,p,f);if(null==r)continue;if(null!=y&&(r=y.inverseTransform(r),null==r))continue;const c=new e({x:i,y:i,spatialReference:n.spatialReference});if(null==u&&!(u=o(c,p,n,f)))return;const{pyramidLevel:s,pyramidResolution:m,excessiveReading:h}=l(u,x,a||"closest");if(h)return;const{storageInfo:M}=x,{origin:R}=M,{x:C,y:B}=m,b=Math.max(0,Math.floor((r.xmin-R.x)/C)),j=Math.max(0,Math.floor((R.y-r.ymax)/B)),v=Math.ceil(r.width/C-.1),w=Math.ceil(r.height/B-.1),$=s>0?M.pyramidBlockWidth:M.blockWidth,I=s>0?M.pyramidBlockHeight:M.blockHeight,H=M.blockBoundary[s];if(!H)continue;const E=1,P=Math.max(H.minCol,Math.floor(b/$)-E),W=Math.max(H.minRow,Math.floor(j/I)-E),z=Math.min(H.maxCol,Math.floor((b+v-1)/$)+E),L=Math.min(H.maxRow,Math.floor((j+w-1)/I)+E);for(let e=W;e<=L;e++)for(let n=P;n<=z;n++)k.add(`${s}/${e}/${n}`)}h.forEach((e,n)=>{if(!k.has(n)){const e=h.get(n);(null==e||e.isResolved||e.isRejected)&&h.delete(n)}}),s.extent={xmin:c.xmin,ymin:c.ymin,xmax:c.xmax,ymax:c.ymax}}export{s as decreaseRefCount,x as deleteBlock,f as deleteRaster,m as getBlock,i as getRasterId,h as putBlock,u as register,a as unregister,g as update};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as r}from"../formats/pixelRangeUtils.js";import o from"./BaseRasterFunction.js";import{spectralConversion as n}from"./conversionUtils.js";import i from"./SpectralConversionFunctionArguments.js";let u=class extends o{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t;return{success:!0,supportsGPU:3===t.bandCount&&9===this.functionArguments.conversionMatrix.length}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:n(e,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){const t=r(this.outputPixelType),[e,s,o,n,i,u,p,c,a]=this.functionArguments.conversionMatrix;return{weights:[e,n,p,s,i,c,o,u,a],clampRange:t}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),u=t([s("esri.layers.raster.functions.SpectralConversionFunction")],u);const p=u;export{p as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as r}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";var s;let n=s=class extends e{clone(){return new s({conversionMatrix:[...this.conversionMatrix],raster:this.raster})}};r([t({type:[Number],json:{write:!0}})],n.prototype,"conversionMatrix",void 0),n=s=r([o("esri.layers.raster.functions.SpectralConversionFunctionArguments")],n);const i=n;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";function
|
|
5
|
+
import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";function s(s,i,n,h){const{pixels:o,width:a,height:l}=s,r=o.length,p=n.startsWith("f"),c=!p,[d,f]=t(n),m=a*l,g=e.createEmptyBand(n,m);for(let t=0;t<l;t++){let e=t*a;for(let t=0;t<a;t++,e++)if(!h||h[e]){let t=0;for(let s=0;s<r;s++)t+=i[s]*o[s][e];p||(t=Math.round(t),c&&(t=t>f?f:t<d?d:t)),g[e]=t}}return g}function i(t,i,n){const{width:h,height:o,mask:a,bandMasks:l}=t,r=l?.length?e.combineBandMasks(l):a,p=s(t,i,n,r),c=new e({width:h,height:o,pixels:[p],pixelType:n,mask:r});return c.updateStatistics(),c}function n(t,i,n){const{width:h,height:o,mask:a,bandMasks:l}=t,r=l?.length?e.combineBandMasks(l):a,p=[],c=t.pixels.length;for(let e=0;e<i.length/c;e++){const h=s(t,i.slice(e*c,(e+1)*c),n,r);p.push(h)}const d=new e({width:h,height:o,pixels:p,pixelType:n,mask:r});return d.updateStatistics(),d}export{i as grayscale,n as spectralConversion};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import
|
|
5
|
+
import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import j from"./NDVIFunction.js";import y from"./RemapFunction.js";import b from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./SpectralConversionFunction.js";import R from"./StatisticsFunction.js";import N from"./StatisticsHistogramFunction.js";import S from"./StretchFunction.js";import v from"./TableFunction.js";const w=new Map;function T(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach(t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&T(t,e))})}function D(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=H(t,new Map,n);if(O(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t){const e=x(t=k(t),n);return e.isRoot=!0,e}}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function V(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map(e=>t[e])}function B(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function k(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map(t=>B(t)?k(t):t);else switch(B(t)&&(t=k(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function x(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!w.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=w.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=V(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=x(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach((t,e)=>{i.functionArguments[t]=p[e]})),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function E(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?E(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function M(t,r){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map(t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?M(t,r):t);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=$(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map($)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=H(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=M(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function $(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function H(t,e,r){r&&E(t,r);const n={renderingRule:{},templates:e};return L(t,n),n}function L(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=M(t,n):(r.rasterFunctionArguments[c]={},L(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":G(i);break;case"Colormap":P(i);break;case"Convolution":I(i);break;case"Mask":z(i)}}function O(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null!=r){if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t);continue}t&&"object"==typeof t&&(t.rasterFunctionArguments&&O({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else O({renderingRule:o,templates:n})}))}}function G(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map(t=>[t.min,t.max,t.mean,t.standardDeviation])),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function P(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function I(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function z(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter(t=>""!==t).map(t=>Number(t)))}w.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),w.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),w.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),w.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),w.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),w.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),w.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),w.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),w.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),w.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),w.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),w.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),w.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:b,rasterArgumentNames:["raster"]}),w.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),w.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),w.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),w.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),w.set("NDVI",{desc:"NDVI Function",ctor:j,rasterArgumentNames:["raster"]}),w.set("Remap",{desc:"Remap Function",ctor:y,rasterArgumentNames:["raster"]}),w.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),w.set("SpectralConversion",{desc:"Spectral Conversion",ctor:_,rasterArgumentNames:["raster"]}),w.set("Statistics",{desc:"Focal Statistics Function",ctor:R,rasterArgumentNames:["raster"]}),w.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:N,rasterArgumentNames:["raster"]}),w.set("Stretch",{desc:"Stretch Function",ctor:S,rasterArgumentNames:["raster"]}),w.set("Table",{desc:"Attribute Table Function",ctor:v,rasterArgumentNames:["raster"]});export{D as create,T as getPrimaryRasterUrls,V as getRasterValues};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{JSONMap as t}from"../../../core/jsonMap.js";import{isValidPixelBlock as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";const r=new Map;r.set("meter-per-second",1),r.set("kilometer-per-hour",.277778),r.set("knots",.514444),r.set("feet-per-second",.3048),r.set("mile-per-hour",.44704);const o=180/Math.PI,i=5,s=new t({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function a(t,e){return r.get(t)/r.get(e)||1}function h(t){return(450-t)%360}function l(t,e="geographic"){const[n,r]=t,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n)*o;return s=(360+s)%360,"geographic"===e&&(s=h(s)),[i,s]}function c(t,e="geographic"){let n=t[1];"geographic"===e&&(n=h(n)),n%=360;const r=t[0];return[r*Math.cos(n/o),r*Math.sin(n/o)]}function u(t,n,r,o="geographic"){if(!e(t)||null==r)return t;const i="vector-magdir"===n?t.clone():f(t,n),s=i.pixels[1];for(let e=0;e<s.length;e++)s[e]="geographic"===o?(s[e]+r[e]+270)%360:(s[e]+360-r[e])%360;return"vector-magdir"===n?i:f(i,"vector-magdir")}function f(t,r,o="geographic",i=1){if(!e(t))return t;const{pixels:s,width:a,height:h}=t,u=a*h,f=s[0],p=s[1],m=t.pixelType.startsWith("f")?t.pixelType:"f32",d=n.createEmptyBand(m,u),g=n.createEmptyBand(m,u);let x=0;for(let e=0;e<h;e++)for(let t=0;t<a;t++)"vector-uv"===r?([d[x],g[x]]=l([f[x],p[x]],o),d[x]*=i):([d[x],g[x]]=c([f[x],p[x]],o),d[x]*=i,g[x]*=i),x++;const M=new n({pixelType:m,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[d,g]});return M.updateStatistics(),M}function p(t,n,r=1){if(1===r||!e(t))return t;const o=t.clone(),{pixels:i,width:s,height:a}=o,h=i[0],l=i[1];let c=0;for(let e=0;e<a;e++)for(let t=0;t<s;t++)"vector-uv"===n?(h[c]*=r,l[c]*=r):h[c]*=r,c++;return o.updateStatistics(),o}function m(t,e,n,r,o){if(null==o||!o.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(e/r),height:Math.round(n/r),resolution:t.width/e};const i=o.xmin,s=o.ymax,a=(t.xmax-t.xmin)/e*r,h=(t.ymax-t.ymin)/n*r,l=(a+h)/2;return t.xmin=i+Math.floor((t.xmin-i)/a)*a,t.xmax=i+Math.ceil((t.xmax-i)/a)*a,t.ymin=s+Math.floor((t.ymin-s)/h)*h,t.ymax=s+Math.ceil((t.ymax-s)/h)*h,{extent:t,width:Math.round(t.width/a),height:Math.round(t.height/h),resolution:l}}const d=g(0,0,0);function g(t=0,e=0,n=Math.PI,r=!0){r&&(n=(2*Math.PI-n)%(2*Math.PI));const o=r?-1:1,i=13*o,s=-7*o,a=-2*o,h=-16*o,l=21.75,[c,u]=M(0,e+i,n,l),[f,p]=M(t-5.5,e+s,n,l),[m,d]=M(t+5.5,e+s,n,l),[g,x]=M(t-1.5,e+a,n,l),[k,w]=M(t+1.5,e+a,n,l),[y,P]=M(t-1.5,e+h,n,l),[b,v]=M(t+1.5,e+h,n,l);return[c,u,f,p,g,x,k,w,m,d,y,P,b,v]}function x(t=0,e=Math.PI,n=!0){n&&(e=(2*Math.PI-e)%(2*Math.PI));const r=10,o=n?-1:1,s=5*o,a=20*o,h=25*o,l=45,c=0,u=0,f=2,p=0,m=f*o,d=n?1:-1,g=r/2*d;let[x,k]=[c+g,u-a],[w,y]=[x+f*d,k],[P,b]=[w-p*d,y+m],[v,I]=[c-g,u-h],[A,_]=[v+p*d,I-m],U=Math.ceil(t/i),S=Math.floor(U/10);U-=8*S;const D=[],F=[];for(let i=0;i<U/2;i++,S--){S<=0&&U%2==1&&i===(U-1)/2&&(v=c,A=v+p*d,I=(I+k)/2,_=I-m);const[t,n]=M(v,I,e,l);if(S>0){const[r,o]=M(w,I,e,l),[i,s]=M(x,k,e,l);D.push(r),D.push(o),D.push(t),D.push(n),D.push(i),D.push(s)}else{const[r,o]=M(w,y,e,l),[i,s]=M(P,b,e,l),[a,h]=M(A,_,e,l);F.push(t),F.push(n),F.push(a),F.push(h),F.push(i),F.push(s),F.push(r),F.push(o)}I+=s,k+=s,y+=s,b+=s,_+=s}const[N,j]=M(c+g,u+a,e,l),J=(r/2+f)*d,[O,q]=M(c+J,u+a,e,l),[B,E]=M(c+g,u-h,e,l),[T,C]=M(c+J,u-h,e,l);return{pennants:D,barbs:F,shaft:[N,j,O,q,B,E,T,C]}}function M(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-n)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],w=[0,.5,1,1.5,2],y=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function P(t,e,n,r){const o=a(r||"knots",n);let i;for(i=1;i<e.length;i++)if(i===e.length-1){if(t<e[i]*o)break}else if(t<=e[i]*o)break;return Math.min(i-1,e.length-2)}function b(t,e,n,r,o){let i=0;switch(e){case"beaufort_kn":i=P(t,k,"knots",n);break;case"beaufort_km":i=P(t,k,"kilometer-per-hour",n);break;case"beaufort_ft":i=P(t,k,"feet-per-second",n);break;case"beaufort_m":i=P(t,k,"meter-per-second",n);break;case"classified_arrow":i=P(t,o??[],r,n);break;case"ocean_current_m":i=P(t,w,"meter-per-second",n);break;case"ocean_current_kn":i=P(t,y,"knots",n)}return i}function v(t,e){const{style:n,inputUnit:r,outputUnit:o,breakValues:i}=e,a=s.fromJSON(r),h=s.fromJSON(o),l=7*6,c=15;let u=0,f=0;const{width:p,height:m,mask:x}=t,M=t.pixels[0],k=t.pixels[1],w=null!=x?x.filter(t=>t>0).length:p*m,y=new Float32Array(w*l),P=new Uint32Array(c*w),v=e.invertDirection?g(0,0,0,!1):d;for(let s=0;s<m;s++)for(let t=0;t<p;t++){const e=s*p+t;if(!x||x[s*p+t]){const r=(k[e]+360)%360/180*Math.PI,o=b(M[e],n,a,h,i);for(let n=0;n<v.length;n+=2)y[u++]=(t+.5)/p,y[u++]=(s+.5)/m,y[u++]=v[n],y[u++]=v[n+1]+r,y[u++]=o,y[u++]=M[e];const c=7*(u/l-1);P[f++]=c,P[f++]=c+1,P[f++]=c+2,P[f++]=c+0,P[f++]=c+4,P[f++]=c+3,P[f++]=c+0,P[f++]=c+2,P[f++]=c+3,P[f++]=c+2,P[f++]=c+5,P[f++]=c+3,P[f++]=c+5,P[f++]=c+6,P[f++]=c+3}}return{vertexData:y,indexData:P}}const I=[];function A(t,e){if(0===I.length)for(let i=0;i<30;i++)I.push(x(5*i,0,!e.invertDirection));const n=a(s.fromJSON(e.inputUnit),"knots"),{width:r,height:o,mask:h}=t,l=t.pixels[0],c=t.pixels[1],u=6,f=[],p=[];let m=0,d=0;for(let s=0;s<o;s++)for(let t=0;t<r;t++){const e=s*r+t,a=l[e]*n;if((!h||h[s*r+t])&&a>=i){const n=(c[e]+360)%360/180*Math.PI,{pennants:i,barbs:h,shaft:l}=I[Math.min(Math.floor(a/5),29)];if(i.length+h.length===0)continue;let g=f.length/u;const x=(t+.5)/r,M=(s+.5)/o;for(let t=0;t<i.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=i[t],f[m++]=i[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<h.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=h[t],f[m++]=h[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<l.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=l[t],f[m++]=l[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<i.length/6;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,g+=3;for(let t=0;t<h.length/8;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+2,p[d++]=g+3,g+=4;p[d++]=g+0,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+3,p[d++]=g+2,g+=4}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function _(t,e){const n=4*6;let r=0,o=0;const{width:h,height:l,mask:c}=t,u=t.pixels[0],f=[],p=[],m=a(s.fromJSON(e.inputUnit),"knots"),d="wind_speed"===e.style?i:Number.MAX_VALUE;for(let i=0;i<l;i++)for(let t=0;t<h;t++){const e=u[i*h+t]*m;if((!c||c[i*h+t])&&e<d){for(let n=0;n<4;n++)f[r++]=(t+.5)/h,f[r++]=(i+.5)/l,f[r++]=n<2?-.5:.5,f[r++]=n%2==0?-.5:.5,f[r++]=0,f[r++]=e;const s=4*(r/n-1);p[o++]=s,p[o++]=s+1,p[o++]=s+2,p[o++]=s+1,p[o++]=s+2,p[o++]=s+3}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function U(t,e){return"simple_scalar"===e.style?_(t,e):"wind_speed"===e.style?A(t,e):v(t,e)}function S(t,e,r,o=[0,0],i=.5){const{width:s,height:a,mask:h}=t,[u,f]=t.pixels,[p,m]=o,d=Math.round((s-p)/r),g=Math.round((a-m)/r),x=d*g,M=new Float32Array(x),k=new Float32Array(x),w=new Uint8Array(x),y="vector-uv"===e;for(let n=0;n<g;n++)for(let t=0;t<d;t++){let e=0;const o=n*d+t,g=Math.max(0,n*r+m),x=Math.max(0,t*r+p),P=Math.min(a,g+r),b=Math.min(s,x+r);for(let t=g;t<P;t++)for(let n=x;n<b;n++){const r=t*s+n;if(!h||h[r]){e++;const t=y?[u[r],f[r]]:[u[r],(360+f[r])%360],[n,i]=y?t:c(t);M[o]+=n,k[o]+=i}}if(e>=(P-g)*(b-x)*(1-i)){w[o]=1;const[t,n]=l([M[o]/e,k[o]/e]);M[o]=t,k[o]=n}else w[o]=0,M[o]=0,k[o]=0}const P=new n({width:d,height:g,pixels:[M,k],mask:w});return P.updateStatistics(),P}export{u as convertToLocalDirections,f as convertVectorFieldData,p as convertVectorFieldUnit,U as
|
|
5
|
+
import{JSONMap as t}from"../../../core/jsonMap.js";import{isValidPixelBlock as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";const r=new Map;r.set("meter-per-second",1),r.set("kilometer-per-hour",.277778),r.set("knots",.514444),r.set("feet-per-second",.3048),r.set("mile-per-hour",.44704);const o=180/Math.PI,i=5,s=new t({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function a(t,e){return r.get(t)/r.get(e)||1}function h(t){return(450-t)%360}function l(t,e="geographic"){const[n,r]=t,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n)*o;return s=(360+s)%360,"geographic"===e&&(s=h(s)),[i,s]}function c(t,e="geographic"){let n=t[1];"geographic"===e&&(n=h(n)),n%=360;const r=t[0];return[r*Math.cos(n/o),r*Math.sin(n/o)]}function u(t,n,r,o="geographic"){if(!e(t)||null==r)return t;const i="vector-magdir"===n?t.clone():f(t,n),s=i.pixels[1];for(let e=0;e<s.length;e++)s[e]="geographic"===o?(s[e]+r[e]+270)%360:(s[e]+360-r[e])%360;return"vector-magdir"===n?i:f(i,"vector-magdir")}function f(t,r,o="geographic",i=1){if(!e(t))return t;const{pixels:s,width:a,height:h}=t,u=a*h,f=s[0],p=s[1],m=t.pixelType.startsWith("f")?t.pixelType:"f32",d=n.createEmptyBand(m,u),g=n.createEmptyBand(m,u);let x=0;for(let e=0;e<h;e++)for(let t=0;t<a;t++)"vector-uv"===r?([d[x],g[x]]=l([f[x],p[x]],o),d[x]*=i):([d[x],g[x]]=c([f[x],p[x]],o),d[x]*=i,g[x]*=i),x++;const M=new n({pixelType:m,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[d,g]});return M.updateStatistics(),M}function p(t,n,r=1){if(1===r||!e(t))return t;const o=t.clone(),{pixels:i,width:s,height:a}=o,h=i[0],l=i[1];let c=0;for(let e=0;e<a;e++)for(let t=0;t<s;t++)"vector-uv"===n?(h[c]*=r,l[c]*=r):h[c]*=r,c++;return o.updateStatistics(),o}function m(t,e,n,r,o){if(null==o||!o.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(e/r),height:Math.round(n/r),resolution:t.width/e};const i=o.xmin,s=o.ymax,a=(t.xmax-t.xmin)/e*r,h=(t.ymax-t.ymin)/n*r,l=(a+h)/2;return t.xmin=i+Math.floor((t.xmin-i)/a)*a,t.xmax=i+Math.ceil((t.xmax-i)/a)*a,t.ymin=s+Math.floor((t.ymin-s)/h)*h,t.ymax=s+Math.ceil((t.ymax-s)/h)*h,{extent:t,width:Math.round(t.width/a),height:Math.round(t.height/h),resolution:l}}const d=g(0,0,0);function g(t=0,e=0,n=Math.PI,r=!0){r&&(n=(2*Math.PI-n)%(2*Math.PI));const o=r?-1:1,i=13*o,s=-7*o,a=-2*o,h=-16*o,l=21.75,[c,u]=M(0,e+i,n,l),[f,p]=M(t-5.5,e+s,n,l),[m,d]=M(t+5.5,e+s,n,l),[g,x]=M(t-1.5,e+a,n,l),[k,w]=M(t+1.5,e+a,n,l),[y,P]=M(t-1.5,e+h,n,l),[b,v]=M(t+1.5,e+h,n,l);return[c,u,f,p,g,x,k,w,m,d,y,P,b,v]}function x(t=0,e=Math.PI,n=!0){n&&(e=(2*Math.PI-e)%(2*Math.PI));const r=10,o=n?-1:1,s=5*o,a=20*o,h=25*o,l=45,c=0,u=0,f=2,p=0,m=f*o,d=n?1:-1,g=r/2*d;let[x,k]=[c+g,u-a],[w,y]=[x+f*d,k],[P,b]=[w-p*d,y+m],[v,I]=[c-g,u-h],[A,_]=[v+p*d,I-m],U=Math.ceil(t/i),S=Math.floor(U/10);U-=8*S;const D=[],F=[];for(let i=0;i<U/2;i++,S--){S<=0&&U%2==1&&i===(U-1)/2&&(v=c,A=v+p*d,I=(I+k)/2,_=I-m);const[t,n]=M(v,I,e,l);if(S>0){const[r,o]=M(w,I,e,l),[i,s]=M(x,k,e,l);D.push(r),D.push(o),D.push(t),D.push(n),D.push(i),D.push(s)}else{const[r,o]=M(w,y,e,l),[i,s]=M(P,b,e,l),[a,h]=M(A,_,e,l);F.push(t),F.push(n),F.push(a),F.push(h),F.push(i),F.push(s),F.push(r),F.push(o)}I+=s,k+=s,y+=s,b+=s,_+=s}const[N,j]=M(c+g,u+a,e,l),J=(r/2+f)*d,[O,q]=M(c+J,u+a,e,l),[B,E]=M(c+g,u-h,e,l),[T,C]=M(c+J,u-h,e,l);return{pennants:D,barbs:F,shaft:[N,j,O,q,B,E,T,C]}}function M(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-n)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],w=[0,.5,1,1.5,2],y=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function P(t,e,n,r){const o=a(r||"knots",n);let i;for(i=1;i<e.length;i++)if(i===e.length-1){if(t<e[i]*o)break}else if(t<=e[i]*o)break;return Math.min(i-1,e.length-2)}function b(t,e,n,r,o){let i=0;switch(e){case"beaufort_kn":i=P(t,k,"knots",n);break;case"beaufort_km":i=P(t,k,"kilometer-per-hour",n);break;case"beaufort_ft":i=P(t,k,"feet-per-second",n);break;case"beaufort_m":i=P(t,k,"meter-per-second",n);break;case"classified_arrow":i=P(t,o??[],r,n);break;case"ocean_current_m":i=P(t,w,"meter-per-second",n);break;case"ocean_current_kn":i=P(t,y,"knots",n)}return i}function v(t,e){const{style:n,inputUnit:r,outputUnit:o,breakValues:i}=e,a=s.fromJSON(r),h=s.fromJSON(o),l=7*6,c=15;let u=0,f=0;const{width:p,height:m,mask:x}=t,M=t.pixels[0],k=t.pixels[1],w=null!=x?x.filter(t=>t>0).length:p*m,y=new Float32Array(w*l),P=new Uint32Array(c*w),v=e.invertDirection?g(0,0,0,!1):d;for(let s=0;s<m;s++)for(let t=0;t<p;t++){const e=s*p+t;if(!x||x[s*p+t]){const r=(k[e]+360)%360/180*Math.PI,o=b(M[e],n,a,h,i);for(let n=0;n<v.length;n+=2)y[u++]=(t+.5)/p,y[u++]=(s+.5)/m,y[u++]=v[n],y[u++]=v[n+1]+r,y[u++]=o,y[u++]=M[e];const c=7*(u/l-1);P[f++]=c,P[f++]=c+1,P[f++]=c+2,P[f++]=c+0,P[f++]=c+4,P[f++]=c+3,P[f++]=c+0,P[f++]=c+2,P[f++]=c+3,P[f++]=c+2,P[f++]=c+5,P[f++]=c+3,P[f++]=c+5,P[f++]=c+6,P[f++]=c+3}}return{vertexData:y,indexData:P}}const I=[];function A(t,e){if(0===I.length)for(let i=0;i<30;i++)I.push(x(5*i,0,!e.invertDirection));const n=a(s.fromJSON(e.inputUnit),"knots"),{width:r,height:o,mask:h}=t,l=t.pixels[0],c=t.pixels[1],u=6,f=[],p=[];let m=0,d=0;for(let s=0;s<o;s++)for(let t=0;t<r;t++){const e=s*r+t,a=l[e]*n;if((!h||h[s*r+t])&&a>=i){const n=(c[e]+360)%360/180*Math.PI,{pennants:i,barbs:h,shaft:l}=I[Math.min(Math.floor(a/5),29)];if(i.length+h.length===0)continue;let g=f.length/u;const x=(t+.5)/r,M=(s+.5)/o;for(let t=0;t<i.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=i[t],f[m++]=i[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<h.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=h[t],f[m++]=h[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<l.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=l[t],f[m++]=l[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<i.length/6;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,g+=3;for(let t=0;t<h.length/8;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+2,p[d++]=g+3,g+=4;p[d++]=g+0,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+3,p[d++]=g+2,g+=4}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function _(t,e){const n=4*6;let r=0,o=0;const{width:h,height:l,mask:c}=t,u=t.pixels[0],f=[],p=[],m=a(s.fromJSON(e.inputUnit),"knots"),d="wind_speed"===e.style?i:Number.MAX_VALUE;for(let i=0;i<l;i++)for(let t=0;t<h;t++){const e=u[i*h+t]*m;if((!c||c[i*h+t])&&e<d){for(let n=0;n<4;n++)f[r++]=(t+.5)/h,f[r++]=(i+.5)/l,f[r++]=n<2?-.5:.5,f[r++]=n%2==0?-.5:.5,f[r++]=0,f[r++]=e;const s=4*(r/n-1);p[o++]=s,p[o++]=s+1,p[o++]=s+2,p[o++]=s+1,p[o++]=s+2,p[o++]=s+3}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function U(t,e){return"simple_scalar"===e.style?_(t,e):"wind_speed"===e.style?A(t,e):v(t,e)}function S(t,e,r,o=[0,0],i=.5){const{width:s,height:a,mask:h}=t,[u,f]=t.pixels,[p,m]=o,d=Math.round((s-p)/r),g=Math.round((a-m)/r),x=d*g,M=new Float32Array(x),k=new Float32Array(x),w=new Uint8Array(x),y="vector-uv"===e;for(let n=0;n<g;n++)for(let t=0;t<d;t++){let e=0;const o=n*d+t,g=Math.max(0,n*r+m),x=Math.max(0,t*r+p),P=Math.min(a,g+r),b=Math.min(s,x+r);for(let t=g;t<P;t++)for(let n=x;n<b;n++){const r=t*s+n;if(!h||h[r]){e++;const t=y?[u[r],f[r]]:[u[r],(360+f[r])%360],[n,i]=y?t:c(t);M[o]+=n,k[o]+=i}}if(e>=(P-g)*(b-x)*(1-i)){w[o]=1;const[t,n]=l([M[o]/e,k[o]/e]);M[o]=t,k[o]=n}else w[o]=0,M[o]=0,k[o]=0}const P=new n({width:d,height:g,pixels:[M,k],mask:w});return P.updateStatistics(),P}export{u as convertToLocalDirections,f as convertVectorFieldData,p as convertVectorFieldUnit,U as createVFMeshData,_ as createVFScalarData,a as getUnitConversionFactor,S as sampleVectorField,m as snapImageToSymbolTile,s as unitKebabDict,l as uvComponentToVector};
|
|
@@ -98,6 +98,7 @@ export interface FeatureFilterProperties extends Partial<Pick<FeatureFilter, "ob
|
|
|
98
98
|
* > [!WARNING]
|
|
99
99
|
* >
|
|
100
100
|
* > **Notes**
|
|
101
|
+
* >
|
|
101
102
|
* > The temporal filter can only be applied to a layer view if its layer has [TimeInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html).
|
|
102
103
|
*/
|
|
103
104
|
timeExtent?: QueryProperties["timeExtent"];
|
|
@@ -117,6 +118,7 @@ export interface FeatureFilterProperties extends Partial<Pick<FeatureFilter, "ob
|
|
|
117
118
|
* > [!WARNING]
|
|
118
119
|
* >
|
|
119
120
|
* > **Notes**
|
|
121
|
+
* >
|
|
120
122
|
* > Attribute values are case sensitive.
|
|
121
123
|
*
|
|
122
124
|
* @see [Sample - Filter features by attributes](https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/)
|
|
@@ -279,6 +281,7 @@ export default class FeatureFilter extends JSONSupport {
|
|
|
279
281
|
* > [!WARNING]
|
|
280
282
|
* >
|
|
281
283
|
* > **Notes**
|
|
284
|
+
* >
|
|
282
285
|
* > The temporal filter can only be applied to a layer view if its layer has [TimeInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html).
|
|
283
286
|
*/
|
|
284
287
|
get timeExtent(): Query["timeExtent"];
|
|
@@ -300,6 +303,7 @@ export default class FeatureFilter extends JSONSupport {
|
|
|
300
303
|
* > [!WARNING]
|
|
301
304
|
* >
|
|
302
305
|
* > **Notes**
|
|
306
|
+
* >
|
|
303
307
|
* > Attribute values are case sensitive.
|
|
304
308
|
*
|
|
305
309
|
* @see [Sample - Filter features by attributes](https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/)
|
|
@@ -4,9 +4,52 @@
|
|
|
4
4
|
* @since 4.33
|
|
5
5
|
* @see [ParquetLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html)
|
|
6
6
|
*/
|
|
7
|
+
import type Collection from "../../core/Collection.js";
|
|
8
|
+
import type SpatialReference from "../../geometry/SpatialReference.js";
|
|
9
|
+
import type Field from "./Field.js";
|
|
7
10
|
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
8
|
-
import type { ParquetLayerInfo } from "../graphics/sources/ParquetSource.js";
|
|
9
11
|
import type { CustomParameters } from "../mixins/CustomParametersMixin.js";
|
|
12
|
+
import type { ParquetGeometryEncodingUnion } from "./types.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Contains an information inferred from the parquet files.
|
|
16
|
+
*
|
|
17
|
+
* @since 5.0
|
|
18
|
+
* @see [getParquetLayerInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-parquetUtils.html#getParquetLayerInfo)
|
|
19
|
+
*/
|
|
20
|
+
export interface ParquetLayerInfo {
|
|
21
|
+
/**
|
|
22
|
+
* The fields derived from the parquet files.
|
|
23
|
+
*
|
|
24
|
+
* @since 5.0
|
|
25
|
+
*/
|
|
26
|
+
fields?: Field[];
|
|
27
|
+
/**
|
|
28
|
+
* The encoding format used to store geometries in the parquet files.
|
|
29
|
+
* See [ParquetLayer#geometryEncoding](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html#geometryEncoding) for more information.
|
|
30
|
+
*
|
|
31
|
+
* @since 5.0
|
|
32
|
+
*/
|
|
33
|
+
geometryEncoding?: ParquetGeometryEncodingUnion | null;
|
|
34
|
+
/**
|
|
35
|
+
* The geometry type of the features in the layer.
|
|
36
|
+
*
|
|
37
|
+
* @since 5.0
|
|
38
|
+
*/
|
|
39
|
+
geometryType?: ParquetGeometryType | null;
|
|
40
|
+
/**
|
|
41
|
+
* The spatial reference of the layer.
|
|
42
|
+
*
|
|
43
|
+
* @since 5.0
|
|
44
|
+
*/
|
|
45
|
+
spatialReference?: SpatialReference;
|
|
46
|
+
/**
|
|
47
|
+
* A collection of URLs pointing to the parquet files.
|
|
48
|
+
*
|
|
49
|
+
* @since 5.0
|
|
50
|
+
*/
|
|
51
|
+
urls: Collection<string>;
|
|
52
|
+
}
|
|
10
53
|
|
|
11
54
|
export type ParquetGeometryType = "point" | "polygon" | "polyline" | "multipoint";
|
|
12
55
|
|
|
@@ -791,10 +791,6 @@ export function colorspaceConversion(parameters: ColorspaceConversionParameters)
|
|
|
791
791
|
* Each pixel of the output is the dot product of the conversion matrix and the raster pixel value vector.
|
|
792
792
|
* See [Spectral Conversion function](https://pro.arcgis.com/en/pro-app/latest/help/analysis/raster-functions/spectral-conversion-function.htm).
|
|
793
793
|
*
|
|
794
|
-
* > [!WARNING]
|
|
795
|
-
* >
|
|
796
|
-
* > Note: This function is supported on server side by [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) only.
|
|
797
|
-
*
|
|
798
794
|
* @param parameters - The parameters object has the following properties.
|
|
799
795
|
* @returns Returns a RasterFunction.
|
|
800
796
|
* @since 4.32
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../request.js";import{clone as t}from"../../core/lang.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{normalize as l,removeFile as r,getAppBaseUrl as s,removeTrailingSlash as n,addQueryParameters as i,isProtocolRelative as u,isAbsolute as c,join as a}from"../../core/urlUtils.js";import{wgs84 as
|
|
5
|
+
import e from"../../request.js";import{clone as t}from"../../core/lang.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{normalize as l,removeFile as r,getAppBaseUrl as s,removeTrailingSlash as n,addQueryParameters as i,isProtocolRelative as u,isAbsolute as c,join as a}from"../../core/urlUtils.js";import{wgs84 as y,webMercator as f}from"../../geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as p}from"../../geometry/support/webMercatorUtils.js";import m from"../../views/2d/engine/vectorTiles/style/VectorTileSource.js";async function d(e,t){const o={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[l,r]="string"==typeof e?[e,null]:[null,e.jsonUrl];await S(o,"esri",e,r,t);return{layerDefinition:o.validatedSource,url:l,serviceUrl:o.sourceUrl,style:o.style,styleUrl:o.styleUrl,spriteUrl:o.style&&o.style.sprite&&h(o.styleBase,o.style.sprite),spriteFormat:o.spriteFormat,glyphsUrl:o.style&&o.style.glyphs&&h(o.styleBase,o.style.glyphs),sourceNameToSource:o.sourceNameToSource,primarySourceName:o.primarySourceName}}function h(...e){let t;for(const o of e)if(null!=o)if(u(o)){if(t){const e=t.split("://")[0];t=e+":"+o.trim()}}else t=c(o)?o:a(t,o);return t?n(t):void 0}async function S(t,r,s,n,i){let u,c,a;if(o(i),"string"==typeof s){const t=l(s);a=await e(t,{...i,responseType:"json",query:{f:"json",...i?.query}}),a.ssl&&(u&&(u=u.replace(/^http:/i,"https:")),c&&(c=c.replace(/^http:/i,"https:"))),u=t,c=t}else null!=s&&(a={data:s},u=s.jsonUrl||null,c=n);const y=a?.data;if(g(y))return t.styleUrl=u||null,j(t,y,c,i);if(w(y))return t.sourceUrl?U(t,y,c,!1,r,i):(t.sourceUrl=u||null,x(y)&&null==t.style&&(r="tilejson"),U(t,y,c,!0,r,i));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function x(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function g(e){return!!e&&"sources"in e&&!!e.sources}function w(e){return!g(e)}async function j(e,t,o,l){const n=o?r(o):s();e.styleBase=n,e.style=t,"webp"===t["sprite-format"]?.toLowerCase()&&(e.spriteFormat="webp");const i=[];if(t.sources&&t.sources.esri){const o=t.sources.esri;o.url?await S(e,"esri",h(n,o.url),void 0,l):i.push(S(e,"esri",o,n,l))}for(const r of Object.keys(t.sources))"esri"!==r&&"tilejson"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?i.push(S(e,r,h(n,t.sources[r].url),void 0,l)):t.sources[r].tiles&&i.push(S(e,r,t.sources[r],n,l)));await Promise.all(i)}async function U(e,t,o,l,r,u){const c=o?n(o)+"/":s(),a=v(t,e),y=new m(r,i(c,u?.query??{}),a);if(!l&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(y))return;null!=y.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(y.fullExtent):t.fullExtent=y.fullExtent.clone()),t.tileInfo&&y.tileInfo&&t.tileInfo.lods.length<y.tileInfo.lods.length&&(t.tileInfo=y.tileInfo)}if(l&&(e.sourceBase=c,e.source=t,e.validatedSource=a,e.primarySourceName=r),e.sourceNameToSource[r]=y,!x(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?S(e,"",h(c,t.defaultStyles,"root.json"),void 0,u):S(e,"",t.defaultStyles,h(c,"root.json"),u)}if(x(t)&&null==e.style&&a.defaultStyles)return S(e,"",a.defaultStyles,h(c,"root.json"),u)}function v(e,o){const l=512;if(N(e)){const t=e?.tileInfo;return null!=t&&(null==t.rows&&(t.rows=l),null==t.cols&&(t.cols=l)),e}const r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}};let s,n=null;if(x(e)){const{bounds:l,vector_layers:r}=e;if(l){const e=p({x:l[0],y:l[1],spatialReference:t(y)}),o=p({x:l[2],y:l[3],spatialReference:t(y)});n={xmin:e.x,ymin:e.y,xmax:o.x,ymax:o.y,spatialReference:t(f)}}if(r&&r.length>0)s={version:8,sprite:"",glyphs:"",sources:{tilejson:{type:"vector",url:e.tilejson}},layers:T(r)};else if(null==o.style)throw new Error("The TileJSON source does not contain any vector_layers. This VectorTileLayer cannot be loaded.")}null===n&&(n=r);let i=78271.51696400007,u=295828763.7957775;const c=[],a=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?Math.abs(+e.maxzoom):22,m=0,d=0;for(let t=0;t<=a;t++)c.push({level:t,scale:u,resolution:i}),i/=2,u/=2;return{capabilities:"TilesOnly",initialExtent:n,fullExtent:r,minScale:m,maxScale:d,tiles:e.tiles,tileInfo:{rows:l,cols:l,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:c,spatialReference:t(f)},defaultStyles:s}}function N(e){return e.hasOwnProperty("tileInfo")}function T(e){const t=[];for(const o of e)o.geometry_type?t.push(b(o.geometry_type.toLowerCase(),o,!1)):(t.push(b("polygon",o,!0)),t.push(b("line",o,!0)),t.push(b("circle",o,!0)));return t}function b(e,t,o){const{id:l,minzoom:r,maxzoom:s}=t,n={type:"polygon"===e||"polygons"===e?"fill":"line"===e||"lines"===e?"line":"circle",id:l,source:"tilejson","source-layer":l,minzoom:r,maxzoom:s};switch(e){case"fill":o&&(n.id+="_polygon",n.filter='(["==", "$type", "Polygon"])'),n.paint={"fill-color":"#808080"};break;case"line":o&&(n.id+="_line",n.filter='(["==", "$type", "LineString"])');break;case"circle":o&&(n.id+="_point",n.filter='(["==", "$type", "Point"])')}return n}export{d as loadMetadata};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{urlToObject as n}from"../../core/urlUtils.js";import{isAxesOrderReversedForWkid as r}from"../ogc/crsUtils.js";import{DateTime as i,FixedOffsetZone as s}from"luxon";const o={84:4326,83:4269,27:4267};function a(n){if(!n)return null;const r={idCounter:-1};if("string"==typeof n){n=(new DOMParser).parseFromString(n,"text/xml")}const i=n.documentElement;if("ServiceExceptionReport"===i.nodeName){const e=Array.prototype.slice.call(i.childNodes).map(e=>e.textContent).join("\r\n");throw new t("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",e)}const s=d("Capability",i),o=d("Service",i),a=s&&d("Request",s);if(!s||!o||!a)return null;const l=d("Layer",s);if(!l)return null;const m="WMS_Capabilities"===i.nodeName||"WMT_MS_Capabilities"===i.nodeName?i.getAttribute("version"):"1.3.0",f=x("Title",o,"")||x("Name",o,""),p=x("AccessConstraints",o,""),h=/^none$/i.test(p)?"":p,y=x("Abstract",o,""),S=parseInt(x("MaxWidth",o,"5000"),10),E=parseInt(x("MaxHeight",o,"5000"),10),L=g(a,"GetMap"),C=N(a,"GetMap"),M=b(l,m,r);if(!M)return null;let T,R=0;const I=Array.prototype.slice.call(s.childNodes),v=M.sublayers??[],w=e=>{null!=e&&v.push(e)};I.forEach(e=>{"Layer"===e.nodeName&&(0===R?T=e:1===R?(M.name&&(M.name="",w(b(T,m,r))),w(b(e,m,r))):w(b(e,m,r)),R++)});const U=M.sublayers??[],V=M.fullExtents??[];0===U.length&&U.push(M),M.extent??=U[0].extent;const _=M.spatialReferences.length>0?M.spatialReferences:u(M),O=N(a,"GetFeatureInfo"),B=O?g(a,"GetFeatureInfo"):null,k=c(U),q=M.minScale||0,X=M.maxScale||0,D=M.dimensions??[],$=k.reduce((e,t)=>e.concat(t.dimensions??[]),[]),j=D.concat($).filter(F);let G=null;if(j.length){const t=j.map(e=>{const{extent:t}=e;return A(t)?t.map(e=>e.getTime()):t?.map(e=>[e.min.getTime(),e.max.getTime()])}).flat(2).filter(e),{start:n,end:r}=t.reduce((e,t)=>({start:Math.min(e.start,t),end:Math.max(e.end,t)}),{start:1/0,end:-1/0});G={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[n,r]}}return{copyright:h,description:y,dimensions:D,extent:M.extent,fullExtents:V,featureInfoFormats:B,featureInfoUrl:O,mapUrl:C,maxWidth:S,maxHeight:E,maxScale:X,minScale:q,layers:k,spatialReferences:_,supportedImageFormatTypes:L,timeInfo:G,title:f,version:m}}function l(e){const t=e.filter(e=>e.popupEnabled&&e.name&&e.queryable);return t.length?t.map(({name:e})=>e).join():null}function u(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=u(t);if(e.length>0)return e}return[]}function c(e){let t=[];for(const n of e)t.push(n),n.sublayers?.length&&(t=t.concat(c(n.sublayers)),delete n.sublayers);return t}function m(e,t,n){return t.getAttribute(e)??n}function f(e,t,n,r){const i=d(e,n);return i?m(t,i,r):r}function d(e,t){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(S(r)&&r.nodeName===e)return r}return null}function p(e,t){if(null==t)return[];const n=[];for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];S(i)&&i.nodeName===e&&n.push(i)}return n}function x(e,t,n){return d(e,t)?.textContent??n}function h(e,t,n){const r=parseFloat(e.getAttribute("minx")??"0"),i=parseFloat(e.getAttribute("miny")??"0"),s=parseFloat(e.getAttribute("maxx")??"0"),o=parseFloat(e.getAttribute("maxy")??"0");return{xmin:n?isNaN(i)?-Number.MAX_VALUE:i:isNaN(r)?-Number.MAX_VALUE:r,ymin:n?isNaN(r)?-Number.MAX_VALUE:r:isNaN(i)?-Number.MAX_VALUE:i,xmax:n?isNaN(o)?Number.MAX_VALUE:o:isNaN(s)?Number.MAX_VALUE:s,ymax:n?isNaN(s)?Number.MAX_VALUE:s:isNaN(o)?Number.MAX_VALUE:o,spatialReference:{wkid:t}}}function N(e,t){const n=d(t,e);if(n){const e=d("DCPType",n);if(e){const t=d("HTTP",e);if(t){const e=d("Get",t);if(e){let t=f("OnlineResource","xlink:href",e,null);if(t){const e=t.indexOf("&");return-1!==e&&e===t.length-1&&(t=t.slice(0,-1)),M(t,["service","request"])}}}}}return null}function g(t,n){const r=p("Operation",t);if(!r.length){return p("Format",d(n,t)).map(({textContent:e})=>e).filter(e)}const i=[];for(const e of r)if(e.getAttribute("name")===n){const t=p("Format",e);for(const{textContent:e}of t)null!=e&&i.push(e)}return i}function y(e,t,n){const r=d(t,e);if(!r)return n;const{textContent:i}=r;if(null==i||""===i)return n;const s=Number(i);return isNaN(s)?n:s}function b(e,t,n){if(!e)return null;const i=e.getAttribute("queryable")?.toLowerCase(),s="1"===i||"true"===i,a={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:s,spatialReferences:[],sublayers:null},l=d("LatLonBoundingBox",e),u=d("EX_GeographicBoundingBox",e),c=l?h(l,4326):u?{xmin:parseFloat(x("westBoundLongitude",u,"0")),ymin:parseFloat(x("southBoundLatitude",u,"0")),xmax:parseFloat(x("eastBoundLongitude",u,"0")),ymax:parseFloat(x("northBoundLatitude",u,"0")),spatialReference:{wkid:4326}}:{xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}};a.minScale=y(e,"MaxScaleDenominator",0),a.maxScale=y(e,"MinScaleDenominator",0);const f=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(e=>{if("Name"===e.nodeName)a.name=e.textContent||"";else if("Title"===e.nodeName)a.title=e.textContent||"";else if("Abstract"===e.nodeName)a.description=e.textContent||"";else if("BoundingBox"===e.nodeName){const n=e.getAttribute(f),i=n?.indexOf(":");if(i&&i>-1){let s=parseInt(n.slice(i+1),10);0===s||isNaN(s)||(s=o[s]??s);const l="1.3.0"===t?h(e,s,r(s)):h(e,s);l&&a.fullExtents&&a.fullExtents.push(l)}}else if(e.nodeName===f){(e.textContent?.split(" ")??[]).forEach(e=>{let t=NaN;if(e.includes(":")){const[n,r]=e.toUpperCase().split(":");"CRS"!==n&&"EPSG"!==n||(t=parseInt(r,10))}else t=parseInt(e,10);if(0!==t&&!isNaN(t)){const e=o[t]??t;a.spatialReferences.includes(e)||a.spatialReferences.push(e)}})}else if("Style"!==e.nodeName||a.legendUrl){if("Layer"===e.nodeName){const r=b(e,t,n);r&&(r.parentLayerId=a.id,a.sublayers||(a.sublayers=[]),a.sublayers.push(r))}}else{const t=d("LegendURL",e);if(t){const e=d("OnlineResource",t);e&&(a.legendUrl=e.getAttribute("xlink:href"))}}}),a.extent=c,a.dimensions=p("Dimension",e).filter(e=>e.getAttribute("name")&&e.getAttribute("units")&&e.textContent).map(e=>{const t=e.getAttribute("name"),n=e.getAttribute("units"),r=e.textContent,i=e.getAttribute("unitSymbol")??void 0,s=e.getAttribute("default")??void 0,o="0"!==m("default",e,"0"),a="0"!==m("nearestValue",e,"0"),l="0"!==m("current",e,"0");if(F({name:t,units:n})){return{name:"time",units:"ISO8601",extent:I(r),default:I(s),multipleValues:o,nearestValue:a,current:l}}if(L({name:t,units:n})){return{name:"elevation",units:n,extent:T(r),unitSymbol:i,default:T(s),multipleValues:o,nearestValue:a}}return{name:t,units:n,extent:R(r),unitSymbol:i,default:R(s),multipleValues:o,nearestValue:a}}),a}function A(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function S(e){return e.nodeType===Node.ELEMENT_NODE}function E(e){return void 0!==e.min&&void 0!==e.max}function L(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function C(e){return!F(e)&&!L(e)}function F(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function M(e,t){const r=[],i=n(e);for(const n in i.query)i.query.hasOwnProperty(n)&&(t.includes(n.toLowerCase())||r.push(n+"="+i.query[n]));return i.path+(r.length?"?"+r.join("&"):"")}function T(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&"0"!==t[2]?parseFloat(t[2]):void 0}}).filter(e):r.map(e=>parseFloat(e))}function R(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:t[0],max:t[1],resolution:t.length>=3&&"0"!==t[2]?t[2]:void 0}}).filter(e):r}function I(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:v(t[0]),max:v(t[1]),resolution:t.length>=3&&"0"!==t[2]?w(t[2]):void 0}}).filter(e):r.map(e=>v(e))}function v(e){return i.fromISO(e,{zone:s.utcInstance}).toJSDate()}function w(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,n=e.match(t);if(!n)return null;return{years:U(n[1]),months:U(n[2]),days:U(n[3]),hours:U(n[4]),minutes:U(n[5]),seconds:U(n[6])}}function U(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,n=e.match(t);if(!n)return 0;const r=n[0].replace(",",".");return Number(r)}function V(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const _="0000-01-01T00:00:00Z",O="9999-12-31T23:59:59Z";function B(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:n}=e;if(t&&
|
|
5
|
+
import{isSome as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{urlToObject as n}from"../../core/urlUtils.js";import{isAxesOrderReversedForWkid as r}from"../ogc/crsUtils.js";import{DateTime as i,FixedOffsetZone as s}from"luxon";const o={84:4326,83:4269,27:4267};function a(n){if(!n)return null;const r={idCounter:-1};if("string"==typeof n){n=(new DOMParser).parseFromString(n,"text/xml")}const i=n.documentElement;if("ServiceExceptionReport"===i.nodeName){const e=Array.prototype.slice.call(i.childNodes).map(e=>e.textContent).join("\r\n");throw new t("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",e)}const s=d("Capability",i),o=d("Service",i),a=s&&d("Request",s);if(!s||!o||!a)return null;const l=d("Layer",s);if(!l)return null;const m="WMS_Capabilities"===i.nodeName||"WMT_MS_Capabilities"===i.nodeName?i.getAttribute("version"):"1.3.0",f=x("Title",o,"")||x("Name",o,""),p=x("AccessConstraints",o,""),h=/^none$/i.test(p)?"":p,y=x("Abstract",o,""),S=parseInt(x("MaxWidth",o,"5000"),10),E=parseInt(x("MaxHeight",o,"5000"),10),L=g(a,"GetMap"),C=N(a,"GetMap"),M=b(l,m,r);if(!M)return null;let T,R=0;const I=Array.prototype.slice.call(s.childNodes),v=M.sublayers??[],w=e=>{null!=e&&v.push(e)};I.forEach(e=>{"Layer"===e.nodeName&&(0===R?T=e:1===R?(M.name&&(M.name="",w(b(T,m,r))),w(b(e,m,r))):w(b(e,m,r)),R++)});const U=M.sublayers??[],V=M.fullExtents??[];0===U.length&&U.push(M),M.extent??=U[0].extent;const _=M.spatialReferences.length>0?M.spatialReferences:u(M),O=N(a,"GetFeatureInfo"),B=O?g(a,"GetFeatureInfo"):null,k=c(U),q=M.minScale||0,X=M.maxScale||0,D=M.dimensions??[],$=k.reduce((e,t)=>e.concat(t.dimensions??[]),[]),j=D.concat($).filter(F);let G=null;if(j.length){const t=j.map(e=>{const{extent:t}=e;return A(t)?t.map(e=>e.getTime()):t?.map(e=>[e.min.getTime(),e.max.getTime()])}).flat(2).filter(e),{start:n,end:r}=t.reduce((e,t)=>({start:Math.min(e.start,t),end:Math.max(e.end,t)}),{start:1/0,end:-1/0});G={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[n,r]}}return{copyright:h,description:y,dimensions:D,extent:M.extent,fullExtents:V,featureInfoFormats:B,featureInfoUrl:O,mapUrl:C,maxWidth:S,maxHeight:E,maxScale:X,minScale:q,layers:k,spatialReferences:_,supportedImageFormatTypes:L,timeInfo:G,title:f,version:m}}function l(e){const t=e.filter(e=>e.popupEnabled&&e.name&&e.queryable);return t.length?t.map(({name:e})=>e).join():null}function u(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=u(t);if(e.length>0)return e}return[]}function c(e){let t=[];for(const n of e)t.push(n),n.sublayers?.length&&(t=t.concat(c(n.sublayers)),delete n.sublayers);return t}function m(e,t,n){return t.getAttribute(e)??n}function f(e,t,n,r){const i=d(e,n);return i?m(t,i,r):r}function d(e,t){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(S(r)&&r.nodeName===e)return r}return null}function p(e,t){if(null==t)return[];const n=[];for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];S(i)&&i.nodeName===e&&n.push(i)}return n}function x(e,t,n){return d(e,t)?.textContent??n}function h(e,t,n){const r=parseFloat(e.getAttribute("minx")??"0"),i=parseFloat(e.getAttribute("miny")??"0"),s=parseFloat(e.getAttribute("maxx")??"0"),o=parseFloat(e.getAttribute("maxy")??"0");return{xmin:n?isNaN(i)?-Number.MAX_VALUE:i:isNaN(r)?-Number.MAX_VALUE:r,ymin:n?isNaN(r)?-Number.MAX_VALUE:r:isNaN(i)?-Number.MAX_VALUE:i,xmax:n?isNaN(o)?Number.MAX_VALUE:o:isNaN(s)?Number.MAX_VALUE:s,ymax:n?isNaN(s)?Number.MAX_VALUE:s:isNaN(o)?Number.MAX_VALUE:o,spatialReference:{wkid:t}}}function N(e,t){const n=d(t,e);if(n){const e=d("DCPType",n);if(e){const t=d("HTTP",e);if(t){const e=d("Get",t);if(e){let t=f("OnlineResource","xlink:href",e,null);if(t){const e=t.indexOf("&");return-1!==e&&e===t.length-1&&(t=t.slice(0,-1)),M(t,["service","request"])}}}}}return null}function g(t,n){const r=p("Operation",t);if(!r.length){return p("Format",d(n,t)).map(({textContent:e})=>e).filter(e)}const i=[];for(const e of r)if(e.getAttribute("name")===n){const t=p("Format",e);for(const{textContent:e}of t)null!=e&&i.push(e)}return i}function y(e,t,n){const r=d(t,e);if(!r)return n;const{textContent:i}=r;if(null==i||""===i)return n;const s=Number(i);return isNaN(s)?n:s}function b(e,t,n){if(!e)return null;const i=e.getAttribute("queryable")?.toLowerCase(),s="1"===i||"true"===i,a={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:s,spatialReferences:[],sublayers:null},l=d("LatLonBoundingBox",e),u=d("EX_GeographicBoundingBox",e),c=l?h(l,4326):u?{xmin:parseFloat(x("westBoundLongitude",u,"0")),ymin:parseFloat(x("southBoundLatitude",u,"0")),xmax:parseFloat(x("eastBoundLongitude",u,"0")),ymax:parseFloat(x("northBoundLatitude",u,"0")),spatialReference:{wkid:4326}}:{xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}};a.minScale=y(e,"MaxScaleDenominator",0),a.maxScale=y(e,"MinScaleDenominator",0);const f=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(e=>{if("Name"===e.nodeName)a.name=e.textContent||"";else if("Title"===e.nodeName)a.title=e.textContent||"";else if("Abstract"===e.nodeName)a.description=e.textContent||"";else if("BoundingBox"===e.nodeName){const n=e.getAttribute(f),i=n?.indexOf(":");if(i&&i>-1){let s=parseInt(n.slice(i+1),10);0===s||isNaN(s)||(s=o[s]??s);const l="1.3.0"===t?h(e,s,r(s)):h(e,s);l&&a.fullExtents&&a.fullExtents.push(l)}}else if(e.nodeName===f){(e.textContent?.split(" ")??[]).forEach(e=>{let t=NaN;if(e.includes(":")){const[n,r]=e.toUpperCase().split(":");"CRS"!==n&&"EPSG"!==n||(t=parseInt(r,10))}else t=parseInt(e,10);if(0!==t&&!isNaN(t)){const e=o[t]??t;a.spatialReferences.includes(e)||a.spatialReferences.push(e)}})}else if("Style"!==e.nodeName||a.legendUrl){if("Layer"===e.nodeName){const r=b(e,t,n);r&&(r.parentLayerId=a.id,a.sublayers||(a.sublayers=[]),a.sublayers.push(r))}}else{const t=d("LegendURL",e);if(t){const e=d("OnlineResource",t);e&&(a.legendUrl=e.getAttribute("xlink:href"))}}}),a.extent=c,a.dimensions=p("Dimension",e).filter(e=>e.getAttribute("name")&&e.getAttribute("units")&&e.textContent).map(e=>{const t=e.getAttribute("name"),n=e.getAttribute("units"),r=e.textContent,i=e.getAttribute("unitSymbol")??void 0,s=e.getAttribute("default")??void 0,o="0"!==m("default",e,"0"),a="0"!==m("nearestValue",e,"0"),l="0"!==m("current",e,"0");if(F({name:t,units:n})){return{name:"time",units:"ISO8601",extent:I(r),default:I(s),multipleValues:o,nearestValue:a,current:l}}if(L({name:t,units:n})){return{name:"elevation",units:n,extent:T(r),unitSymbol:i,default:T(s),multipleValues:o,nearestValue:a}}return{name:t,units:n,extent:R(r),unitSymbol:i,default:R(s),multipleValues:o,nearestValue:a}}),a}function A(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function S(e){return e.nodeType===Node.ELEMENT_NODE}function E(e){return void 0!==e.min&&void 0!==e.max}function L(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function C(e){return!F(e)&&!L(e)}function F(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function M(e,t){const r=[],i=n(e);for(const n in i.query)i.query.hasOwnProperty(n)&&(t.includes(n.toLowerCase())||r.push(n+"="+i.query[n]));return i.path+(r.length?"?"+r.join("&"):"")}function T(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&"0"!==t[2]?parseFloat(t[2]):void 0}}).filter(e):r.map(e=>parseFloat(e))}function R(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:t[0],max:t[1],resolution:t.length>=3&&"0"!==t[2]?t[2]:void 0}}).filter(e):r}function I(t){if(!t)return;const n=t.includes("/"),r=t.split(",");return n?r.map(e=>{const t=e.split("/");if(t.length<2)return null;return{min:v(t[0]),max:v(t[1]),resolution:t.length>=3&&"0"!==t[2]?w(t[2]):void 0}}).filter(e):r.map(e=>v(e))}function v(e){return i.fromISO(e,{zone:s.utcInstance}).toJSDate()}function w(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,n=e.match(t);if(!n)return null;return{years:U(n[1]),months:U(n[2]),days:U(n[3]),hours:U(n[4]),minutes:U(n[5]),seconds:U(n[6])}}function U(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,n=e.match(t);if(!n)return 0;const r=n[0].replace(",",".");return Number(r)}function V(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const _="0000-01-01T00:00:00Z",O="9999-12-31T23:59:59Z";function B(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:n}=e;if(t&&t.getTime()===n?.getTime())return`${V(t)}`;return`${t?V(t):_}/${n?V(n):O}`}const k=new Set([102100,3857,102113,900913]),q=new Set([3395,54004]);function X(e,t){let n=e.wkid;return null==t?n:(null!=n&&t.includes(n)||!e.latestWkid||(n=e.latestWkid),null!=n&&k.has(n)?t.find(e=>k.has(e))||t.find(e=>q.has(e))||102100:n)}export{w as fromISODuration,l as getPopupLayers,E as isDimensionInterval,L as isElevationDimension,C as isGenericDimension,F as isTimeDimension,X as normalizeWKID,a as parseCapabilities,B as toTimeQueryParameter};
|
|
@@ -6,6 +6,7 @@ import type { JSONSupport } from "../core/JSONSupport.js";
|
|
|
6
6
|
import type { CircuitExportResult, DomainNetworkJSON } from "./support/jsonTypes.js";
|
|
7
7
|
import type { ExportCircuitsParametersProperties } from "../rest/networks/circuits/support/ExportCircuitsParameters.js";
|
|
8
8
|
import type { QueryCircuitsParametersProperties } from "../rest/networks/circuits/support/QueryCircuitsParameters.js";
|
|
9
|
+
import type { VerifyCircuitsParametersProperties } from "../rest/networks/circuits/support/VerifyCircuitsParameters.js";
|
|
9
10
|
import type { UtilityNetworkProperties } from "./UtilityNetwork.js";
|
|
10
11
|
|
|
11
12
|
export interface CircuitManagerProperties {
|
|
@@ -27,6 +28,8 @@ export type QueryCircuitProperties = Pick<QueryCircuitsParametersProperties, "lo
|
|
|
27
28
|
|
|
28
29
|
export type ExportCircuitsProperties = Pick<ExportCircuitsParametersProperties, "circuitNames" | "exportAcknowledgement" | "resultTypes">;
|
|
29
30
|
|
|
31
|
+
export type VerifyCircuitsProperties = Pick<VerifyCircuitsParametersProperties, "circuitNames" | "continueOnFailure" | "forceVerify" | "synthesizeGeometries">;
|
|
32
|
+
|
|
30
33
|
/**
|
|
31
34
|
* A CircuitManager provides access to circuit management capabilities for a telecom domain network
|
|
32
35
|
* in a utility network.
|
|
@@ -174,10 +177,8 @@ export default class CircuitManager extends JSONSupport {
|
|
|
174
177
|
* The operation confirms that a circuit can be traced from the starting location to the stopping location
|
|
175
178
|
* and ensures that circuit sections and subcircuits are properly configured.
|
|
176
179
|
*
|
|
177
|
-
* @param
|
|
178
|
-
* @
|
|
179
|
-
* @returns Resolves to an array of objects
|
|
180
|
-
* specifying the verification status for each circuit.
|
|
180
|
+
* @param props - An object specifying configuration settings for the verify operation.
|
|
181
|
+
* @returns Resolves to an array of objects specifying the verification status for each circuit.
|
|
181
182
|
*/
|
|
182
|
-
verify(
|
|
183
|
+
verify(props: VerifyCircuitsProperties): Promise<CircuitVerifyResult[]>;
|
|
183
184
|
}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as n}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import l from"./support/Circuit.js";import{isVersionInEditSession as u,currentSessionId as d,isSafeToEditVersion as m}from"../versionManagement/support/versionManagementUtils.js";let h=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l({circuitManager:this,name:e,sections:t?new Map:null})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async verify(e,t=!1){const[{verifyCircuits:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=r.from({circuits:e,synthesizeGeometries:t,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);return o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0}),c.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=Array.isArray(e)?{circuits:e}:e,s=i.from(r);u(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=d:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?r.sessionId=d:r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.resultTypes=["name"],r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;return(await t(this.networkServiceUrl,r)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}};e([s()],h.prototype,"_circuitTable",void 0),e([s()],h.prototype,"_circuitSectionTable",void 0),e([s()],h.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],h.prototype,"telecomDomainNetwork",void 0),e([s({type:a,constructOnly:!0})],h.prototype,"utilityNetwork",void 0),e([s()],h.prototype,"networkServiceUrl",null),e([s()],h.prototype,"featureServiceUrl",null),e([s()],h.prototype,"gdbVersion",null),e([s()],h.prototype,"historicMoment",null),e([s()],h.prototype,"telecomDomainNetworkName",null),e([s()],h.prototype,"circuitTable",null),e([s()],h.prototype,"circuitSectionTable",null),e([s()],h.prototype,"subcircuitTable",null),h=e([o("esri.networks.CircuitManager")],h);const b=h;export{b as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as n}from"../layers/mixins/EditBusLayer.js";import a from"./UtilityNetwork.js";import l from"./support/Circuit.js";import{isVersionInEditSession as u,currentSessionId as d,isSafeToEditVersion as m}from"../versionManagement/support/versionManagementUtils.js";let h=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l({circuitManager:this,name:e,sections:t?new Map:null})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=n(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async verify(e){const[{verifyCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=d,await m(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion;const s=n(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=Array.isArray(e)?{circuits:e}:e,s=i.from(r);u(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=d:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=i.from(e);u(this.featureServiceUrl,this.gdbVersion||null)?r.sessionId=d:r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.resultTypes=["name"],r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;return(await t(this.networkServiceUrl,r)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}};e([s()],h.prototype,"_circuitTable",void 0),e([s()],h.prototype,"_circuitSectionTable",void 0),e([s()],h.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],h.prototype,"telecomDomainNetwork",void 0),e([s({type:a,constructOnly:!0})],h.prototype,"utilityNetwork",void 0),e([s()],h.prototype,"networkServiceUrl",null),e([s()],h.prototype,"featureServiceUrl",null),e([s()],h.prototype,"gdbVersion",null),e([s()],h.prototype,"historicMoment",null),e([s()],h.prototype,"telecomDomainNetworkName",null),e([s()],h.prototype,"circuitTable",null),e([s()],h.prototype,"circuitSectionTable",null),e([s()],h.prototype,"subcircuitTable",null),h=e([o("esri.networks.CircuitManager")],h);const b=h;export{b as default};
|
package/networks/Network.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export default abstract class Network extends NetworkSuperclass {
|
|
|
64
64
|
* > [!WARNING]
|
|
65
65
|
* >
|
|
66
66
|
* > **Known Limitations**
|
|
67
|
+
* >
|
|
67
68
|
* > This method does not populate the [UtilityNetwork#sharedNamedTraceConfigurations](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html#sharedNamedTraceConfigurations) for a [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html) instance.
|
|
68
69
|
*
|
|
69
70
|
* @param params - The parameters for loading the portal item.
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{unique as r}from"../core/arrayUtils.js";import s from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as n}from"../core/accessorSupport/decorators.js";import l from"../layers/FeatureLayer.js";import{queryAllJSON as d}from"../layers/support/featureQueryAll.js";import u from"./Network.js";import m from"./RulesTable.js";import c from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as y}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import p from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as w,associationTypeKebabDict as I,nullGuid as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as g}from"./support/utils.js";import k from"../rest/networks/support/TelecomNetworkElement.js";import T from"../rest/support/Query.js";let S=class extends u{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new l({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>p.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?p.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new m({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return o(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>g(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:d,toTerminalId:u,toFirstUnit:m,toLastUnit:c,associationType:h,isContentVisible:p,percentAlong:f,globalId:I}=y(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[d]:e.toNetworkElement?.globalId,[u]:e.toNetworkElement?.terminalId,[h]:w[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[f]:e.percentAlong,[I]:e.globalId}});return e.fromNetworkElement instanceof k&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit),e.toNetworkElement instanceof k&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[c]=e.toNetworkElement?.lastUnit),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}generateCombineNetworkElements(e){return{id:this._ensureSingleSourceIdAsValidLayerId(e),combineGroupedObjects:[{globalIds:e.map(e=>e.globalId)}]}}generateDivideNetworkElements(e,t){return{id:this._ensureSingleSourceIdAsValidLayerId([e]),divideGroupedObjects:[{globalId:e.globalId,numUnits:t}]}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),d=s.get("FROMTERMINALID"),u=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),w=s.get("VIATERMINALID"),I=r.attributes[o.name],b=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[d.name]},{networkSourceId:r.attributes[u.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[w.name]}],k={ruleType:I,creationDate:b};for(const T of[0,1,2]){if(5!==I&&2===T)continue;const e=g[T],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(T){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}k[`${a}NetworkSource`]=r,k[`${a}AssetGroup`]=s,k[`${a}AssetType`]=o,k[`${a}Terminal`]=i?.toJSON()}return k}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new T({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await d(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??b,associationType:I.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}_ensureSingleSourceIdAsValidLayerId(e){const t=r(e.map(e=>e.networkSourceId));if(t.length>1)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");const o=t[0],i=this.getLayerIdBySourceId(o);if(null==i)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");return i}};e([a({readOnly:!0})],S.prototype,"_rulesLayer",null),e([a({type:[c],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],S.prototype,"sharedNamedTraceConfigurations",void 0),e([a({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],S.prototype,"type",void 0),e([a({readOnly:!0})],S.prototype,"serviceTerritoryFeatureLayerId",null),e([a({readOnly:!0})],S.prototype,"networkSystemLayers",null),e([a({readOnly:!0})],S.prototype,"terminalConfigurations",null),e([a({readOnly:!0})],S.prototype,"domainNetworkNames",null),e([a({readOnly:!0})],S.prototype,"hasTelecomNetwork",null),e([a({readOnly:!0,json:{read:!1}})],S.prototype,"associationsTable",null),S=e([n("esri.networks.UtilityNetwork")],S);const N=S;export{N as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{unique as r}from"../core/arrayUtils.js";import s from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a,subclass as n}from"../core/accessorSupport/decorators.js";import l from"../layers/FeatureLayer.js";import{queryAllJSON as u}from"../layers/support/featureQueryAll.js";import d from"./Network.js";import m from"./RulesTable.js";import c from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as y}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import p from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as w,associationTypeKebabDict as I,nullGuid as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as g}from"./support/utils.js";import T from"../rest/networks/support/TelecomNetworkElement.js";import k from"../rest/support/Query.js";let S=class extends d{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new l({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>p.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?p.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new m({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return o(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>g(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:m,toLastUnit:c,associationType:h,isContentVisible:p,percentAlong:f,globalId:I}=y(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:w[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[f]:e.percentAlong,[I]:e.globalId}}),y=e.associationType.includes("connectivity");return e.fromNetworkElement instanceof T&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit,y&&(r.attributes[i]=1)),e.toNetworkElement instanceof T&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[c]=e.toNetworkElement?.lastUnit,y&&(r.attributes[d]=1)),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}generateCombineNetworkElements(e){return{id:this._ensureSingleSourceIdAsValidLayerId(e),combineGroupedObjects:[{globalIds:e.map(e=>e.globalId)}]}}generateDivideNetworkElements(e,t){return{id:this._ensureSingleSourceIdAsValidLayerId([e]),divideGroupedObjects:[{globalId:e.globalId,numUnits:t}]}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),w=s.get("VIATERMINALID"),I=r.attributes[o.name],b=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[w.name]}],T={ruleType:I,creationDate:b};for(const k of[0,1,2]){if(5!==I&&2===k)continue;const e=g[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new k({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await u(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??b,associationType:I.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}_ensureSingleSourceIdAsValidLayerId(e){const t=r(e.map(e=>e.networkSourceId));if(t.length>1)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");const o=t[0],i=this.getLayerIdBySourceId(o);if(null==i)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");return i}};e([a({readOnly:!0})],S.prototype,"_rulesLayer",null),e([a({type:[c],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],S.prototype,"sharedNamedTraceConfigurations",void 0),e([a({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],S.prototype,"type",void 0),e([a({readOnly:!0})],S.prototype,"serviceTerritoryFeatureLayerId",null),e([a({readOnly:!0})],S.prototype,"networkSystemLayers",null),e([a({readOnly:!0})],S.prototype,"terminalConfigurations",null),e([a({readOnly:!0})],S.prototype,"domainNetworkNames",null),e([a({readOnly:!0})],S.prototype,"hasTelecomNetwork",null),e([a({readOnly:!0,json:{read:!1}})],S.prototype,"associationsTable",null),S=e([n("esri.networks.UtilityNetwork")],S);const N=S;export{N as default};
|