@arcgis/core 4.33.0-next.20250228 → 4.33.0-next.20250302
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +1 -0
- package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +1 -0
- package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +1 -0
- package/assets/esri/core/workers/chunks/12d798775a96a45aada2.js +1 -0
- package/assets/esri/core/workers/chunks/{f298cda10a9ffe35ea49.js → 1377ddd582518e5fa051.js} +1 -1
- package/assets/esri/core/workers/chunks/{95a5ed95f0060b43f38f.js → 15fe629cd4da1bb2169f.js} +1 -1
- package/assets/esri/core/workers/chunks/1a5f96b1b892ecceb36a.js +1 -0
- package/assets/esri/core/workers/chunks/{b4002b4fd99748fdf5da.js → 1e631e34ee495eb0e76e.js} +1 -1
- package/assets/esri/core/workers/chunks/22618753349eb9d8b3df.js +1 -0
- package/assets/esri/core/workers/chunks/25a686f00479ac12a1ca.js +1 -0
- package/assets/esri/core/workers/chunks/25ef080163f3f795911a.js +1 -0
- package/assets/esri/core/workers/chunks/{afdbdc1569b56489c14d.js → 29fe3e9a0ecab74bb729.js} +1 -1
- package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +1 -0
- package/assets/esri/core/workers/chunks/2f23fc27d005ffa18f47.js +1 -0
- package/assets/esri/core/workers/chunks/2f818b9a6b1f2b61410d.js +978 -0
- package/assets/esri/core/workers/chunks/3010a22d00f45fce5939.js +1 -0
- package/assets/esri/core/workers/chunks/{05869484d7de75f86916.js → 33005043f7084048296d.js} +1 -1
- package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 3315de71eb8791189c05.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7a055be225f3498baaf.js → 354117429b3a0a0794c9.js} +1 -1
- package/assets/esri/core/workers/chunks/361a3253877acd3b4f07.js +1 -0
- package/assets/esri/core/workers/chunks/{53bc621e2cbc519b2535.js → 36b406131cd864567033.js} +1 -1
- package/assets/esri/core/workers/chunks/385dd6466fd967ce3ae9.js +1 -0
- package/assets/esri/core/workers/chunks/394b9723d108cff7136e.js +1 -0
- package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +1 -0
- package/assets/esri/core/workers/chunks/47c04980098dc0c228d7.js +1 -0
- package/assets/esri/core/workers/chunks/{d6ee6ebdaf582f39c14b.js → 4c8164955f8d844c09ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4d7f1e685f69b3bf54d.js → 4c9160e3d596fe75392d.js} +1 -1
- package/assets/esri/core/workers/chunks/534f3d7e4300b662191a.js +1 -0
- package/assets/esri/core/workers/chunks/55c7c51e56d72f507c22.js +1 -0
- package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +1 -0
- package/assets/esri/core/workers/chunks/6ce738960ee47904968f.js +314 -0
- package/assets/esri/core/workers/chunks/{b12f2eaa15f6753fa1a8.js → 6ff981ec0c725efe5525.js} +1 -1
- package/assets/esri/core/workers/chunks/7ca33e03a2fd217b9443.js +1 -0
- package/assets/esri/core/workers/chunks/7d93ff4f18fd21c7b9f2.js +1 -0
- package/assets/esri/core/workers/chunks/{983d787730bf8b74fe13.js → 7ec2f531217718e76469.js} +1 -1
- package/assets/esri/core/workers/chunks/8196ff250c0de00104f7.js +1 -0
- package/assets/esri/core/workers/chunks/{ae25c6108918d37e61bf.js → 8278d9263e9b7e3bf2d1.js} +1 -1
- package/assets/esri/core/workers/chunks/852c32b5e717c54e3ae0.js +1 -0
- package/assets/esri/core/workers/chunks/856b03020b2dd047291d.js +1 -0
- package/assets/esri/core/workers/chunks/85a9025c2990a8bbd61b.js +1 -0
- package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +1 -0
- package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +1 -0
- package/assets/esri/core/workers/chunks/8d421e0a01e2c3f6980c.js +1 -0
- package/assets/esri/core/workers/chunks/{f27828ba83846d686072.js → 97078a7871e243c19b6b.js} +1 -1
- package/assets/esri/core/workers/chunks/a68b48fd1a529f69705e.js +1 -0
- package/assets/esri/core/workers/chunks/{272662e4e28341419b4f.js → a73a262ddc959a59819f.js} +1 -1
- package/assets/esri/core/workers/chunks/{4253438dd3045566892d.js → aba4353892c47de98eb3.js} +1 -1
- package/assets/esri/core/workers/chunks/{14cb593dfb50c724b9eb.js → ac6b582ca180210e596c.js} +1 -1
- package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +1 -0
- package/assets/esri/core/workers/chunks/{fc07d47d44c04f123650.js → b1e275607d9754079f60.js} +1 -1
- package/assets/esri/core/workers/chunks/b3c126e8a0a722c03efc.js +1 -0
- package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +1 -0
- package/assets/esri/core/workers/chunks/b52a3a48d2d3ff22542d.js +1 -0
- package/assets/esri/core/workers/chunks/be883ebdbaf11647b718.js +1 -0
- package/assets/esri/core/workers/chunks/bf9b45604249520b596a.js +1 -0
- package/assets/esri/core/workers/chunks/c0400c25c53fd90fc90e.js +1 -0
- package/assets/esri/core/workers/chunks/c2939e0c45a6d074cac0.js +1 -0
- package/assets/esri/core/workers/chunks/{fccf505dbd98e59e721a.js → c3dc8d1958ddc71e1129.js} +1 -1
- package/assets/esri/core/workers/chunks/c68c68e918c72932b247.js +1 -0
- package/assets/esri/core/workers/chunks/c8cd9a3175f516624842.js +1 -0
- package/assets/esri/core/workers/chunks/cc1aedb2b3aa3854b0de.js +1 -0
- package/assets/esri/core/workers/chunks/d374d2a1487faee3672d.js +1 -0
- package/assets/esri/core/workers/chunks/d630e64463687090db92.js +1 -0
- package/assets/esri/core/workers/chunks/dbdca19978fbee8dc106.js +1 -0
- package/assets/esri/core/workers/chunks/ddfb5a2055a36576ba0d.js +1 -0
- package/assets/esri/core/workers/chunks/e1a90f63d2e6c761953b.js +1 -0
- package/assets/esri/core/workers/chunks/{5b5d89b94e020b4bfcc1.js → e3b0bb6850d5252d5f24.js} +1 -1
- package/assets/esri/core/workers/chunks/{4235bb1334c95f3c828d.js → e45404a982e173459990.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7a3d9c5d18e59da378f.js → eab1e3c101158675abba.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a3290ee6e6587fa39a6.js → ed4afafbcb31491c2049.js} +1 -1
- package/assets/esri/core/workers/chunks/ef46613c3aa363dc1cfc.js +1 -0
- package/assets/esri/core/workers/chunks/{6c5877e4ad108a6d074e.js → f0351930cbb3d8643119.js} +1 -1
- package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +1 -0
- package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +1 -0
- package/assets/esri/core/workers/chunks/{a2e52b40eeeda4282c07.js → f70dd16f14279bb7e60d.js} +1 -1
- package/assets/esri/core/workers/chunks/f995a74bd9b58c069c07.js +1 -0
- package/assets/esri/core/workers/chunks/{7437b7423c8b7fb4f0dd.js → fe3ed029b07bb1e4aef3.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6e6247ea5ce0c2b125f.js → fe8ee1938d196a70d809.js} +1 -1
- package/assets/esri/themes/base/widgets/_LabeledSwitch.scss +0 -2
- 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/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/{GeodeticDistanceCalculator-D4iQ-_NX.js → GeodeticDistanceCalculator-CcF1gMZX.js} +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/distanceOperator.js +1 -1
- package/core/timeUtils.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/PolylineBuilder.js +5 -0
- package/geometry/support/TileClipper.js +1 -1
- package/interfaces.d.ts +9 -9
- package/intl/date.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/graphics/sources/WFSSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/ogc/ogcFeatureUtils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/rasterFunctions/RemapFunction.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +5 -0
- package/package.json +2 -2
- package/smartMapping/support/utils.js +1 -1
- package/support/guards.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +5 -0
- package/symbols/cim/effects/EffectRadial.js +5 -0
- package/symbols/cim/effects/EffectTaperedPolygon.js +5 -0
- package/symbols/cim/utils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/time/constants.js +5 -0
- package/time/timeZoneUtils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +5 -0
- package/views/2d/engine/webgl/urlUtils.js +5 -0
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/support/TextureCompressionHelper.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webmap/InitialViewProperties.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/getAssociationTitle.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/isConnectivity.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +5 -0
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0509af0f6c732a847531.js +0 -1
- package/assets/esri/core/workers/chunks/1461ca910c3dba1d808b.js +0 -1
- package/assets/esri/core/workers/chunks/19f45bb389daf866dbc5.js +0 -1
- package/assets/esri/core/workers/chunks/1c4cafb879f21a42f7db.js +0 -978
- package/assets/esri/core/workers/chunks/2626f4201deb7bdd4866.js +0 -1
- package/assets/esri/core/workers/chunks/2e1126a35976b2d48197.js +0 -1
- package/assets/esri/core/workers/chunks/2eadc555038a38afdc9c.js +0 -1
- package/assets/esri/core/workers/chunks/36f0446d9d47685b7ce0.js +0 -1
- package/assets/esri/core/workers/chunks/3cf3aa74541f0cfff94f.js +0 -1
- package/assets/esri/core/workers/chunks/3d46327469ed5170e83e.js +0 -1
- package/assets/esri/core/workers/chunks/440afa7d26e721af578a.js +0 -1
- package/assets/esri/core/workers/chunks/460e5f78574cc0d157af.js +0 -1
- package/assets/esri/core/workers/chunks/4de09a997691305415b1.js +0 -1
- package/assets/esri/core/workers/chunks/5066fc5257296d95fe60.js +0 -1
- package/assets/esri/core/workers/chunks/53315ca098d76d34cf00.js +0 -1
- package/assets/esri/core/workers/chunks/539190038ac552e5374c.js +0 -1
- package/assets/esri/core/workers/chunks/55162949a2b2c8e1c95c.js +0 -1
- package/assets/esri/core/workers/chunks/58853056c16f2b525a9e.js +0 -1
- package/assets/esri/core/workers/chunks/5af9737d0530ca17b771.js +0 -1
- package/assets/esri/core/workers/chunks/5c0dfc75a9b654e6fa25.js +0 -1
- package/assets/esri/core/workers/chunks/6245c51d1525767ce2fe.js +0 -1
- package/assets/esri/core/workers/chunks/6728185fdf53b4921bf8.js +0 -1
- package/assets/esri/core/workers/chunks/68cb0c3462c90f2d1538.js +0 -1
- package/assets/esri/core/workers/chunks/6affa0f3d5bb74c7a1db.js +0 -1
- package/assets/esri/core/workers/chunks/6e108fb9884139dd3b52.js +0 -314
- package/assets/esri/core/workers/chunks/6f9bfa6ed34ef6efcc6f.js +0 -1
- package/assets/esri/core/workers/chunks/70943dc884d9ba8045a2.js +0 -1
- package/assets/esri/core/workers/chunks/7fe799c1e60e23a976e9.js +0 -1
- package/assets/esri/core/workers/chunks/80395a1d8ae91ff3961b.js +0 -1
- package/assets/esri/core/workers/chunks/87b78e491c800c96b503.js +0 -1
- package/assets/esri/core/workers/chunks/8abd2235aa702d8b239f.js +0 -1
- package/assets/esri/core/workers/chunks/8bf29e5e4c93d85a6abf.js +0 -1
- package/assets/esri/core/workers/chunks/99838ad20c10aa5aa471.js +0 -1
- package/assets/esri/core/workers/chunks/9fb568d25ed4f4660963.js +0 -1
- package/assets/esri/core/workers/chunks/9ff9cf156d024ade068b.js +0 -1
- package/assets/esri/core/workers/chunks/a288c2474ef193f9fbd3.js +0 -1
- package/assets/esri/core/workers/chunks/a2d0f7d82630dd8efb9b.js +0 -1
- package/assets/esri/core/workers/chunks/a66c3866888bd7e415e8.js +0 -1
- package/assets/esri/core/workers/chunks/b3bbe6f569ab6a3777b5.js +0 -1
- package/assets/esri/core/workers/chunks/ba33405a524c6bb88656.js +0 -1
- package/assets/esri/core/workers/chunks/bb1fb9990f8bf5f7a05f.js +0 -1
- package/assets/esri/core/workers/chunks/c22664f9f2b4ba7fe3d4.js +0 -1
- package/assets/esri/core/workers/chunks/c83245257deb230f79c0.js +0 -1
- package/assets/esri/core/workers/chunks/d2f8eed0b5b7cbdcd182.js +0 -1
- package/assets/esri/core/workers/chunks/d56426def776aae6fac6.js +0 -1
- package/assets/esri/core/workers/chunks/e12882be1b6820b8e9e8.js +0 -1
- package/assets/esri/core/workers/chunks/e648f1c96edf44c781eb.js +0 -1
- package/assets/esri/core/workers/chunks/ef6e9dbfc9a5bd38a7b6.js +0 -1
- package/assets/esri/core/workers/chunks/f2723d0c9c8d8ff4ec70.js +0 -1
- package/assets/esri/core/workers/chunks/f45ef721d21388846101.js +0 -1
- package/assets/esri/core/workers/chunks/fdab6921d007929ab288.js +0 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +0 -5
- /package/chunks/{Bufferer-B-V7yYm-.js → Bufferer-CicaNej1.js} +0 -0
- /package/chunks/{Distance2DCalculator-Coa0qAFt.js → Distance2DCalculator-C1KHhZwD.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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import{executeQueryForSnapping as u}from"../../data/executeQueryForSnapping.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDrawingInfo as m,createDefaultTemplate as h}from"./clientSideDefaults.js";import{loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j,queryBinsCapabilities as E}from"./sourceUtils.js";import _ from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as x,getFieldDefaultValue as R}from"../../../support/fieldUtils.js";import{utc as q}from"../../../../time/
|
|
5
|
+
import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as n,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import{executeQueryForSnapping as u}from"../../data/executeQueryForSnapping.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDrawingInfo as m,createDefaultTemplate as h}from"./clientSideDefaults.js";import{loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j,queryBinsCapabilities as E}from"./sourceUtils.js";import _ from"../../../support/FieldsIndex.js";import{kebabDict as T}from"../../../support/fieldType.js";import{getFieldDefaultLength as x,getFieldDefaultValue as R}from"../../../support/fieldUtils.js";import{utc as q}from"../../../../time/constants.js";const O=s,D={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},w={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryBins:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:E};function Q(e){return i(e)?null!=e.z:!!e.hasZ}function S(e){return i(e)?null!=e.m:!!e.hasM}class v{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,r=this._inferLayerProperties(s,t.fields),n=t.fields||[],a=null!=t.hasM?t.hasM:!!r.hasM,u=null!=t.hasZ?t.hasZ:!!r.hasZ,f=!t.spatialReference&&!r.spatialReference,g=f?O:t.spatialReference||r.spatialReference,I=f?D:null,b=t.geometryType||r.geometryType,F=!b;let j=t.objectIdField||r.objectIdField,E=t.timeInfo;const Q=new _(n);if(!F&&(f&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!j)throw new e("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(r.objectIdField&&j!==r.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${j}" doesn't match the field name "${r.objectIdField}", found in the provided fields`}),j=r.objectIdField),j&&!r.objectIdField){const e=Q.get(j);e?(j=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):n.unshift({alias:j,name:j,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of n){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===j&&(o.type="esriFieldTypeOID"),!T.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=x(o))}const S={};for(const e of n)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=R(e);void 0!==t&&(S[e.name]=t)}if(E){if(E.startTimeField){const e=Q.get(E.startTimeField);e?(E.startTimeField=e.name,e.type="esriFieldTypeDate"):E.startTimeField=null}if(E.endTimeField){const e=Q.get(E.endTimeField);e?(E.endTimeField=e.name,e.type="esriFieldTypeDate"):E.endTimeField=null}if(E.trackIdField){const e=Q.get(E.trackIdField);e?E.trackIdField=e.name:(E.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:E}}))}E.startTimeField||E.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:E}}),E=null)}const v=Q.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??q}:null;this._createDefaultAttributes=y(S,j);const M={warnings:i,featureErrors:[],layerDefinition:{...w,drawingInfo:m(b),templates:h(S),extent:I,geometryType:b,objectIdField:j,fields:n,hasZ:u,hasM:a,timeInfo:E,dateFieldsTimeReference:v},assignedObjectIds:{}};if(this._queryEngine=new c({fieldsIndex:_.fromLayerJSON({fields:n,timeInfo:E,dateFieldsTimeReference:v}),geometryType:b,hasM:a,hasZ:u,objectIdField:j,spatialReference:g,featureStore:new d({geometryType:b,hasM:a,hasZ:u}),timeInfo:E}),!s?.length)return this._nextObjectId=o,M;const A=l(j,s);return this._nextObjectId=A+1,await p(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),p(e.adds,t),p(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return u(this._queryEngine,e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,r,n=null,a=null,o=null;for(const l of e){const e=l.geometry;if(null!=e&&(n||(n=t(e)),a||(a=e.spatialReference),null==s&&(s=Q(e)),null==r&&(r=S(e)),n&&a&&null!=s&&null!=r))break}if(i&&i.length){let e=null;i.some((t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s}))&&(o=e.name)}return{geometryType:n,spatialReference:a,objectIdField:o,hasM:r,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:n,hasZ:a,objectIdField:o,spatialReference:l,featureStore:u,fieldsIndex:d}=this._queryEngine,p=[];for(const r of i){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==t(r.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),n=b(d,i,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(i,r.attributes,!0),r.attributes=i,null!=r.uid&&(e.assignedObjectIds[r.uid]=r.attributes[o]),null!=r.geometry&&(r.geometry=f(r.geometry,r.geometry.spatialReference,l)),p.push(r))}u.addMany(r([],p,s,a,n,o));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),i?.length&&this._applyUpdateEdits(r,i),s?.length){for(const e of s)r.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,i){const{addResults:s}=e,{geometryType:n,hasM:a,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:p}=this._queryEngine,c=[];for(const r of i){if(r.geometry&&n!==t(r.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),a=b(p,i,r.attributes);if(a)s.push(a);else{if(this._assignObjectId(i,r.attributes),r.attributes=i,null!=r.uid){const t=r.attributes[l];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??u;r.geometry=f(j(r.geometry,e),e,u)}c.push(r),s.push(F(r.attributes[l]))}}d.addMany(r([],c,n,o,a,l))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:r,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d,fieldsIndex:p}=this._queryEngine;for(const c of i){const{attributes:i,geometry:y}=c,m=i?.[l];if(null==m){e.push(I(`Identifier field ${l} missing`));continue}if(!d.has(m)){e.push(I(`Feature with object id ${m} missing`));continue}const h=n(d.getFeature(m),s,o,r);if(null!=y){if(s!==t(y)){e.push(I("Incorrect geometry type."));continue}const i=y.spatialReference??u;h.geometry=f(j(y,i),i,u)}if(i){const t=b(p,h.attributes,i);if(t){e.push(t);continue}}d.add(a(h,s,o,r,l)),e.push(F(m))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}export{v 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import R from"../support/RasterFunction.js";import b from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as F,isMultiSliceOrRangeDefinition as v,convertOleDateTimeToEpoch as w,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as P}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as H,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as L,normalizeRendererJSON as k}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as A,websceneRasterRendererTypes as B,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;s.spatialReference.equals(a)||(await T(),n="extent"===s.type?O(s,a):z(s,a));const l=e.pixelSize??new m({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:u,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(u,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,u,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):P(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=F(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=H(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return b.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(v(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(w(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new m({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new m({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,u=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<u;e++){const r=new m({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=F(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??L(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=k({...this.renderer.toJSON(),variableName:s}),a=H(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=L(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",R.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:R})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:b})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([u("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import R from"../support/RasterFunction.js";import b from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as F,isMultiSliceOrRangeDefinition as w,convertOleDateTimeToEpoch as v,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as L,normalizeRendererJSON as k}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as A,websceneRasterRendererTypes as B,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;s.spatialReference.equals(a)||(await T(),n="extent"===s.type?O(s,a):z(s,a));const l=e.pixelSize??new m({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:u,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(u,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,u,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=F(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return b.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(w(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(v(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new m({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new m({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,u=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<u;e++){const r=new m({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=F(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??L(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=k({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=L(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",R.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:R})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:b})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([u("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../request.js";import t from"../../core/Error.js";import n from"../../core/Logger.js";import{makeAbsolute as i,addQueryParameters as r,urlToObject as o}from"../../core/urlUtils.js";import s from"../../geometry/SpatialReference.js";import{wgs84 as a}from"../../geometry/support/spatialReferenceUtils.js";import{project as l}from"../../geometry/support/webMercatorUtils.js";import{convertToFeatureSet as c,convertToGeometry as u,convertFromGeometry as d}from"../graphics/featureConversionUtils.js";import f from"../graphics/OptimizedFeatureSet.js";import{validateGeoJSON as m,inferLayerProperties as p,createOptimizedFeatures as g}from"../graphics/sources/geojson/geojson.js";import{createDrawingInfo as y}from"../graphics/sources/support/clientSideDefaults.js";import{mixAttributes as w}from"../graphics/sources/support/sourceUtils.js";import j from"../support/FieldsIndex.js";import{kebabDict as b}from"../support/fieldType.js";import{utc as h}from"../../time/
|
|
5
|
+
import e from"../../request.js";import t from"../../core/Error.js";import n from"../../core/Logger.js";import{makeAbsolute as i,addQueryParameters as r,urlToObject as o}from"../../core/urlUtils.js";import s from"../../geometry/SpatialReference.js";import{wgs84 as a}from"../../geometry/support/spatialReferenceUtils.js";import{project as l}from"../../geometry/support/webMercatorUtils.js";import{convertToFeatureSet as c,convertToGeometry as u,convertFromGeometry as d}from"../graphics/featureConversionUtils.js";import f from"../graphics/OptimizedFeatureSet.js";import{validateGeoJSON as m,inferLayerProperties as p,createOptimizedFeatures as g}from"../graphics/sources/geojson/geojson.js";import{createDrawingInfo as y}from"../graphics/sources/support/clientSideDefaults.js";import{mixAttributes as w}from"../graphics/sources/support/sourceUtils.js";import j from"../support/FieldsIndex.js";import{kebabDict as b}from"../support/fieldType.js";import{utc as h}from"../../time/constants.js";const F=()=>n.getLogger("esri.layers.ogc.ogcFeatureUtils"),I="startindex",T=new Set([I,"offset"]),k="http://www.opengis.net/def/crs/",x=`${k}OGC/1.3/CRS84`;var S;async function v(n,o,s={},a=5){const{links:l}=n,c=U(l,"items",S.geojson)||U(l,"http://www.opengis.net/def/rel/ogc/1.0/items",S.geojson);if(null==c)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:f}=s,g=i(c.href,n.landingPage.url),w={limit:a,...d,token:u},T=r(g,w),k={accept:S.geojson},{data:x}=await e(T,{signal:f,headers:k}),v=A(T,a,x.links)??I;m(x);const N=p(x,{geometryType:o.geometryType}),O=o.fields||N.fields||[],P=null!=o.hasZ?o.hasZ:N.hasZ,q=N.geometryType,C=o.objectIdField||N.objectIdFieldName||"OBJECTID";let R=o.timeInfo;const $=O.find((({name:e})=>e===C));if($)$.editable=!1,$.nullable=!1;else{if(!N.objectIdFieldType)throw new t("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");O.unshift({name:C,alias:C,type:"number"===N.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(C!==N.objectIdFieldName){const e=O.find((({name:e})=>e===N.objectIdFieldName));e&&(e.type="esriFieldTypeInteger")}O===N.fields&&N.unknownFields.length>0&&F().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:N.unknownFields}});for(const e of O){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new t("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!b.jsonValues.includes(e.type))throw new t("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(R){const e=new j(O);if(R.startTimeField){const t=e.get(R.startTimeField);t?(R.startTimeField=t.name,t.type="esriFieldTypeDate"):R.startTimeField=null}if(R.endTimeField){const t=e.get(R.endTimeField);t?(R.endTimeField=t.name,t.type="esriFieldTypeDate"):R.endTimeField=null}if(R.trackIdField){const t=e.get(R.trackIdField);t?R.trackIdField=t.name:(R.trackIdField=null,F().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:R}}))}R.timeReference||={timeZoneIANA:h},R.startTimeField||R.endTimeField||(F().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:R}}),R=void 0)}return{drawingInfo:q?y(q):null,extent:L(n),geometryType:q,fields:O,hasZ:!!P,objectIdField:C,paginationParameter:v,timeInfo:R}}async function N(n,r={}){const{links:o,url:s}=n,a=U(o,"data",S.json)||U(o,"http://www.opengis.net/def/rel/ogc/1.0/data",S.json);if(null==a)throw new t("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(a.href,s),{data:f}=await e(d,{signal:u,headers:{accept:S.json},query:{...c,token:l}});for(const e of f.collections)e.landingPage=n;return f}async function O(n,r={}){const{links:o,url:s}=n,a=U(o,"conformance",S.json)||U(o,"http://www.opengis.net/def/rel/ogc/1.0/conformance",S.json);if(null==a)throw new t("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(a.href,s),{data:f}=await e(d,{signal:u,headers:{accept:S.json},query:{...c,token:l}});return f}async function P(t,n={}){const{apiKey:i,customParameters:r,signal:o}=n,{data:s}=await e(t,{signal:o,headers:{accept:S.json},query:{...r,token:i}});return s.url=t,s}async function q(t,n={}){const{links:r,url:o}=t,s=U(r,"service-desc",S.openapi);if(null==s)return F().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:l,signal:c}=n,u=i(s.href,o),{data:d}=await e(u,{signal:c,headers:{accept:S.openapi},query:{...l,token:a}});return d}function C(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:r}=n;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return s.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return s.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(r,10);return Number.isNaN(e)?null:e}default:return null}}async function R(e,t,n){const i=await $(e,t,n);return c(i)}async function $(n,r,o){const{collection:{links:c,landingPage:{url:m}},layerDefinition:p,maxRecordCount:y,queryParameters:{apiKey:b,customParameters:h},spatialReference:F,supportedCrs:I}=n,T=U(c,"items",S.geojson)||U(c,"http://www.opengis.net/def/rel/ogc/1.0/items",S.geojson);if(null==T)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:k,num:x,start:v,timeExtent:N,where:O}=r;if(r.objectIds)throw new t("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const P=s.fromJSON(F),q=r.outSpatialReference??P,C=q.isWGS84?null:W(q,I),R=K(k,I),$=M(N),G=Z(O),D=x??(null==v?y:10),L=0===v?void 0:v,{fields:A,geometryType:J,hasZ:z,objectIdField:E,paginationParameter:_}=p,B=i(T.href,m),{data:Q}=await e(B,{...o,query:{...h,...R,crs:C,datetime:$,query:G,limit:D,[_]:L,token:b},headers:{accept:S.geojson}}),V=g(Q,{geometryType:J,hasZ:z,objectIdField:E}),H=V.length===D&&!!U(Q.links??[],"next",S.geojson),X=new j(A);for(const e of V){const t={};w(X,t,e.attributes,!0);for(const e of X.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[E]=e.attributes[E],e.attributes=t}if(!C&&q.isWebMercator)for(const e of V)if(null!=e.geometry&&null!=J){const t=u(e.geometry,J,z,!1);t.spatialReference=s.WGS84,e.geometry=d(l(t,q))}for(const e of V)e.objectId=e.attributes[E];const Y=C||!C&&q.isWebMercator?q.toJSON():a,ee=new f;return ee.exceededTransferLimit=H,ee.features=V,ee.fields=A,ee.geometryType=J,ee.hasZ=z,ee.objectIdFieldName=E,ee.spatialReference=Y,ee}function G(e){return null!=e&&"extent"===e.type}function W(e,t){const{isWebMercator:n,wkid:i}=e;if(!i)return null;const r=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return r?`${k}${r}`:null}function D(e){if(null==e)return"";const{xmin:t,ymin:n,xmax:i,ymax:r}=e;return`${t},${n},${i},${r}`}function M(e){if(null==e)return null;const{start:t,end:n}=e;return`${null!=t?t.toISOString():".."}/${null!=n?n.toISOString():".."}`}function Z(e){return null!=e&&e&&"1=1"!==e?e:null}function K(e,t){if(!G(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:D(e)};const i=W(n,t);return null!=i?{bbox:D(e),"bbox-crs":i}:n.isWebMercator?{bbox:D(l(e,s.WGS84))}:null}function L(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=4===n.length,[r,o]=n,a=i?void 0:n[2];return{xmin:r,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:a,zmax:i?void 0:n[5],spatialReference:s.WGS84.toJSON()}}function U(e,t,n){return e.find((({rel:e,type:i})=>e===t&&i===n))??e.find((({rel:e,type:n})=>e===t&&!n))}function A(e,t,n){if(!n)return;const i=U(n,"next",S.geojson),r=o(i?.href)?.query;if(!r)return;const s=o(e).query,a=Object.keys(s??{}),l=Object.entries(r).filter((([e])=>!a.includes(e))).find((([e,n])=>T.has(e.toLowerCase())&&Number.parseInt(n,10)===t)),c=l?.[0];return c}!function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"}(S||(S={}));export{x as crsDefault,k as crsPrefix,v as getCollectionDefinition,N as getServerCollections,O as getServerConformance,P as getServerLandingPage,q as getServerOpenApi,C as getSpatialReferenceWkid,R as queryFeatureSetJSON,$ as queryOptimizedFeatureSet};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import i from"../../core/JSONSupport.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{UnknownTimeZone as n}from"../../core/sql/UnknownTimeZone.js";import{isDateField as r,isNumericField as l,isObjectIDField as o,isGlobalIDField as d,getFieldDefaultValue as a,isTimeOnlyField as m,normalizeFieldName as u}from"./fieldUtils.js";import{utc as f,unknown as F
|
|
5
|
+
import e from"../../core/Error.js";import i from"../../core/JSONSupport.js";import t from"../../core/Logger.js";import{getOrCreateMapValue as s}from"../../core/MapUtils.js";import{UnknownTimeZone as n}from"../../core/sql/UnknownTimeZone.js";import{isDateField as r,isNumericField as l,isObjectIDField as o,isGlobalIDField as d,getFieldDefaultValue as a,isTimeOnlyField as m,normalizeFieldName as u}from"./fieldUtils.js";import{utc as f,unknown as F}from"../../time/constants.js";import{fromTimeReference as h}from"../../time/timeZoneUtils.js";import{FixedOffsetZone as c,IANAZone as p}from"luxon";function y(e){return"timeZone"in e}function _(e){return"timeZone"in e}function g(e){return"dateFieldsTimeZone"in e}const T=new Map;class Z{static fromJSON(e){return new Z(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new Z(e.fields??[],S(e))}static fromLayerJSON(e){return new Z(e.fields??[],S(e))}constructor(e=[],i){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=i?new Map(i):null;const t=[];for(const s of this.fields){const e=s?.name,i=M(e);if(e&&i){const n=w(e);this._fieldsMap.set(e,s),this._fieldsMap.set(n,s),this._normalizedFieldsMap.set(i,s),t.push(`${n}:${s.type}:${this._timeZoneByFieldName?.get(e)}`),r(s)?(this.dateFields.push(s),this._dateFieldsSet.add(s)):l(s)&&(this._numericFieldsSet.add(s),this.numericFields.push(s)),o(s)||d(s)||(s.editable=null==s.editable||!!s.editable,s.nullable=null==s.nullable||!!s.nullable)}}t.sort(),this.uid=t.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)o(e)||d(e)||e.nullable||void 0!==a(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(w(e))??this._normalizedFieldsMap.get(M(e)),i&&this._fieldsMap.set(e,i),i)}getTimeZone(i){const s=this.get(i&&"string"!=typeof i?i.name:i);return s?this._timeZoneByFieldName?this._timeZoneByFieldName.get(s.name):"date"===s.type||"esriFieldTypeDate"===s.type?(t.getLogger("esri.layers.support.FieldsIndex").errorOnce(new e("getTimeZone:no-timezone-information",`no time zone information for field '${s.name}'`)),f):N.has(s.type)?F:null:null}getLuxonTimeZone(e){const i=this.getTimeZone(e);return i?i===F?n.instance:i===f?c.utcInstance:s(T,i,(()=>p.create(i))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return m(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>i.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function w(e){return e.trim().toLowerCase()}function M(e){return u(e)?.toLowerCase()??""}const N=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function S(e){const i=new Map;if(!e.fields)return i;const t=!0===e.datesInUnknownTimezone,{timeInfo:s,editFieldsInfo:n}=e,r=(s?"startField"in s?s.startField:s.startTimeField:"")??"",l=(s?"endField"in s?s.endField:s.endTimeField:"")??"",o=g(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?h(e.dateFieldsTimeReference):null,d=n?y(n)?n.timeZone??o:n.dateFieldsTimeReference?h(n.dateFieldsTimeReference):o??f:null,a=s?_(s)?s.timeZone??o:s.timeReference?h(s.timeReference):o:null,m=new Map([[w(n?.creationDateField??""),d],[w(n?.editDateField??""),d],[w(r),a],[w(l),a]]);for(const{name:u,type:f}of e.fields)if(N.has(f))i.set(u,F);else if("date"!==f&&"esriFieldTypeDate"!==f)i.set(u,null);else if(t)i.set(u,F);else{const e=m.get(w(u??""))??o;i.set(u,e)}return i}export{Z 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as r,lookupPixels as i,lookupBandValues as l,remap as p}from"./pixelUtils.js";import
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as r,lookupPixels as i,lookupBandValues as l,remap as p,createRangeMaps as c}from"./pixelUtils.js";import m from"./RemapFunctionArguments.js";let g=class extends a{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,outputValues:o,inputRanges:a,noDataRanges:i,isLastInputRangeInclusive:l}=this.functionArguments;if(null!=s&&s.length&&o?.length)if(n){const e=Math.min.apply(null,[...o,s[0].min]),n=Math.max.apply(null,[...o,s[0].max]);t.statistics=[{...s[0],min:e,max:n}]}else{let e=o[0],n=e;for(let t=0;t<o.length;t++)e=e>o[t]?o[t]:e,n=n>o[t]?n:o[t];t.statistics=[{...s[0],min:e,max:n}]}this.rasterInfo=t,this.lookup=n?null:u({srcPixelType:e,inputRanges:a,outputValues:o,noDataRanges:i,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType});return{success:!0,supportsGPU:(!o||o.length<=r)&&(!i||i.length<=r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=i(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=l(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:o,outputValues:a,noDataRanges:u,allowUnmatched:r,isLastInputRangeInclusive:c,replacementValue:m}=this.functionArguments;return p(e,{inputRanges:o,outputValues:a,noDataRanges:u,outputPixelType:n,allowUnmatched:r,isLastInputRangeInclusive:c,replacementValue:m})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:s,isLastInputRangeInclusive:n}=this.functionArguments,a=this.functionArguments.inputRanges??[],u=this.functionArguments.outputValues??[],i=c(a,u,n),l=new Float32Array(2*r);l.fill(e),s?.length&&l.set(s);return{allowUnmatched:t,rangeMaps:i,noDataRanges:l,clampRange:o(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};t([s({json:{write:!0,name:"rasterFunction"}})],g.prototype,"functionName",void 0),t([s({type:m,json:{write:!0,name:"rasterFunctionArguments"}})],g.prototype,"functionArguments",void 0),t([s()],g.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],g.prototype,"lookup",void 0),g=t([n("esri.layers.support.rasterFunctions.RemapFunction")],g);const h=g;export{h 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/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../PixelBlock.js";import{getPixelValueRange as e}from"../rasterFormats/pixelRangeUtils.js";var n,l;!function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"}(n||(n={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(l||(l={}));const i=9;function o(t){return null!=t&&"esri.layers.support.PixelBlock"===t.declaredClass&&t.pixels&&t.pixels.length>0}function s(t,e){return e?.length&&o(t)?t.extractBands(e):t}function r(e){if(!e?.length||e.some((t=>!o(t))))return null;if(1===e.length)return e[0]?.clone()??null;const n=e,{width:l,height:i,pixelType:s}=n[0];if(n.some((t=>t.width!==l||t.height!==i)))return null;const r=n.map((({mask:t})=>t)).filter((t=>null!=t));let a=null;r.length&&(a=new Uint8Array(l*i),a.set(r[0]),r.length>1&&m(r.slice(1),a));const h=[];n.forEach((({pixels:t})=>h.push(...t)));const f=n.map((({statistics:t})=>t)).filter((t=>t?.length)),c=[];return f.forEach((t=>c.push(...t))),new t({pixelType:s,width:l,height:i,mask:a,pixels:h,statistics:c.length?c:null})}function a(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort(((t,e)=>t[0]-e[0]));let l=0;n[0][0]<0&&(l=n[0][0]);const i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),s=[];let r,a=0,h=0;const f=5===n[0].length;if(i>65536)return n.forEach((t=>{s[t[0]-l]=f?t.slice(1):t.slice(1).concat([255])})),{indexed2DColormap:s,offset:l,alphaSpecified:f};if(t.fillUnspecified)for(r=n[h],a=r[0]-l;a<i;a++)o[4*a]=r[1],o[4*a+1]=r[2],o[4*a+2]=r[3],o[4*a+3]=f?r[4]:255,a===r[0]-l&&(r=h===n.length-1?r:n[++h]);else for(a=0;a<n.length;a++)r=n[a],h=4*(r[0]-l),o[h]=r[1],o[h+1]=r[2],o[h+2]=r[3],o[h+3]=f?r[4]:255;return{indexedColormap:o,offset:l,alphaSpecified:f}}function h(t,e){if(!o(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const s=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:r,indexed2DColormap:a,offset:h,alphaSpecified:f}=e;let c=0;const u=l[0],p=new Uint8Array(u.length),x=new Uint8Array(u.length),d=new Uint8Array(u.length);let m,g=0;if(r){const t=r.length-1;if(null!=i)for(c=0;c<s;c++)i[c]&&(g=4*(u[c]-h),g<h||g>t?i[c]=0:(p[c]=r[g],x[c]=r[g+1],d[c]=r[g+2],i[c]=r[g+3]));else{for(i=new Uint8Array(s),c=0;c<s;c++)g=4*(u[c]-h),g<h||g>t?i[c]=0:(p[c]=r[g],x[c]=r[g+1],d[c]=r[g+2],i[c]=r[g+3]);n.mask=i}}else if(a)if(null!=i)for(c=0;c<s;c++)i[c]&&(m=a[u[c]],p[c]=m[0],x[c]=m[1],d[c]=m[2],i[c]=m[3]);else{for(i=new Uint8Array(s),c=0;c<s;c++)m=a[u[c]],p[c]=m[0],x[c]=m[1],d[c]=m[2],i[c]=m[3];n.mask=i}return n.pixels=[p,x,d],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function f(e,n){if(!o(e))return null;const{pixels:l,mask:i}=e,s=l.length;let r=n.lut;const{offset:a}=n;r&&1===r[0].length&&(r=l.map((()=>r)));const h=[],f=n.outputPixelType||"u8";for(let t=0;t<s;t++){const e=c(l[t],i,r[t],a||0,f);h.push(e)}const u=new t({width:e.width,height:e.height,pixels:h,mask:i,pixelType:f});return u.updateStatistics(),u}function c(e,n,l,i,o){const s=e.length,r=t.createEmptyBand(o,s);if(n)for(let t=0;t<s;t++)n[t]&&(r[t]=l[e[t]-i]);else for(let t=0;t<s;t++)r[t]=l[e[t]-i];return r}function u(t,e){if(!o(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,s=e.length,r=Math.floor(s/2),a=e[Math.floor(r)],h=l[0];let f,c,u,p,x,d,m=!1;const g=new Uint8Array(i),y=new Uint8Array(i),w=new Uint8Array(i);let k=n.mask;const M=4===e[0].mappedColor.length;for(k||(k=new Uint8Array(i),k.fill(M?255:1),n.mask=k),x=0;x<i;x++)if(k[x]){for(f=h[x],m=!1,d=r,c=a,u=0,p=s-1;p-u>1;){if(f===c.value){m=!0;break}f>c.value?u=d:p=d,d=Math.floor((u+p)/2),c=e[Math.floor(d)]}m||(f===e[u].value?(c=e[u],m=!0):f===e[p].value?(c=e[p],m=!0):f<e[u].value?(m=!1,c=null):f>e[u].value&&(f<e[p].value?(c=e[u],m=!0):p===s-1?(m=!1,c=null):(c=e[p],m=!0))),m?(g[x]=c.mappedColor[0],y[x]=c.mappedColor[1],w[x]=c.mappedColor[2],k[x]=c.mappedColor[3]):g[x]=y[x]=w[x]=k[x]=0}return n.pixels=[g,y,w],n.mask=k,n.pixelType="u8",n.maskIsAlpha=M,n}function p(n,l){if(!o(n))return null;const{width:i,height:s}=n,{inputRanges:r,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=n.pixels[0],d=t.createEmptyBand(h,x.length),m=n.mask,g=new Uint8Array(i*s);m?g.set(m):g.fill(255);const y=n.pixelType.startsWith("f")?1e-6:0,w=r.map((t=>t-y));w[0]=r[0],w[w.length-1]=r[r.length-1]+(p?1e-6:0);const k=r.length/2,[M,A]=e(h);for(let t=0;t<s;t++)for(let e=0;e<i;e++){const n=t*i+e;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===w[2*l]||t>w[2*l]&&t<w[2*l+1]){d[n]=a[l],e=!0;break}e||(c?d[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let t=0;t<s;t++)for(let e=0;e<i;e++){const n=t*i+e;if(!m||m[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){d[n]=0,g[n]=0;break}}}return new t({width:i,height:s,pixelType:h,pixels:[d],mask:g})}function x(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,s=!!e?.length;for(let r=0;r<t.length;r++)if(l[r]){const n=t[r];if(s){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[r]=0)}l[r]&&(n===o||i?.has(n))&&(l[r]=0)}}function d(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}}function m(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}}function g(e,n){if(!o(e))return null;const{width:l,height:i,pixels:s}=e,r=l*i,a=new Uint8Array(r);e.mask?a.set(e.mask):a.fill(255);const h=s.length,{includedRanges:f,noDataValues:u,outputPixelType:p,matchAll:g,lookups:y}=n;if(y){const t=[];for(let e=0;e<h;e++){const n=y[e],l=c(s[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):g?d(t,a):m(t,a)}else if(g){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(r);n.set(a),x(s[e],f?.slice(2*e,2*e+2),u?.[e],n),t.push(n)}1===t.length?a.set(t[0]):d(t,a)}else for(let t=0;t<h;t++)x(s[t],f?.slice(2*t,2*t+2),u?.[t],a);return new t({width:l,height:i,pixelType:p,pixels:s,mask:a})}function y(n){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:s,noDataRanges:r,isLastInputRangeInclusive:a,outputPixelType:h}=n;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=t.createEmptyBand(h,f),p=new Uint8Array(f);s&&p.fill(255);const[x,d]=e(h);if(i?.length&&o?.length){const t=1e-6,e=i.map((e=>e-t));e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>d?d:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),i=Math.floor(e[2*n+1]-c);for(let e=l;e<=i;e++)u[e]=t,p[e]=255}}if(r?.length)for(let t=0;t<r.length;t++){const e=Math.ceil(r[2*t]-c),n=Math.floor(r[2*t+1]-c);for(let t=e;t<=n;t++)p[t]=0}return{lut:u,offset:c,mask:p}}function w(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let s=0;s<e.length;s++){const t=Math.ceil(e[2*s]-i),n=Math.floor(e[2*s+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let s=0;s<n.length;s++)o[n[s]-i]=0;return{lut:o,offset:i}}function k(t,e,n,l,i,o,s,r){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+s<=n*t?0:i+s<n*t+t?i+s-n*t:t,ymax:o+r<=l*e?0:o+r<l*e+e?o+r-l*e:e}}function M(t,e){if(!t||0===t.length)return null;const n=t.find((t=>t.pixelBlock));if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),s=t.sort(((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0)),r=Math.min.apply(null,s.map((t=>t.extent.xmin))),a=Math.min.apply(null,s.map((t=>t.extent.ymin))),h=Math.max.apply(null,s.map((t=>t.extent.xmax))),f=Math.max.apply(null,s.map((t=>t.extent.ymax))),c={x:Math.round((e.xmin-r)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-r)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==s.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:U(s.map((t=>t.pixelBlock)),u,{clipOffset:c,clipSize:p})}}function A(t,e,n,l,i,o){const{width:s,height:r}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=k(s,r,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=s*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let d=u.ymin;d<u.ymax;d++){const n=(i*r+d-h)*f+(l*s-a)+p,o=d*s;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let d=u.ymin;d<u.ymax;d++){const n=(i*r+d-h)*f+(l*s-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function U(e,n,l={}){const{clipOffset:i,clipSize:s,alignmentInfo:r,blockWidths:a}=l;if(a)return b(e,n,{blockWidths:a});const h=e.find((t=>o(t)));if(null==h)return null;const f=s?s.width:n.width,c=s?s.height:n.height,u=h.width,p=h.height,x=n.width/u,d=n.height/p,m={offset:i||{x:0,y:0},mosaic:s||n,block:{width:u,height:p}},g=h.pixelType,y=t.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,U;for(let t=0;t<w;t++){U=new y(f*c);for(let n=0;n<d;n++)for(let l=0;l<x;l++){const i=e[n*x+l];o(i)&&(M=i.pixels[t],A(U,M,m,l,n,r))}k.push(U)}const T=e.some((t=>null==t||null!=t.mask&&t.mask.length>0)),v=e.some((t=>t?.bandMasks&&t.bandMasks.length>1)),B=T?new Uint8Array(f*c):void 0,C=v?[]:void 0;if(B){for(let t=0;t<d;t++)for(let n=0;n<x;n++){const l=e[t*x+n],i=null!=l?l.mask:null;A(B,null!=i?i:l?255:0,m,n,t,r)}if(C)for(let t=0;t<w;t++){const n=new Uint8Array(f*c);for(let l=0;l<d;l++)for(let i=0;i<x;i++){const o=e[l*x+i],s=o?.bandMasks?.[t]??o?.mask;A(n,null!=s?s:o?255:0,m,i,l,r)}C.push(n)}}const S=new t({width:f,height:c,pixels:k,pixelType:g,bandMasks:C,mask:B});return S.updateStatistics(),S}function b(e,n,l){const i=e.find((t=>null!=t));if(null==i)return null;const s=e.some((t=>null==t||!!t.mask)),{width:r,height:a}=n,h=s?new Uint8Array(r*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=t.getPixelArrayConstructor(i.pixelType);if(s)for(let t=0,y=0;t<e.length;y+=f[t],t++){const n=e[t];if(!o(n))continue;const l=n.mask;for(let e=0;e<a;e++)for(let i=0;i<f[t];i++)h[e*r+i+y]=null==l?255:l[e*n.width+i]}const x=e.some((t=>t?.bandMasks&&t.bandMasks.length>1)),d=x?[]:void 0,m=r*a;for(let t=0;t<u;t++){const n=new p(m),l=x?new Uint8Array(m):void 0;for(let i=0,s=0;i<e.length;s+=f[i],i++){const h=e[i];if(!o(h))continue;const c=h.pixels[t];if(null!=c){for(let t=0;t<a;t++)for(let e=0;e<f[i];e++)n[t*r+e+s]=c[t*h.width+e];if(l){const e=h.bandMasks?.[t]??h.mask;for(let t=0;t<a;t++)for(let n=0;n<f[i];n++)l[t*r+n+s]=e?e[t*h.width+n]:255}}}c.push(n),d&&l&&d.push(l)}const g=new t({width:r,height:a,mask:h,bandMasks:d,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function T(t,e,n){if(!o(t))return null;const{width:l,height:i}=t,s=e.x,r=e.y,a=n.width+s,h=n.height+r;if(s<0||r<0||a>l||h>i)return t;if(0===s&&0===r&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let o=0;o<i;o++){const t=o*l;for(let e=0;e<l;e++)f[t+e]=o<r||o>=h||e<s||e>=a?0:1}return t.updateStatistics(),t}function v(t){if(!o(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,s=i[0],r=e.pixels[0],a=t.mask;for(let o=2;o<l-1;o++){const t=new Map;for(let l=o-2;l<o+2;l++)for(let e=0;e<4;e++){const i=l*n+e;S(t,s[i],a?a[i]:1)}r[o*n]=B(t),r[o*n+1]=r[o*n+2]=r[o*n];let e=3;for(;e<n-1;e++){let l=(o-2)*n+e+1;S(t,s[l],a?a[l]:1),l=(o-1)*n+e+1,S(t,s[l],a?a[l]:1),l=o*n+e+1,S(t,s[l],a?a[l]:1),l=(o+1)*n+e+1,S(t,s[l],a?a[l]:1),l=(o-2)*n+e-3,C(t,s[l],a?a[l]:1),l=(o-1)*n+e-3,C(t,s[l],a?a[l]:1),l=o*n+e-3,C(t,s[l],a?a[l]:1),l=(o+1)*n+e-3,C(t,s[l],a?a[l]:1),r[o*n+e]=B(t)}r[o*n+e+1]=r[o*n+e]}for(let o=0;o<n;o++)r[o]=r[n+o]=r[2*n+o],r[(l-1)*n+o]=r[(l-2)*n+o];return e.updateStatistics(),e}function B(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function C(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function S(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function P(e,n,l){let{x:i,y:s}=n;const{width:r,height:a}=l;if(0===i&&0===s&&a===e.height&&r===e.width)return e;const{width:h,height:f}=e,c=Math.max(0,s),u=Math.max(0,i),p=Math.min(i+r,h),x=Math.min(s+a,f);if(p<0||x<0||!o(e))return null;i=Math.max(0,-i),s=Math.max(0,-s);const{pixels:d}=e,m=r*a,g=d.length,y=[];for(let o=0;o<g;o++){const n=d[o],l=t.createEmptyBand(e.pixelType,m);for(let t=c;t<x;t++){const e=t*h;let o=(t+s-c)*r+i;for(let t=u;t<p;t++)l[o++]=n[e+t]}y.push(l)}const w=new Uint8Array(m),k=e.mask;for(let t=c;t<x;t++){const e=t*h;let n=(t+s-c)*r+i;for(let t=u;t<p;t++)w[n++]=k?k[e+t]:1}const M=new t({width:l.width,height:l.height,pixelType:e.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function _(e,n=!0){if(!o(e))return null;const{pixels:l,width:i,height:s,mask:r,pixelType:a}=e,h=[],f=Math.round(i/2),c=Math.round(s/2),u=s-1,p=i-1;for(let o=0;o<l.length;o++){const e=l[o],r=t.createEmptyBand(a,f*c);let x=0;for(let t=0;t<s;t+=2)for(let l=0;l<i;l+=2){const o=e[t*i+l];if(n){const n=l===p?o:e[t*i+l+1],s=t===u?o:e[t*i+l+i],a=l===p?s:t===u?n:e[t*i+l+i+1];r[x++]=(o+n+s+a)/4}else r[x++]=o}h.push(r)}let x=null;if(null!=r){x=new Uint8Array(f*c);let t=0;for(let e=0;e<s;e+=2)for(let l=0;l<i;l+=2){const o=r[e*i+l];if(n){const n=l===p?o:r[e*i+l+1],s=e===u?o:r[e*i+l+i],a=l===p?s:e===u?n:r[e*i+l+i+1];x[t++]=o*n*s*a?1:0}else x[t++]=o}}return new t({width:f,height:c,pixelType:a,pixels:h,mask:x})}function W(t,e,n=0,l=!0){if(!o(t))return null;const{width:i,height:s}=e;let{width:r,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let o=0;o<c;o++){const t=Math.ceil(r/i),n=Math.ceil(a/s);for(let l=0;l<n;l++){f.y=l*s;for(let n=0;n<t;n++){f.x=n*i;const t=P(u,f,e);h.set(`${o}/${l}/${n}`,t)}}o<c-1&&(u=_(u,l)),r=Math.round(r/2),a=Math.round(a/2)}return h}function E(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:s,useBilinear:r}=t;if(!o(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=P(e,{y:i*u,x:s*c},{width:c,height:u});if(!p)return null;for(let o=l;o>0;o--)p=_(p,r);return p}function I(t,e,n,l,i=0){const{width:o,height:s}=t,{width:r,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(r/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,d,m,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let v,B,C=0;for(let S=0;S<u;S++)for(let t=0;t<c;t++){p=12*(S*c+t),x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){C=(S*f+e)*k+t*h,B=(e+.5)/f;for(let t=0;t<e;t++)v=(t+.5)/h,A[C+t]=(x*v+d*B+m)*o+i,U[C+t]=(g*v+y*B+w)*s+i,b[C+t]=Math.floor(A[C+t]),T[C+t]=Math.floor(U[C+t])}p+=6,x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){C=(S*f+e)*k+t*h,B=(e+.5)/f;for(let t=e;t<h;t++)v=(t+.5)/h,A[C+t]=(x*v+d*B+m)*o+i,U[C+t]=(g*v+y*B+w)*s+i,b[C+t]=Math.floor(A[C+t]),T[C+t]=Math.floor(U[C+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function R(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:s}=I(t,t,n,{rows:l[0],cols:l[1]}),{width:r,height:a}=t,h=new Float32Array(r*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<r;t++){const e=c*s+t,n=0===c?e:e-s,l=c===a-1?e:e+s,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*r+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*r+t]=e}}return h}function D(e,n,l,i,s="nearest"){if(!o(e))return null;"majority"===s&&(e=v(e));const{pixels:r,mask:a,bandMasks:h,pixelType:f}=e,c=e.width,u=e.height,p=t.getPixelArrayConstructor(f),x=r.length,{width:d,height:m}=n;let g=!1;for(let t=0;t<l.length;t+=3)-1===l[t]&&-1===l[t+1]&&-1===l[t+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=I({width:c,height:u},n,l,i,"majority"===s?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<m;o++){U=o*A;for(let s=0;s<d;s++){if(y[U]<0||w[U]<0)t[o*d+s]=0;else if(l)t[o*d+s]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),r=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-r;if(!n||n[l+r*c]&&n[a+r*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+r*c]+f*e[a+r*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*d+s]=(1-u)*n+u*p+i}else t[o*d+s]=e[k[U]+M[U]*c]}U++}}},T=[];let B;const C=h?.length===x,S=[];for(let t=0;t<x;t++){if(C){const e=new Uint8Array(d*m);b(e,h[t],h[t],!0),S.push(e)}B=new p(d*m),b(B,r[t],C?h[t]:a,"nearest"===s||"majority"===s),T.push(B)}const P=new t({width:d,height:m,pixelType:f,pixels:T,bandMasks:C?S:void 0});if(null!=a)P.mask=new Uint8Array(d*m),b(P.mask,a,a,!0);else if(g){P.mask=new Uint8Array(d*m);for(let t=0;t<d*m;t++)P.mask[t]=y[t]<0||w[t]<0?0:1}return P.updateStatistics(),P}export{l as MissingBandAction,n as NoDataInterpretation,D as approximateTransform,P as clip,E as clipTile,h as colorize,r as compositeBands,a as createColormapLUT,w as createMaskLUT,y as createRemapLUT,s as extractBands,k as getClipBounds,R as getLocalArithmeticNorthRotations,I as interpolateOffsets,o as isValidPixelBlock,c as lookupBandValues,f as lookupPixels,g as mask,i as maxMapSizeGpu,U as mosaic,M as mosaicPixelData,p as remap,u as remapColor,v as resampleByMajority,T as setValidBoundary,W as split};
|
|
5
|
+
import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import e from"../PixelBlock.js";import{getPixelValueRange as n}from"../rasterFormats/pixelRangeUtils.js";var l,i;!function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"}(l||(l={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(i||(i={}));const o=9;function r(t){return null!=t&&"esri.layers.support.PixelBlock"===t.declaredClass&&t.pixels&&t.pixels.length>0}function s(t,e){return e?.length&&r(t)?t.extractBands(e):t}function a(t){if(!t?.length||t.some((t=>!r(t))))return null;if(1===t.length)return t[0]?.clone()??null;const n=t,{width:l,height:i,pixelType:o}=n[0];if(n.some((t=>t.width!==l||t.height!==i)))return null;const s=n.map((({mask:t})=>t)).filter((t=>null!=t));let a=null;s.length&&(a=new Uint8Array(l*i),a.set(s[0]),s.length>1&&y(s.slice(1),a));const h=[];n.forEach((({pixels:t})=>h.push(...t)));const f=n.map((({statistics:t})=>t)).filter((t=>t?.length)),c=[];return f.forEach((t=>c.push(...t))),new e({pixelType:o,width:l,height:i,mask:a,pixels:h,statistics:c.length?c:null})}function h(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort(((t,e)=>t[0]-e[0]));let l=0;n[0][0]<0&&(l=n[0][0]);const i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),r=[];let s,a=0,h=0;const f=5===n[0].length;if(i>65536)return n.forEach((t=>{r[t[0]-l]=f?t.slice(1):t.slice(1).concat([255])})),{indexed2DColormap:r,offset:l,alphaSpecified:f};if(t.fillUnspecified)for(s=n[h],a=s[0]-l;a<i;a++)o[4*a]=s[1],o[4*a+1]=s[2],o[4*a+2]=s[3],o[4*a+3]=f?s[4]:255,a===s[0]-l&&(s=h===n.length-1?s:n[++h]);else for(a=0;a<n.length;a++)s=n[a],h=4*(s[0]-l),o[h]=s[1],o[h+1]=s[2],o[h+2]=s[3],o[h+3]=f?s[4]:255;return{indexedColormap:o,offset:l,alphaSpecified:f}}function f(t,e){if(!r(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const o=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:h,alphaSpecified:f}=e;let c=0;const u=l[0],p=new Uint8Array(u.length),x=new Uint8Array(u.length),m=new Uint8Array(u.length);let d,g=0;if(s){const t=s.length-1;if(null!=i)for(c=0;c<o;c++)i[c]&&(g=4*(u[c]-h),g<h||g>t?i[c]=0:(p[c]=s[g],x[c]=s[g+1],m[c]=s[g+2],i[c]=s[g+3]));else{for(i=new Uint8Array(o),c=0;c<o;c++)g=4*(u[c]-h),g<h||g>t?i[c]=0:(p[c]=s[g],x[c]=s[g+1],m[c]=s[g+2],i[c]=s[g+3]);n.mask=i}}else if(a)if(null!=i)for(c=0;c<o;c++)i[c]&&(d=a[u[c]],p[c]=d[0],x[c]=d[1],m[c]=d[2],i[c]=d[3]);else{for(i=new Uint8Array(o),c=0;c<o;c++)d=a[u[c]],p[c]=d[0],x[c]=d[1],m[c]=d[2],i[c]=d[3];n.mask=i}return n.pixels=[p,x,m],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function c(t,n){if(!r(t))return null;const{pixels:l,mask:i}=t,o=l.length;let s=n.lut;const{offset:a}=n;s&&1===s[0].length&&(s=l.map((()=>s)));const h=[],f=n.outputPixelType||"u8";for(let e=0;e<o;e++){const t=u(l[e],i,s[e],a||0,f);h.push(t)}const c=new e({width:t.width,height:t.height,pixels:h,mask:i,pixelType:f});return c.updateStatistics(),c}function u(t,n,l,i,o){const r=t.length,s=e.createEmptyBand(o,r);if(n)for(let e=0;e<r;e++)n[e]&&(s[e]=l[t[e]-i]);else for(let e=0;e<r;e++)s[e]=l[t[e]-i];return s}function p(t,e){if(!r(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,o=e.length,s=Math.floor(o/2),a=e[Math.floor(s)],h=l[0];let f,c,u,p,x,m,d=!1;const g=new Uint8Array(i),y=new Uint8Array(i),w=new Uint8Array(i);let k=n.mask;const M=4===e[0].mappedColor.length;for(k||(k=new Uint8Array(i),k.fill(M?255:1),n.mask=k),x=0;x<i;x++)if(k[x]){for(f=h[x],d=!1,m=s,c=a,u=0,p=o-1;p-u>1;){if(f===c.value){d=!0;break}f>c.value?u=m:p=m,m=Math.floor((u+p)/2),c=e[Math.floor(m)]}d||(f===e[u].value?(c=e[u],d=!0):f===e[p].value?(c=e[p],d=!0):f<e[u].value?(d=!1,c=null):f>e[u].value&&(f<e[p].value?(c=e[u],d=!0):p===o-1?(d=!1,c=null):(c=e[p],d=!0))),d?(g[x]=c.mappedColor[0],y[x]=c.mappedColor[1],w[x]=c.mappedColor[2],k[x]=c.mappedColor[3]):g[x]=y[x]=w[x]=k[x]=0}return n.pixels=[g,y,w],n.mask=k,n.pixelType="u8",n.maskIsAlpha=M,n}function x(e,n,l=!1){const i=1e-5,r=new Float32Array(3*o),s=n.length;for(let a=0;a<o;a++)r[3*a]=e[2*a]??t-1,r[3*a+1]=e[2*a+1]??t,r[3*a+2]=n[a]??0,a<s&&(a>0&&(r[3*a]-=i),(a<s-1||!l)&&(r[3*a+1]-=i));return r}function m(t,l){if(!r(t))return null;const{width:i,height:o}=t,{inputRanges:s,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=t.pixels[0],m=e.createEmptyBand(h,x.length),d=t.mask,g=new Uint8Array(i*o);d?g.set(d):g.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=s.map((t=>t-y));w[0]=s[0],w[w.length-1]=s[s.length-1]+(p?1e-6:0);const k=s.length/2,[M,A]=n(h);for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===w[2*l]||t>w[2*l]&&t<w[2*l+1]){m[n]=a[l],e=!0;break}e||(c?m[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!d||d[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){m[n]=0,g[n]=0;break}}}return new e({width:i,height:o,pixelType:h,pixels:[m],mask:g})}function d(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,r=!!e?.length;for(let s=0;s<t.length;s++)if(l[s]){const n=t[s];if(r){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[s]=0)}l[s]&&(n===o||i?.has(n))&&(l[s]=0)}}function g(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}}function y(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}}function w(t,n){if(!r(t))return null;const{width:l,height:i,pixels:o}=t,s=l*i,a=new Uint8Array(s);t.mask?a.set(t.mask):a.fill(255);const h=o.length,{includedRanges:f,noDataValues:c,outputPixelType:p,matchAll:x,lookups:m}=n;if(m){const t=[];for(let e=0;e<h;e++){const n=m[e],l=u(o[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):x?g(t,a):y(t,a)}else if(x){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(s);n.set(a),d(o[e],f?.slice(2*e,2*e+2),c?.[e],n),t.push(n)}1===t.length?a.set(t[0]):g(t,a)}else for(let e=0;e<h;e++)d(o[e],f?.slice(2*e,2*e+2),c?.[e],a);return new e({width:l,height:i,pixelType:p,pixels:o,mask:a})}function k(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:r,noDataRanges:s,isLastInputRangeInclusive:a,outputPixelType:h}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=e.createEmptyBand(h,f),p=new Uint8Array(f);r&&p.fill(255);const[x,m]=n(h);if(i?.length&&o?.length){const t=1e-6,e=i.map((e=>e-t));e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>m?m:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),i=Math.floor(e[2*n+1]-c);for(let e=l;e<=i;e++)u[e]=t,p[e]=255}}if(s?.length)for(let e=0;e<s.length;e++){const t=Math.ceil(s[2*e]-c),n=Math.floor(s[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function M(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let r=0;r<e.length;r++){const t=Math.ceil(e[2*r]-i),n=Math.floor(e[2*r+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let r=0;r<n.length;r++)o[n[r]-i]=0;return{lut:o,offset:i}}function A(t,e,n,l,i,o,r,s){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+r<=n*t?0:i+r<n*t+t?i+r-n*t:t,ymax:o+s<=l*e?0:o+s<l*e+e?o+s-l*e:e}}function U(t,e){if(!t||0===t.length)return null;const n=t.find((t=>t.pixelBlock));if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),r=t.sort(((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0)),s=Math.min.apply(null,r.map((t=>t.extent.xmin))),a=Math.min.apply(null,r.map((t=>t.extent.ymin))),h=Math.max.apply(null,r.map((t=>t.extent.xmax))),f=Math.max.apply(null,r.map((t=>t.extent.ymax))),c={x:Math.round((e.xmin-s)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-s)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:T(r.map((t=>t.pixelBlock)),u,{clipOffset:c,clipSize:p})}}function b(t,e,n,l,i,o){const{width:r,height:s}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=A(r,s,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=r*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p,o=m*r;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function T(t,n,l={}){const{clipOffset:i,clipSize:o,alignmentInfo:s,blockWidths:a}=l;if(a)return v(t,n,{blockWidths:a});const h=t.find((t=>r(t)));if(null==h)return null;const f=o?o.width:n.width,c=o?o.height:n.height,u=h.width,p=h.height,x=n.width/u,m=n.height/p,d={offset:i||{x:0,y:0},mosaic:o||n,block:{width:u,height:p}},g=h.pixelType,y=e.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,A;for(let e=0;e<w;e++){A=new y(f*c);for(let n=0;n<m;n++)for(let l=0;l<x;l++){const i=t[n*x+l];r(i)&&(M=i.pixels[e],b(A,M,d,l,n,s))}k.push(A)}const U=t.some((t=>null==t||null!=t.mask&&t.mask.length>0)),T=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),B=U?new Uint8Array(f*c):void 0,C=T?[]:void 0;if(B){for(let e=0;e<m;e++)for(let n=0;n<x;n++){const l=t[e*x+n],i=null!=l?l.mask:null;b(B,null!=i?i:l?255:0,d,n,e,s)}if(C)for(let e=0;e<w;e++){const n=new Uint8Array(f*c);for(let l=0;l<m;l++)for(let i=0;i<x;i++){const o=t[l*x+i],r=o?.bandMasks?.[e]??o?.mask;b(n,null!=r?r:o?255:0,d,i,l,s)}C.push(n)}}const S=new e({width:f,height:c,pixels:k,pixelType:g,bandMasks:C,mask:B});return S.updateStatistics(),S}function v(t,n,l){const i=t.find((t=>null!=t));if(null==i)return null;const o=t.some((t=>null==t||!!t.mask)),{width:s,height:a}=n,h=o?new Uint8Array(s*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=e.getPixelArrayConstructor(i.pixelType);if(o)for(let e=0,y=0;e<t.length;y+=f[e],e++){const n=t[e];if(!r(n))continue;const l=n.mask;for(let t=0;t<a;t++)for(let i=0;i<f[e];i++)h[t*s+i+y]=null==l?255:l[t*n.width+i]}const x=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),m=x?[]:void 0,d=s*a;for(let e=0;e<u;e++){const n=new p(d),l=x?new Uint8Array(d):void 0;for(let i=0,o=0;i<t.length;o+=f[i],i++){const h=t[i];if(!r(h))continue;const c=h.pixels[e];if(null!=c){for(let t=0;t<a;t++)for(let e=0;e<f[i];e++)n[t*s+e+o]=c[t*h.width+e];if(l){const t=h.bandMasks?.[e]??h.mask;for(let e=0;e<a;e++)for(let n=0;n<f[i];n++)l[e*s+n+o]=t?t[e*h.width+n]:255}}}c.push(n),m&&l&&m.push(l)}const g=new e({width:s,height:a,mask:h,bandMasks:m,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function B(t,e,n){if(!r(t))return null;const{width:l,height:i}=t,o=e.x,s=e.y,a=n.width+o,h=n.height+s;if(o<0||s<0||a>l||h>i)return t;if(0===o&&0===s&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let r=0;r<i;r++){const t=r*l;for(let e=0;e<l;e++)f[t+e]=r<s||r>=h||e<o||e>=a?0:1}return t.updateStatistics(),t}function C(t){if(!r(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,o=i[0],s=e.pixels[0],a=t.mask;for(let r=2;r<l-1;r++){const t=new Map;for(let l=r-2;l<r+2;l++)for(let e=0;e<4;e++){const i=l*n+e;_(t,o[i],a?a[i]:1)}s[r*n]=S(t),s[r*n+1]=s[r*n+2]=s[r*n];let e=3;for(;e<n-1;e++){let l=(r-2)*n+e+1;_(t,o[l],a?a[l]:1),l=(r-1)*n+e+1,_(t,o[l],a?a[l]:1),l=r*n+e+1,_(t,o[l],a?a[l]:1),l=(r+1)*n+e+1,_(t,o[l],a?a[l]:1),l=(r-2)*n+e-3,P(t,o[l],a?a[l]:1),l=(r-1)*n+e-3,P(t,o[l],a?a[l]:1),l=r*n+e-3,P(t,o[l],a?a[l]:1),l=(r+1)*n+e-3,P(t,o[l],a?a[l]:1),s[r*n+e]=S(t)}s[r*n+e+1]=s[r*n+e]}for(let r=0;r<n;r++)s[r]=s[n+r]=s[2*n+r],s[(l-1)*n+r]=s[(l-2)*n+r];return e.updateStatistics(),e}function S(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function P(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function _(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function W(t,n,l){let{x:i,y:o}=n;const{width:s,height:a}=l;if(0===i&&0===o&&a===t.height&&s===t.width)return t;const{width:h,height:f}=t,c=Math.max(0,o),u=Math.max(0,i),p=Math.min(i+s,h),x=Math.min(o+a,f);if(p<0||x<0||!r(t))return null;i=Math.max(0,-i),o=Math.max(0,-o);const{pixels:m}=t,d=s*a,g=m.length,y=[];for(let r=0;r<g;r++){const n=m[r],l=e.createEmptyBand(t.pixelType,d);for(let t=c;t<x;t++){const e=t*h;let r=(t+o-c)*s+i;for(let t=u;t<p;t++)l[r++]=n[e+t]}y.push(l)}const w=new Uint8Array(d),k=t.mask;for(let e=c;e<x;e++){const t=e*h;let n=(e+o-c)*s+i;for(let e=u;e<p;e++)w[n++]=k?k[t+e]:1}const M=new e({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function E(t,n=!0){if(!r(t))return null;const{pixels:l,width:i,height:o,mask:s,pixelType:a}=t,h=[],f=Math.round(i/2),c=Math.round(o/2),u=o-1,p=i-1;for(let r=0;r<l.length;r++){const t=l[r],s=e.createEmptyBand(a,f*c);let x=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=t[e*i+l];if(n){const n=l===p?o:t[e*i+l+1],r=e===u?o:t[e*i+l+i],a=l===p?r:e===u?n:t[e*i+l+i+1];s[x++]=(o+n+r+a)/4}else s[x++]=o}h.push(s)}let x=null;if(null!=s){x=new Uint8Array(f*c);let t=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=s[e*i+l];if(n){const n=l===p?o:s[e*i+l+1],r=e===u?o:s[e*i+l+i],a=l===p?r:e===u?n:s[e*i+l+i+1];x[t++]=o*n*r*a?1:0}else x[t++]=o}}return new e({width:f,height:c,pixelType:a,pixels:h,mask:x})}function I(t,e,n=0,l=!0){if(!r(t))return null;const{width:i,height:o}=e;let{width:s,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let r=0;r<c;r++){const t=Math.ceil(s/i),n=Math.ceil(a/o);for(let l=0;l<n;l++){f.y=l*o;for(let n=0;n<t;n++){f.x=n*i;const t=W(u,f,e);h.set(`${r}/${l}/${n}`,t)}}r<c-1&&(u=E(u,l)),s=Math.round(s/2),a=Math.round(a/2)}return h}function R(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:o,useBilinear:s}=t;if(!r(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=W(e,{y:i*u,x:o*c},{width:c,height:u});if(!p)return null;for(let r=l;r>0;r--)p=E(p,s);return p}function F(t,e,n,l,i=0){const{width:o,height:r}=t,{width:s,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(s/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,m,d,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let v,B,C=0;for(let S=0;S<u;S++)for(let t=0;t<c;t++){p=12*(S*c+t),x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){C=(S*f+e)*k+t*h,B=(e+.5)/f;for(let t=0;t<e;t++)v=(t+.5)/h,A[C+t]=(x*v+m*B+d)*o+i,U[C+t]=(g*v+y*B+w)*r+i,b[C+t]=Math.floor(A[C+t]),T[C+t]=Math.floor(U[C+t])}p+=6,x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){C=(S*f+e)*k+t*h,B=(e+.5)/f;for(let t=e;t<h;t++)v=(t+.5)/h,A[C+t]=(x*v+m*B+d)*o+i,U[C+t]=(g*v+y*B+w)*r+i,b[C+t]=Math.floor(A[C+t]),T[C+t]=Math.floor(U[C+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function j(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:r}=F(t,t,n,{rows:l[0],cols:l[1]}),{width:s,height:a}=t,h=new Float32Array(s*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<s;t++){const e=c*r+t,n=0===c?e:e-r,l=c===a-1?e:e+r,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*s+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*s+t]=e}}return h}function D(t,n,l,i,o="nearest"){if(!r(t))return null;"majority"===o&&(t=C(t));const{pixels:s,mask:a,bandMasks:h,pixelType:f}=t,c=t.width,u=t.height,p=e.getPixelArrayConstructor(f),x=s.length,{width:m,height:d}=n;let g=!1;for(let e=0;e<l.length;e+=3)-1===l[e]&&-1===l[e+1]&&-1===l[e+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=F({width:c,height:u},n,l,i,"majority"===o?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<d;o++){U=o*A;for(let r=0;r<m;r++){if(y[U]<0||w[U]<0)t[o*m+r]=0;else if(l)t[o*m+r]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),s=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-s;if(!n||n[l+s*c]&&n[a+s*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+s*c]+f*e[a+s*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*m+r]=(1-u)*n+u*p+i}else t[o*m+r]=e[k[U]+M[U]*c]}U++}}},T=[];let v;const B=h?.length===x,S=[];for(let e=0;e<x;e++){if(B){const t=new Uint8Array(m*d);b(t,h[e],h[e],!0),S.push(t)}v=new p(m*d),b(v,s[e],B?h[e]:a,"nearest"===o||"majority"===o),T.push(v)}const P=new e({width:m,height:d,pixelType:f,pixels:T,bandMasks:B?S:void 0});if(null!=a)P.mask=new Uint8Array(m*d),b(P.mask,a,a,!0);else if(g){P.mask=new Uint8Array(m*d);for(let t=0;t<m*d;t++)P.mask[t]=y[t]<0||w[t]<0?0:1}return P.updateStatistics(),P}export{i as MissingBandAction,l as NoDataInterpretation,D as approximateTransform,W as clip,R as clipTile,f as colorize,a as compositeBands,h as createColormapLUT,M as createMaskLUT,x as createRangeMaps,k as createRemapLUT,s as extractBands,A as getClipBounds,j as getLocalArithmeticNorthRotations,F as interpolateOffsets,r as isValidPixelBlock,u as lookupBandValues,c as lookupPixels,w as mask,o as maxMapSizeGpu,T as mosaic,U as mosaicPixelData,m as remap,p as remapColor,C as resampleByMajority,B as setValidBoundary,I as split};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Error.js";import s from"../../core/Loadable.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import r from"../../core/Promise.js";import{throwIfAborted as u}from"../../core/promiseUtils.js";import n from"../../core/ReactiveMap.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as p}from"../../layers/support/layerUtils.js";import{RuleType as l}from"./typeUtils.js";function c(e){return`${e.networkSource?.sourceId??""}-${e.assetGroup?.assetGroupCode??""}-${e.assetType?.assetTypeCode??""}`}let d=class extends(s.LoadableMixin(r)){constructor(e){super(e),this.layerIdToSourceIdLookup=new n,this.sourceIdToLayerIdLookup=new n,this.sourceIdToNetworkInfo=new n,this._rulesBySourceId=new Map,this._terminalConfigurationsBySourceId=new Map}async load(e){return this.addResolvingPromise(this._load(e)),this}agatFromRule(e,o){let s;switch(o){case"to":s={networkSource:e.toNetworkSource??null,assetGroup:e.toAssetGroup??null,assetType:e.toAssetType??null};break;case"from":s={networkSource:e.fromNetworkSource??null,assetGroup:e.fromAssetGroup??null,assetType:e.fromAssetType??null};break;case"via":s={networkSource:e.viaNetworkSource??null,assetGroup:e.viaAssetGroup??null,assetType:e.viaAssetType??null}}return null===s.networkSource?null:s}agatToFullDefinition({assetGroup:e,assetType:o,networkSourceId:s}){if(null===s||null===e||null===o)return null;const t={networkSource:null,assetGroup:null,assetType:null},r=this.sourceIdToNetworkInfo.get(s);if(!r)return null;t.networkSource=r;const u=r.assetGroupLookup.get(e);return u?(t.assetGroup=u,t.assetType=u.assetTypeLookup.get(o)??null,null===t.assetType?null:t):null}findAgat(e,s){const t=p(s)?s.parent:s;if(!t)throw new o("Unable to find asset group/asset type for layer. The given layer is a `SubtypeSublayer` with no parent.");if(this.utilityNetwork.featureServiceUrl!==t.url)return null;const r=this.getNetworkSourceIdForLayer(t);if(null===r)return null;const u=t.fieldsIndex.get("assettype")?.name??"";if(""===u)return null;const n=t.fieldsIndex.get("assetgroup")?.name??"";if(""===n)return null;const a=e.attributes[u],i=e.attributes[n];return null==a||null==i?null:{assetGroup:i,assetType:a,networkSourceId:r}}findAgatFullDefinition(e,o){const s=this.findAgat(e,o);return s?this.agatToFullDefinition(s):null}findRules({networkSourceId:e,assetGroup:o,assetType:s}){const t=[];if(null===e||null===o)return t;const r=this._rulesBySourceId.get(e)?.get(o);if(!r)return t;for(const u of r.generalRules)t.push(u);if(null!=s){const e=r.typeSpecificRules.get(s);if(e)for(const o of e)t.push(o)}return t}getNetworkSourceIdForLayer(e){const o=p(e)?e.parent:e;return o&&this.utilityNetwork.featureServiceUrl===o.url?this.layerIdToSourceIdLookup.get(o.layerId)??null:null}ruleMatchesAgat(e,o,s){switch(s){case"to":return!(e.toNetworkSource?.sourceId!==o.networkSourceId||e.toAssetGroup&&e.toAssetGroup.assetGroupCode!==o.assetGroup||e.toAssetType&&e.toAssetType.assetTypeCode!==o.assetType);case"from":return!(e.fromNetworkSource?.sourceId!==o.networkSourceId||e.fromAssetGroup&&e.fromAssetGroup.assetGroupCode!==o.assetGroup||e.fromAssetType&&e.fromAssetType.assetTypeCode!==o.assetType);case"via":return!(e.viaNetworkSource?.sourceId!==o.networkSourceId||e.viaAssetGroup&&e.viaAssetGroup.assetGroupCode!==o.assetGroup||e.viaAssetType&&e.viaAssetType.assetTypeCode!==o.assetType)}}ruleMatchesFullDefinitionAgat(e,o,s){switch(s){case"to":return!(e.toNetworkSource?.sourceId!==o.networkSource?.sourceId||e.toAssetGroup&&e.toAssetGroup.assetGroupCode!==o.assetGroup?.assetGroupCode||e.toAssetType&&e.toAssetType.assetTypeCode!==o.assetType?.assetTypeCode);case"from":return!(e.fromNetworkSource?.sourceId!==o.networkSource?.sourceId||e.fromAssetGroup&&e.fromAssetGroup.assetGroupCode!==o.assetGroup?.assetGroupCode||e.fromAssetType&&e.fromAssetType.assetTypeCode!==o.assetType?.assetTypeCode);case"via":return!(e.viaNetworkSource?.sourceId!==o.networkSource?.sourceId||e.viaAssetGroup&&e.viaAssetGroup.assetGroupCode!==o.assetGroup?.assetGroupCode||e.viaAssetType&&e.viaAssetType.assetTypeCode!==o.assetType?.assetTypeCode)}}terminalConfiguration(e,o,s){const t=this._terminalConfigurationsBySourceId.get(e);if(!t)return null;const r=t.get(o);if(!r)return null;const u=r.get(s);return u||null}async _load(e){await this.utilityNetwork.load(),u(e);const{dataElement:s}=this.utilityNetwork;if(!s)throw new o("no-data-element","No data element found on utility network");for(const o of s.domainNetworks)for(const e of[...o.edgeSources??[],...o.junctionSources??[]]){this.layerIdToSourceIdLookup.set(e.layerId,e.sourceId),this.sourceIdToLayerIdLookup.set(e.sourceId,e.layerId);const o=(e.assetGroups??[]).map((e=>{const o=new n;for(const s of e.assetTypes??[])o.set(s.assetTypeCode,s);return{...e,assetTypeLookup:o}})),s=new n;for(const e of o)s.set(e.assetGroupCode,e);const t={...e,assetGroupLookup:s,assetGroups:o};this.sourceIdToNetworkInfo.set(t.sourceId,t)}const t=await this.utilityNetwork.getRulesTable();u(e);for(const o of t?.rules??[])switch(o.ruleType){case l.RTAttachment:case l.RTContainment:this._registerRule(o.fromNetworkSource.sourceId,o.fromAssetGroup.assetGroupCode,o.fromAssetType.assetTypeCode,o),this._registerRule(o.toNetworkSource.sourceId,o.toAssetGroup.assetGroupCode,o.toAssetType.assetTypeCode,o);break;case l.RTEdgeJunctionEdgeConnectivity:this._registerRule(o.fromNetworkSource.sourceId,o.fromAssetGroup.assetGroupCode,o.fromAssetType.assetTypeCode,o),this._registerRule(o.toNetworkSource.sourceId,o.toAssetGroup.assetGroupCode,o.toAssetType.assetTypeCode,o),this._registerRule(o.viaNetworkSource.sourceId,o.viaAssetGroup.assetGroupCode,o.viaAssetType.assetTypeCode,o);break;case l.RTJunctionEdgeConnectivity:case l.RTJunctionJunctionConnectivity:this._registerRule(o.fromNetworkSource.sourceId,o.fromAssetGroup.assetGroupCode,o.fromAssetType.assetTypeCode,o),this._registerRule(o.toNetworkSource.sourceId,o.toAssetGroup.assetGroupCode,o.toAssetType.assetTypeCode,o)}this._makeTerminalConfigurationLookups(s)}_makeTerminalConfigurationLookups(e){const o={};for(const s of e.terminalConfigurations??[])o[s.terminalConfigurationId]=s;for(const s of e.domainNetworks??[])for(const e of s.junctionSources)if("esriUNFCUTJunctionObject"===e.utilityNetworkFeatureClassUsageType||"esriUNFCUTDevice"===e.utilityNetworkFeatureClassUsageType)for(const s of e.assetGroups??[])for(const r of s.assetTypes??[])if(null!=r.terminalConfigurationId&&r.terminalConfigurationId>=0){const u=o[r.terminalConfigurationId];if(u){const o=t(this._terminalConfigurationsBySourceId,e.sourceId,(()=>new Map));t(o,s.assetGroupCode,(()=>new Map)).set(r.assetTypeCode,u)}}}_registerRule(e,o,s,r){const u=t(this._rulesBySourceId,e,(()=>new Map)),n=t(u,o,(()=>({generalRules:[],typeSpecificRules:new Map})));if(-1===s)n.generalRules.push(r);else{t(n.typeSpecificRules,s,(()=>[])).push(r)}}};e([a()],d.prototype,"layerIdToSourceIdLookup",void 0),e([a()],d.prototype,"sourceIdToLayerIdLookup",void 0),e([a()],d.prototype,"sourceIdToNetworkInfo",void 0),e([a()],d.prototype,"utilityNetwork",void 0),d=e([i("esri.networks.support.UtilityNetworkLookupHelper")],d);export{d as UtilityNetworkLookupHelper,c as hashAgat};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.20250302",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
29
29
|
"@esri/calcite-components": "^3.0.3",
|
|
30
|
-
"@vaadin/grid": "~24.6.
|
|
30
|
+
"@vaadin/grid": "~24.6.6",
|
|
31
31
|
"@zip.js/zip.js": "~2.7.57",
|
|
32
32
|
"luxon": "~3.5.0",
|
|
33
33
|
"marked": "~15.0.7"
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{convertDateFormatToIntlOptions as t,formatDate as e,formatTimestamp as n,formatTimeOnly as r,formatDateOnly as o}from"../../intl/date.js";import{isDateField as i,isDateOnlyField as s,isTimestampOffsetField as a}from"../../layers/support/fieldUtils.js";import{loadArcade as l}from"../../support/arcadeOnDemand.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{
|
|
5
|
+
import{convertDateFormatToIntlOptions as t,formatDate as e,formatTimestamp as n,formatTimeOnly as r,formatDateOnly as o}from"../../intl/date.js";import{isDateField as i,isDateOnlyField as s,isTimestampOffsetField as a}from"../../layers/support/fieldUtils.js";import{loadArcade as l}from"../../support/arcadeOnDemand.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{utc as m}from"../../time/constants.js";import{getTimeZoneFormattingOptions as d}from"../../time/timeZoneUtils.js";const f=",",c={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},p="percent-of-total",g="field",y={exclude:["median"]},h={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},v=new Set(["integer","small-integer"]);let T=null;const Z=["date","date-only","timestamp-offset"];function $(t){return i(t)||s(t)||a(t)}async function U(t){const{field:e,field2:n,field3:r,normalizationField:o,valueExpression:i}=t;let s=[];if(i){if(!T){const{arcadeUtils:t}=await l();T=t}s=T.extractFieldNames(i)}return e&&s.push(e),n&&s.push(n),r&&s.push(r),o&&s.push(o),s}function w(t){let e=t.normalizationType;return e||(t.normalizationField?e=g:null!=t.normalizationTotal&&(e=p)),e??void 0}function D(t){return String(t).padStart(2,"0")}function S(t,e,n){let r;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));r=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${D((n?t.getMonth():t.getUTCMonth())+1)}-${D(n?t.getDate():t.getUTCDate())} ${D(n?t.getHours():t.getUTCHours())}:${D(n?t.getMinutes():t.getUTCMinutes())}:${D(n?t.getSeconds():t.getUTCSeconds())}'`}else r=t;return r}function k(t,e,n,r){const{hasQueryEngine:o}=t,i=`(${S(n,C(t,n),o)} - ${S(e,C(t,e),o)})`;let s=h[r],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function C(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(i(n))return"field"}}function F(t,e=c){for(const n in e)if(e[n].includes(t))return n}function b(t,e,n=!0){let r=null;return t&&("string"==typeof t?e.includes(t)&&(r=t):r=u(t)),n?r||"gray":r}function j(t,e){const n=e&&t.getField(e);return!!n&&v.has(n.type)}function M(t){return`cast(${t} as float)`}function N(i,s){const{format:a,timeZoneOptions:l,fieldType:u}=s??{};let f,c;if(l&&({timeZone:f,timeZoneName:c}=d(l.layerTimeZone,l.datesInUnknownTimezone,l.viewTimeZone,t(a||"short-date-short-time"),u)),"string"==typeof i&&isNaN(Date.parse("time-only"===u?`1970-01-01T${i}Z`:i)))return i;switch(u){case"date-only":{const n=t(a||"short-date");return"string"==typeof i?o(i,{...n}):e(i,{...n,timeZone:m})}case"time-only":{const n=t(a||"short-time");return"string"==typeof i?r(i,n):e(i,{...n,timeZone:m})}case"timestamp-offset":{if(!f&&"string"==typeof i&&new Date(i).toISOString()!==i)return i;const r=a||l?t(a||"short-date-short-time"):void 0,o=r?{...r,timeZone:f,timeZoneName:c}:void 0;return"string"==typeof i?n(i,o):e(i,o)}default:{const n=a||l?t(a||"short-date-short-time"):void 0;return e("string"==typeof i?new Date(i):i,n?{...n,timeZone:f,timeZoneName:c}:void 0)}}}export{M as castIntegerFieldToFloat,Z as dateTypes,c as defaultBasemapGroups,y as defaultStatisticTypes,f as fieldDelimiter,N as formatAnyDate,F as getBasemapGroup,b as getBasemapId,k as getDateDiffSQL,C as getDateType,U as getFieldsList,w as getNormalizationType,$ as isAnyDateField,j as isIntegerField,h as unitValueInDays};
|
package/support/guards.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
function n(n){return"number"==typeof n}function r(n){return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n}function t(n){return"boolean"==typeof n}function e(n){return"string"==typeof n||n instanceof String}function u(n){return null==n||e(n)}function o(n){return Array.isArray(n)}function i(n){return"esri.Graphic"===n?.declaredClass}function f(n){return"esri.rest.support.Query"===n?.declaredClass}function c(n){return n instanceof Date}export{o as isArray,t as isBoolean,c as isDate,i as isGraphic,r as isInteger,n as isNumber,f as isQuery,e as isString,u as isStringOrNull};
|
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="20250302",c="cc2ffb23d14e5e1e8e44cf58267b6016445206f9";export{e as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as f}from"./effects/EffectCut.js";import{EffectDashes as o}from"./effects/EffectDashes.js";import{EffectDonut as s}from"./effects/EffectDonut.js";import{EffectJog as a}from"./effects/EffectJog.js";import{EffectMove as n}from"./effects/EffectMove.js";import{EffectOffset as
|
|
5
|
+
import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as f}from"./effects/EffectCut.js";import{EffectDashes as o}from"./effects/EffectDashes.js";import{EffectDonut as s}from"./effects/EffectDonut.js";import{EffectEnclosingPolygon as l}from"./effects/EffectEnclosingPolygon.js";import{EffectJog as a}from"./effects/EffectJog.js";import{EffectMove as n}from"./effects/EffectMove.js";import{EffectOffset as m}from"./effects/EffectOffset.js";import{EffectRadial as i}from"./effects/EffectRadial.js";import{EffectReverse as u}from"./effects/EffectReverse.js";import{EffectRotate as E}from"./effects/EffectRotate.js";import{EffectScale as p}from"./effects/EffectScale.js";import{EffectTaperedPolygon as M}from"./effects/EffectTaperedPolygon.js";import{EffectWave as C}from"./effects/EffectWave.js";import{PlacementAlongLineSameSize as I}from"./placements/PlacementAlongLineSameSize.js";import{PlacementAtExtremities as P}from"./placements/PlacementAtExtremities.js";import{PlacementAtRatioPositions as j}from"./placements/PlacementAtRatioPositions.js";import{PlacementInsidePolygon as G}from"./placements/PlacementInsidePolygon.js";import{PlacementOnLine as g}from"./placements/PlacementOnLine.js";import{PlacementOnVertices as d}from"./placements/PlacementOnVertices.js";import{PlacementPolygonCenter as y}from"./placements/PlacementPolygonCenter.js";function A(I){if(!I)return null;switch(I.type){case"CIMGeometricEffectAddControlPoints":return e.local();case"CIMGeometricEffectArrow":return t.local();case"CIMGeometricEffectBuffer":return r.local();case"CIMGeometricEffectControlMeasureLine":return c.local();case"CIMGeometricEffectCut":return f.local();case"CIMGeometricEffectDashes":return o.local();case"CIMGeometricEffectDonut":return s.local();case"CIMGeometricEffectJog":return a.local();case"CIMGeometricEffectMove":return n.local();case"CIMGeometricEffectOffset":return m.local();case"CIMGeometricEffectRadial":return i.local();case"CIMGeometricEffectReverse":return u.local();case"CIMGeometricEffectRotate":return E.local();case"CIMGeometricEffectScale":return p.local();case"CIMGeometricEffectTaperedPolygon":return M.local();case"CIMGeometricEffectWave":return C.local();case"CIMGeometricEffectEnclosingPolygon":return l.local()}return null}function R(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return I.local();case"CIMMarkerPlacementAtExtremities":return P.local();case"CIMMarkerPlacementAtRatioPositions":return j.local();case"CIMMarkerPlacementInsidePolygon":return G.local();case"CIMMarkerPlacementOnLine":return g.local();case"CIMMarkerPlacementOnVertices":return d.local();case"CIMMarkerPlacementPolygonCenter":return y.local()}return null}export{A as getEffectOperator,R as getPlacementOperator};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"./CIMResourceManager.js";import{Transformation as
|
|
5
|
+
import{isPolyline as e,isPolygon as t}from"../../geometry/support/jsonUtils.js";import i from"./CIMResourceManager.js";import{Transformation as r,CanvasDrawHelper as h}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as s}from"./CIMSymbolHelper.js";import{OverrideHelper as n}from"./OverrideHelper.js";import{scale as a,translate as o}from"./rasterizingUtils.js";import{mapCIMSymbolToGeometryType as l}from"./utils.js";const m=96/72;class g{constructor(e){this._spatialReference=e,this._imageDataCanvas=null,this._cimResourceManager=new i}get _canvas(){return this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas")),this._imageDataCanvas}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(i,r,h,o,m,g,c,d,w,u){if(!i)return null;const{data:x}=i;if(!x||"CIMSymbolReference"!==x.type||!x.symbol)return null;const{symbol:p}=x;g||(g=l(p));const f=await n.resolveSymbolOverrides(x,r,this._spatialReference,m,g,c,d),b=this._cimResourceManager,M=[];s.fetchResources(f,b,M),s.fetchFonts(f,b,M),M.length>0&&await Promise.all(M);const{width:C,height:R}=h;let v=y(g,C,R,o,u);const I=s.getEnvelope(f,v,b);if(!I)return null;I.x===1/0&&(I.x=C+2),I.y===1/0&&(I.y=-R/2),I.width===-1/0&&(I.width=C),I.height===-1/0&&(I.height=R);let S=1,_=0,P=0;switch(p.type){case"CIMPointSymbol":case"CIMTextSymbol":{let e=1;I.width>C&&(e=C/I.width);let t=1;I.height>R&&(t=R/I.height),"preview"===o&&(I.width<C&&(e=C/I.width),I.height<R&&(t=R/I.height)),S=Math.min(e,t),_=I.x+I.width/2,P=I.y+I.height/2}break;case"CIMLineSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-C,t=I.height-R;v={paths:a(v.paths,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{(w||I.height>R)&&(S=R/I.height),P=I.y+I.height/2;const i=I.x*S+C/2,r=(I.x+I.width)*S+C/2,h=e(v)?v.paths:t(v)?v.rings:null;if(null===h)throw new Error("Bad geometry, can't rasterise symbol!");h[0][0][0]-=i/S,h[0][2][0]-=(r-C)/S}break;case"CIMPolygonSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-C,t=I.height-R;v={paths:a(v.rings,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{_=I.x+I.width/2,P=I.y+I.height/2;const e=I.x*S+C/2,t=(I.x+I.width)*S+C/2,i=I.y*S+R/2,r=(I.y+I.height)*S+R/2,{rings:h}=v;e<0&&(h[0][0][0]-=e,h[0][3][0]-=e,h[0][4][0]-=e),i<0&&(h[0][0][1]+=i,h[0][1][1]+=i,h[0][4][1]+=i),t>C&&(h[0][1][0]-=t-C,h[0][2][0]-=t-C),r>R&&(h[0][2][1]+=r-R,h[0][3][1]+=r-R)}}const j={type:"cim",data:{type:"CIMSymbolReference",symbol:f}};return this.rasterize(j,C,R,_,P,S,g,1,v)}rasterize(e,t,i,s,n,a,o,g=0,c=null,d=window.devicePixelRatio||1){const{data:w}=e;if(!w||"CIMSymbolReference"!==w.type||!w.symbol)return null;const{symbol:u}=w,x=this._canvas,p=d*m;x.width=t*p,x.height=i*p,o||(o=l(u)),c||(c=y(o,t,i,"legend")),x.width+=2*g,x.height+=2*g;const f=x.getContext("2d",{willReadFrequently:!0}),b=r.createIdentity();b.translate(-s,-n),b.scale(a*p,-a*p),b.translate(t*p/2+g,i*p/2+g),f.clearRect(0,0,x.width,x.height);return new h(f,this._cimResourceManager,b,!0).drawSymbol(u,c),f.getImageData(0,0,x.width,x.height)}}function c(e,t,i,r){if("esriGeometryPolygon"===t){return{rings:o(a(e.rings,{xmin:0,ymin:0,xmax:i,ymax:r,width:i,height:r}),-1*i/2,-1*r/2)}}if("esriGeometryPolyline"===t){return{paths:o(a(e.paths,{xmin:0,ymin:0,xmax:i,ymax:r,width:i,height:r}),-1*i/2,-1*r/2)}}return null}function y(e,t,i,r,h){const s=1,n=-t/2+s,a=t/2-s,o=i/2-s,l=-i/2+s;if(h&&("esriGeometryPolygon"===e||"esriGeometryPolyline"===e)){const r=c(h,e,t,i);if(r)return r}switch(e){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[n,0],[0,0],[a,0]]]};default:return"legend"===r?{rings:[[[n,o],[a,0],[a,l],[n,l],[n,o]]]}:{rings:[[[n,o],[a,o],[a,l],[n,l],[n,o]]]}}}export{g as CIMSymbolRasterizer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{SymbolUnits as e,AnimatedSymbolRepeatType as t,AnimatedSymbolEasingType as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:o.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0}};export{i as defaultCIMColor,n as defaultCIMValues};
|
|
5
|
+
import{SymbolUnits as e,AnimatedSymbolRepeatType as t,AnimatedSymbolEasingType as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:o.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0}};export{i as defaultCIMColor,n as defaultCIMValues};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{GeometricEffectEnclosingPolygonMethod as n}from"../enums.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(e,t,n,r,s){return new o(e,t,n,s)}}class o{constructor(e,t,n,r){this._inputGeometries=e,this._medhod=t.method,this._geometryEngine=r}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case n.RectangularBox:default:return s(e);case n.ClosePath:return i(e);case n.ConvexHull:return this._constructConvexHull(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(n){switch(n.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=this._geometryEngine;if(null==r)return null;const o=r.convexHull(t.WebMercator,n.asJSON());return o?e.fromJSONCIM(o):null}case"esriGeometryEnvelope":return n;default:return null}}}function s(t){let n=Number.MAX_VALUE,r=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MIN_VALUE;for(t.seekPathStart();t.nextPoint();)n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),s=Math.max(s,t.y);const i={xmin:n,ymin:r,xmax:o,ymax:s};return e.fromJSONCIM(i)}function i(t){switch(t.geometryType){case"esriGeometryPolyline":{const n=[];for(;t.nextPath();)u(t,n);return e.fromJSONCIM({rings:n})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function u(e,t){if(e.seekPathStart(),!e.nextPoint())return;const n=e.x,r=e.y,o=[[n,r]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([n,r])}export{r as EffectEnclosingPolygon};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{defaultCIMValues as e}from"../defaultCIMValues.js";class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,i,s,l){return new n(t,e,i)}}class n{constructor(t,i,n){this._inputGeometries=t,this._length=(void 0!==i.length?i.length:e.CIMGeometricEffectRadial.length)*n,this._angle=void 0!==i.angle?i.angle*Math.PI/180:e.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let e=this._inputGeometries.next();for(;e;){if("esriGeometryPoint"===e.geometryType){const i=t.createEmptyOptimizedCIM("esriGeometryPolyline");return e.nextPath()&&e.nextPoint()&&i.pushPath([[e.x,e.y],[e.x+this._lx,e.y+this._ly]]),i}e=this._inputGeometries.next()}return null}}export{i as EffectRadial};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import t from"../../../core/Error.js";import e from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{getPathLength as r,closeRingsAndFixWinding as n}from"../../../geometry/support/coordsUtils.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonUtils.js";import a from"../../../geometry/support/PolylineBuilder.js";import{Point as h}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as c}from"../CIMCursor.js";import{SegmentCursor as y}from"../../../views/2d/engine/webgl/mesh/templates/segmentUtils.js";const p=()=>e.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class x{static{this.instance=null}static local(){return null===x.instance&&(x.instance=new x),x.instance}execute(t,e,s,o,r){return new _(t,e,s,r)}}class _ extends c{constructor(t,e,s,o){super(t,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new h(NaN,NaN),this._lastWidth=0,this._halfFromWidth=Math.abs(void 0!==e.fromWidth?e.fromWidth:0)*s*.5,this._halfToWidth=Math.abs(void 0!==e.toWidth?e.toWidth:1)*s*.5,this._originalLength=(void 0!==e.length?e.length:0)*s,this._length=0,this._geometryEngine=o}processPath(e){if(e.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const t=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,e.yFactor);for(e.seekPathEnd();e.prevPoint();)t.pushXY(e.x,e.y);for(e.seekPathStart();e.nextPoint();)t.pushXY(e.x,e.y);return t}const h=[];e.seekPathStart();let c=0,x=0;for(;e.nextPoint();)h.push([e.x-c,e.y-x]),c=e.x,x=e.y;const _=this._geometryEngine?.simplify(o.WebMercator,{paths:[h]});if(!_)return p().error(new t("mapview-bad-resource","Unable to simplify geometry")),null;const f=i(_)?_.rings:l(_)?_.paths:null;if(!f)return p().error(new t("mapview-bad-resource","Unable to process geometry")),null;const d=new a,m=new a;let g=0;for(const t of f)g+=r(t);if(0===this._originalLength||this._originalLength>g){this._length=g;const t=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(t)<1){const e=t*t;this._slopeC=Math.sqrt(1/(1+e)),this._slopeS=Math.sqrt(e/(1+e)),t<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;let u=0;const S=[];for(const t of f){const e=y.create(t),s=y.create(t);this._setFromOffset(s,d,m);let o=s.next(),r=e;for(;o&&r;)u=this._setOffset(r,o,u,d,m),r=e.next(),o=s.next();r=e,r&&this._setToOffset(r,u,d,m);const n=d.getGeometry(),i=m.getGeometry(),l=[];for(const t of n)l.push(...t);for(let t=i.length-1;t>=0;t--){const e=i[t];for(let t=e.length-1;t>=0;t--)l.push(e[t])}S.push(l)}const T={rings:S};n(T);const w=this._geometryEngine?.simplify(o.WebMercator,T);return w?s.fromJSONCIM(T):null}_setFromOffset(t,e,s){const o=this._halfFromWidth,r=new h(t.xEnd-t.xStart,t.yEnd-t.yStart);r.normalize(),r.scale(o),e.beginPath([t.xStart-r.y,t.yStart+r.x]),s.beginPath([t.xStart+r.y,t.yStart-r.x])}_setToOffset(t,e,s,o){let r;r=(e+=Math.sqrt((t.xEnd-t.xStart)*(t.xEnd-t.xStart)+(t.yEnd-t.yStart)*(t.yEnd-t.yStart)))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*e/this._length;const n=new h(t.xEnd-t.xStart,t.yEnd-t.yStart);n.normalize(),n.scale(r),s.lineTo([t.xEnd-n.y,t.yEnd+n.x]),o.lineTo([t.xEnd+n.y,t.yEnd-n.x])}_setOffset(e,s,o,r,n){const i=Math.sqrt((e.xEnd-e.xStart)*(e.xEnd-e.xStart)+(e.yEnd-e.yStart)*(e.yEnd-e.yStart));let l;l=o+i>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(o+i)/this._length,o+=i;const a=new h(e.xEnd,e.yEnd),c=new h(e.xEnd-e.xStart,e.yEnd-e.yStart);c.normalize();const y=new h(s.xEnd-s.xStart,s.yEnd-s.yStart);y.normalize();const x=c.x*y.y-c.y*y.x;0===x&&p().error(new t("mapview-bad-resource","Unable to process geometry"));const _=new h((y.x-c.x)/x,(y.y-c.y)/x),f=r.getPointCount(),d=n.getPointCount();c.leftPerpendicular(),y.leftPerpendicular();const m=c.x*y.x+c.y*y.y;if(m>.99){const t=new h((c.x+y.x)*l/2,(c.y+y.y)*l/2),e=t.clone();e.rotate(this._slopeC,this._slopeS),r.lineTo([a.x+e.x,a.y+e.y]);const s=t.clone();s.rotateReverse(this._slopeC,this._slopeS),n.lineTo([a.x-s.x,a.y-s.y])}else{if(x<0){const e=_.clone().scale(-l);e.rotateReverse(this._slopeC,this._slopeS);const s=n.getXY(d-1);s||p().error(new t("mapview-bad-resource","Unable to process geometry, index out of scope"));const o=h.add(a,e),r=h.sub(o,h.fromArray(s));if(c.x*r.y-c.y*r.x>0){const t=new h(-c.x*l,-c.y*l);t.rotateReverse(this._slopeC,this._slopeS);const e=new h(-y.x*l,-y.y*l);e.rotateReverse(this._slopeC,this._slopeS),n.lineTo([a.x+t.x,a.y+t.y]),n.lineTo([a.x,a.y]),n.lineTo([a.x+e.x,a.y+e.y])}else n.lineTo([a.x+e.x,a.y+e.y])}else{const e=_.clone().scale(l);e.rotate(this._slopeC,this._slopeS);const s=r.getXY(f-1);s||p().error(new t("mapview-bad-resource","Unable to process geometry, index out of scope"));const o=h.add(a,e),n=h.sub(o,h.fromArray(s));if(c.x*n.y-c.y*n.x>0){const t=c.clone().scale(l);t.rotate(this._slopeC,this._slopeS);const e=y.clone().scale(l);e.rotate(this._slopeC,this._slopeS),r.lineTo([a.x+t.x,a.y+t.y]),r.lineTo([a.x,a.y]),r.lineTo([a.x+e.x,a.y+e.y])}else r.lineTo([a.x+e.x,a.y+e.y])}const s=Math.acos(m);let o=1;if(l>.25){const t=2*Math.acos(1-.25/l);t<s&&(o=Math.round(s/t))}const i=Math.cos(s/o),g=Math.sin(s/o),u=c.clone();if(x<0){u.rotate(this._slopeC,this._slopeS);const s=r.getXY(f-1);s||p().error(new t("mapview-bad-resource","Unable to process geometry, index out of scope"));const o=h.add(a,u.clone().scale(this._lastWidth)),n=h.sub(o,h.fromArray(s)),i=c.x*n.y-c.y*n.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&i>0){const t=new h(e.xStart,e.yStart),s=this._lastTangent1.clone().scale(this._lastWidth);s.rotate(this._slopeC,this._slopeS);const o=c.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS),r.lineTo([t.x+s.x,t.y+s.y]),r.lineTo([t.x,t.y]),r.lineTo([t.x+o.x,t.y+o.y])}}else{u.scale(-1).rotateReverse(this._slopeC,this._slopeS);const s=n.getXY(d-1);s||p().error(new t("mapview-bad-resource","Unable to process geometry, index out of scope"));const o=h.add(a,u.clone().scale(this._lastWidth)),r=h.sub(o,h.fromArray(s)),i=c.x*r.y-c.y*r.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&i>0){const t=new h(e.xStart,e.yStart),s=this._lastTangent1.clone().scale(-this._lastWidth);s.rotateReverse(this._slopeC,this._slopeS);const o=c.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS),n.lineTo([t.x+s.x,t.y+s.y]),n.lineTo([t.x,t.y]),n.lineTo([t.x+o.x,t.y+o.y])}}u.scale(l);for(let t=0;t<=o;t++)x<0?(r.lineTo([a.x+u.x,a.y+u.y]),u.rotateReverse(i,g)):(n.lineTo([a.x+u.x,a.y+u.y]),u.rotate(i,g))}return this._lastTangent1.setCoords(c.x,c.y),this._lastWidth=l,o}}export{x as EffectTaperedPolygon};
|