@arcgis/core 4.34.0-next.43 → 4.34.0-next.45
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/0494e1212dd94d927287.js +1 -0
- package/assets/esri/core/workers/chunks/08840c4d3df711065571.js +1 -0
- package/assets/esri/core/workers/chunks/{42c5d957813080143e5a.js → 09268dc856c3d5ce178f.js} +1 -1
- package/assets/esri/core/workers/chunks/092cb42b88ecfb9c4a07.js +1 -0
- package/assets/esri/core/workers/chunks/0f20c0eec850a39620a1.js +1 -0
- package/assets/esri/core/workers/chunks/129144cbdb3fcbb87baf.js +1 -0
- package/assets/esri/core/workers/chunks/{b40845b45f8d7cd347a1.js → 17df0f766ee1e323d3fa.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf474c055a85bdbfa8d0.js → 19f1bfe815896d4983af.js} +1 -1
- package/assets/esri/core/workers/chunks/2370ff6c3006691ac688.js +1 -0
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb23371335ac049861e6.js → 28a85997c9003cacdefb.js} +1 -1
- package/assets/esri/core/workers/chunks/2942ab268f24cea2e722.js +1 -0
- package/assets/esri/core/workers/chunks/{3a2cbfb03103c402c6c5.js → 2b75212c31145cc07d16.js} +1 -1
- package/assets/esri/core/workers/chunks/{5958598da96464128aed.js → 2f65081bfedeab44d6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/33f3e3d05429f845c139.js +1 -0
- package/assets/esri/core/workers/chunks/{68a69d3fcad6febf55f6.js → 349da65a8793f7873366.js} +6 -6
- package/assets/esri/core/workers/chunks/379a4f664e77ad1fffe9.js +1 -0
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +1 -0
- package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +1 -0
- package/assets/esri/core/workers/chunks/{9aa84b86262fa8334bc4.js → 48514235c32917e43a3f.js} +44 -44
- package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +1 -0
- package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +1 -0
- package/assets/esri/core/workers/chunks/{6759319f3fd2d03c446b.js → 5c556468e2a598ab793a.js} +1 -1
- package/assets/esri/core/workers/chunks/64c31c90e4c589ca2f04.js +1 -0
- package/assets/esri/core/workers/chunks/709dc98379f4ce18a0b5.js +1 -0
- package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +1 -0
- package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +1 -0
- package/assets/esri/core/workers/chunks/{ff34fdda7899e784ac73.js → 7c7338af011b8f0d7218.js} +1 -1
- package/assets/esri/core/workers/chunks/838998bfda90f099c6e9.js +1 -0
- package/assets/esri/core/workers/chunks/84f3e1ce25c36e46fd2a.js +1 -0
- package/assets/esri/core/workers/chunks/863e87ac982d7727b435.js +1 -0
- package/assets/esri/core/workers/chunks/{c6da9ba188b627ab3b79.js → 8aa77a5e82c033512b45.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c2e5e0a70fb5d27da5.js → 8bab4c59c9b644224ecb.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4b145feab275b268c2e.js → 8cc700da2ac58849a708.js} +1 -1
- package/assets/esri/core/workers/chunks/{28d71e1b866113650c75.js → 8e36693e5213c20158d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1acc620bfd2983d6853f.js → 8fae35af98c29bef8500.js} +1 -1
- package/assets/esri/core/workers/chunks/914eaed113dda727eb47.js +1 -0
- package/assets/esri/core/workers/chunks/98175b454e807b1a3c5f.js +1 -0
- package/assets/esri/core/workers/chunks/9a20be3b02c9d6349b8d.js +1 -0
- package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +1 -0
- package/assets/esri/core/workers/chunks/a1ff4c252012d5026133.js +1 -0
- package/assets/esri/core/workers/chunks/{ddeaf688d72b2873c4ac.js → a2a13dd95238bb144479.js} +1 -1
- package/assets/esri/core/workers/chunks/a34d98abcf958a632b0f.js +1 -0
- package/assets/esri/core/workers/chunks/a3a23a56df4e5ee86bb2.js +1 -0
- package/assets/esri/core/workers/chunks/{5ae6e2b3557fe8730072.js → b287624909578d307e07.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b91a49202129eedaf00.js → b4304673696fc0774bff.js} +1 -1
- package/assets/esri/core/workers/chunks/b45772b72f2b8f4fd53f.js +1 -0
- package/assets/esri/core/workers/chunks/c645009f3d2576494bfc.js +1 -0
- package/assets/esri/core/workers/chunks/ce569860b170700e9b31.js +1 -0
- package/assets/esri/core/workers/chunks/cf5db995ba88912cf6b7.js +1 -0
- package/assets/esri/core/workers/chunks/{b85dbefdb09bc6c99e0d.js → cff15600d0ec7b19dffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e99fc78bd0f40a8ba81.js → d1c97fdcba6eb443cb1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{615915e7c48f0a3d0060.js → d547b27ac750953a998f.js} +1 -1
- package/assets/esri/core/workers/chunks/d70e1b8b8bee88a7a5b8.js +353 -0
- package/assets/esri/core/workers/chunks/da396fdbd6f213042aa7.js +1 -0
- package/assets/esri/core/workers/chunks/dbc9bb3011f16ce33f71.js +1 -0
- package/assets/esri/core/workers/chunks/dd0f1e06b7df953ea223.js +1 -0
- package/assets/esri/core/workers/chunks/dd79d3aa6e1a8aee6881.js +1 -0
- package/assets/esri/core/workers/chunks/e1272db232194cbe102c.js +1 -0
- package/assets/esri/core/workers/chunks/{14b536e0c1de6c7422bc.js → e408ccee12bfe089c913.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f2bdb8da5c9ffd7d05e.js → e58336aafe8c95bb6831.js} +1 -1
- package/assets/esri/core/workers/chunks/{30b9c131b69297ee186f.js → e59e09766b130a05c617.js} +1 -1
- package/assets/esri/core/workers/chunks/e65fc26f4384a328a753.js +1 -0
- package/assets/esri/core/workers/chunks/{e3f5afdf133c58b3d161.js → ea262087938335fed19f.js} +1 -1
- package/assets/esri/core/workers/chunks/eafc4da265469e9e5e0b.js +1 -0
- package/assets/esri/core/workers/chunks/{aaab7694eb333ad480f5.js → ec9fd49e0252797f7f6a.js} +1 -1
- package/assets/esri/core/workers/chunks/{655b8d24ffe5405f8ba1.js → f2a2d3cda4a3dc0a8caf.js} +1 -1
- package/assets/esri/core/workers/chunks/f67997250569069ee2ef.js +1 -0
- package/assets/esri/core/workers/chunks/fc3a6f2f99629e57dbbd.js +1 -0
- package/assets/esri/core/workers/chunks/ff9eef1940eaa3406223.js +1 -0
- package/assets/esri/libs/i3s/i3s.wasm +0 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/i3s.js +1 -1
- package/config.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +5 -0
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/ParquetSource.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/ParquetSourceWorker.js +5 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/TemporalSceneLayer.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterDatasets/multipartParser.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
- package/rest/support/AlgorithmicColorRamp.js +1 -1
- package/rest/support/MultipartColorRamp.js +1 -1
- package/smartMapping/statistics/support/statsWorker.js +1 -1
- package/support/revision.js +1 -1
- package/support/zipUtils.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/CIMEffectHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/symbols/cim/placements/CIMMarkerPlacementHelper.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/gfxUtils.js +1 -1
- package/symbols/support/symbolLayerUtils.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/input/handlers/MouseWheelZoom.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +5 -0
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +5 -0
- package/views/3d/support/flow/StreamlineResources3DShape.js +5 -0
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/016d421114118307d4dd.js +0 -1
- package/assets/esri/core/workers/chunks/03df4668002eb4cb4f98.js +0 -1
- package/assets/esri/core/workers/chunks/087ae1e3e767f0e678e5.js +0 -1
- package/assets/esri/core/workers/chunks/0b45566fad2cbb03fea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +0 -1
- package/assets/esri/core/workers/chunks/21dd626a5b5ea6a7e18e.js +0 -1
- package/assets/esri/core/workers/chunks/24e76fa530fc0c495fb5.js +0 -1
- package/assets/esri/core/workers/chunks/2a26c3fc324d672ebe88.js +0 -1
- package/assets/esri/core/workers/chunks/345ed9ac44e47355803e.js +0 -1
- package/assets/esri/core/workers/chunks/3984ca7e05f30724adaf.js +0 -1
- package/assets/esri/core/workers/chunks/439128f23fa091633d2d.js +0 -1
- package/assets/esri/core/workers/chunks/489391ed1d443140617d.js +0 -1
- package/assets/esri/core/workers/chunks/6b73926feb5c5d957062.js +0 -1
- package/assets/esri/core/workers/chunks/774844eea928efa811f2.js +0 -1
- package/assets/esri/core/workers/chunks/7b82ed4cc475c782256b.js +0 -1
- package/assets/esri/core/workers/chunks/7ef29640de297a0cf744.js +0 -1
- package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +0 -353
- package/assets/esri/core/workers/chunks/8c3c752408fac3db05cf.js +0 -1
- package/assets/esri/core/workers/chunks/8ca95499e00ce8b0af9a.js +0 -1
- package/assets/esri/core/workers/chunks/98ac849cccc4d5316021.js +0 -1
- package/assets/esri/core/workers/chunks/9cd9b22354dbdf1b1df0.js +0 -1
- package/assets/esri/core/workers/chunks/a89c060ad302381aaf7d.js +0 -1
- package/assets/esri/core/workers/chunks/af98c7546be409303213.js +0 -1
- package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +0 -1
- package/assets/esri/core/workers/chunks/c110941e87923ba47193.js +0 -1
- package/assets/esri/core/workers/chunks/c47227a626edc1e1ecf1.js +0 -1
- package/assets/esri/core/workers/chunks/c474800508e3ad5ce9d7.js +0 -1
- package/assets/esri/core/workers/chunks/d5d2d4df407cf078bb81.js +0 -1
- package/assets/esri/core/workers/chunks/d93b24e863379116b2aa.js +0 -1
- package/assets/esri/core/workers/chunks/da6f46211551a96dce19.js +0 -1
- package/assets/esri/core/workers/chunks/dd9be173cddc16a354ed.js +0 -1
- package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +0 -1
- package/assets/esri/core/workers/chunks/eb7dd722e4cd7f83b3f5.js +0 -1
- package/assets/esri/core/workers/chunks/f1adf8ebc2c1b93857bf.js +0 -1
- package/assets/esri/core/workers/chunks/fb84fa28978a1820a725.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine.js +0 -5
- package/views/3d/support/flow/StreamlinesResources3D.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Error.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import r from"../Field.js";import o from"../PixelBlock.js";import{getByteCount as a}from"../rasterFormats/pixelRangeUtils.js";import{snapToRaster as s,clip as l}from"../rasterFunctions/clipUtils.js";import{mosaic as c,convertPixelBlockToFeatures as p,getValidPixels as u,countCategoricalPixels as f}from"../rasterFunctions/pixelUtils.js";import{load as m,projectPolygon as x}from"../rasterFunctions/rasterProjectionHelper.js";import{computeBoxStatistics as h,computeStatisticsHistograms as y}from"../rasterFunctions/stretchUtils.js";import{getBandNames as d}from"../../../renderers/support/rasterRendererHelper.js";import w from"../../../rest/support/ImageIdentifyParameters.js";const g=2**30,k=2048,b=2**20,B=20,S=100;async function j(e,t){return"imagery"===e.type?await e.generateRasterInfo(e.rasterFunction,t)??e.serviceRasterInfo:e.raster.rasterInfo}function R(e){const t=[new r({name:"PixelID",alias:"Pixel ID",type:"oid"})],{pixelType:i}=e,n="f32"===i?"single":"f64"===i?"double":"integer";return d(e).forEach(e=>{t.push(new r({name:e,alias:e,type:n}))}),t.map(e=>e.toJSON())}function P(e,t){const i=R(t),n=i.map(({name:e})=>e),r=[],o=n.length-1;for(let a=0;a<e.length;a++){const t=e[a];if(t.pixelValue){const e={objectId:a};for(let i=0;i<o;i++)e[n[i+1]]=t.pixelValue[i];r.push({geometry:t.location,attributes:e})}}return{fields:i,features:r}}async function I(t,i){if(t.spatialReference.equals(i))return t;if("polyline"===t.type){const n=(await import("../../../geometry/operators/projectOperator.js")).execute(t,i);if(null==n)throw new e("read-pixels","failed to project the geometry into the layer's spatial reference");return n}if("extent"===t.type||t.rings[0].length<B){const e=(await import("../../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"})/S;t=(await import("../../../geometry/operators/densifyOperator.js")).execute(t,e,{unit:"meters"}),await m(),t=x(t,i)}return t}async function F(e,t){const{spatialReference:i}=e,r=t?.geometry,o=await I(r??e.extent,i),a="extent"===o.type?o:o.extent,l=null==r||"extent"===r.type&&r.spatialReference.equals(i)?void 0:o,c=new n({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:i}),p=!!t?.autoResample,u=p?c:t?.pixelSize??c;let{extent:f,width:m,height:x}=s(e,a,u);if(!p)return{extent:f,clipGeometry:l,width:m,height:x,pixelSize:u};const h=e.storageInfo?.pyramidScalingFactor??2;let{x:y,y:d}=u;const w=t?.maxPixelCount??b;if(m*x>w)for(;m*x>w;)y*=h,d*=h,m/=h,x/=h;return m=Math.round(m),x=Math.round(x),{extent:f,clipGeometry:l,width:m,height:x,pixelSize:new n({x:y,y:d,spatialReference:i})}}async function*T(e,n,r=!1,o){const{extent:a,clipGeometry:s,width:c,height:p}=n,u=a.width/c,f=a.height/p,m=Math.ceil(c/k),x=Math.ceil(p/k),h=u*k,y=f*k,{xmin:d,xmax:w,ymin:g,ymax:b}=a,B=x*m,S={bandIds:n.bandIds?.length?n.bandIds:void 0,interpolation:"nearest",...o};for(let j=0;j<x;j++)for(let n=0;n<m;n++){t(S);const o=new i({xmin:d+n*h,xmax:r?Math.min(w,d+(n+1)*h):d+(n+1)*h,ymax:b-j*y,ymin:r?Math.max(g,b-(j+1)*y):b-(j+1)*y,spatialReference:a.spatialReference}),c={row:j,col:n},p=j*m+n+1;if(s&&!o.intersects(s)){yield{extent:o,pixelBlock:null,id:c,total:B,current:p};continue}const x=r?Math.round(o.width/u):k,R=r?Math.round(o.height/f):k;let{pixelBlock:P}=await e.fetchPixels(o,x,R,S).catch(()=>({pixelBlock:void 0}));P&&s&&(P=await l(P,o,s)),yield{extent:o,pixelBlock:P,id:c,total:B,current:p}}}async function*v(e,i,n){const r=await j(e,n),o=R(r),a={...i,geometry:i?.geometry??r.extent},s=T(e,await F(r,a),!0,n),l=r.width;for await(const c of s){if(!c.pixelBlock){yield{...c};continue}const a=K(e),{pixelBlock:s}=c,{statistics:p,histograms:u}=await V({pixelBlock:s,rasterJobHandler:a},n),f=c;f.statistics=p,f.histograms=u;const m=c.id.row*r.width*k+c.id.col*k;t(n),f.featureSet=await W({pixelBlock:s,extent:c.extent,fields:o,skipFactor:i?.skipFactor??1,rasterJobHandler:a,pixelIdOffset:m,imageRowSize:l},n),t(n),yield f}}function M(t,i,n){const r=a(i),{width:o,height:s}=t;if(o*s*r>g)throw new e("fetch-pixels","failed to fetch pixels as pixel byte count exceeds the 1GB limit");if(n&&o*s>n)throw new e("fetch-pixels",`failed to fetch pixels as pixel count exceeds the ${n} limit`)}async function z(t,i,n){if(!i.geometry)throw new e("fetch-pixels","geometry is required to fetch pixel feature set");const r=await j(t),o=await F(r,i);M(o,r.pixelType);const{extent:a,pixelSize:s}=o,l=Math.round(r.extent.width/s.x),c=R(r),p={fields:c,features:[]},u=p.features,f=T(t,o,!1,n);for await(const e of f){if(!e.pixelBlock)continue;const o=K(t),a=Math.floor((r.extent.ymax-e.extent.ymax)/s.y)*l+Math.floor((e.extent.xmin-r.extent.xmin)/s.x),p=await W({pixelBlock:e.pixelBlock,extent:e.extent,fields:c,skipFactor:i?.skipFactor??1,rasterJobHandler:o,pixelIdOffset:a,imageRowSize:l},n);if(p?.features?.length){const{features:e}=p,t=e.length;for(let i=0;i<t;i++){const t=e.pop();u.push(t)}}}return{extent:a,featureSet:p,pixelSize:s}}async function H(e,t,i){const{geometry:n}=t;if("multipoint"===n.type)return O(e,n,i);if("polyline"===n.type)return q(e,n,i);const r=await L(e,{geometry:n},i);if(!r)return null;return h(r)}async function O(e,t,i){const n=await j(e,i),r=t.points.map((e,i)=>t.getPoint(i)).map(t=>C(e,t,i)),a=(await Promise.all(r)).filter(e=>null!=e);if(a.length<=1)return J(a[0]);const s=a[0].map((e,t)=>a.map(e=>e[t]));return h(new o({pixels:s,pixelType:n.pixelType}))}async function C(e,t,i){if("imagery"===e.type){const n=await e.identify(new w({geometry:t,returnCatalogItems:!1}),i).catch(()=>null);return null==n?.value||n.value.includes("NoData")?null:n.value.replaceAll(", "," ").split(" ").map(e=>Number(e))}const n=await e.identify(t,i).catch(()=>null);return n?.value}function J(e){return e?.map(e=>({min:e,max:e,avg:e,median:e,quartile1:e,quartile3:e}))}async function q(e,t,i){const n=await D(e,{geometry:t},i),r=await j(e,i),{bandCount:a,pixelType:s}=r,l=new Array(a).map(()=>o.createEmptyBand(s,n.length));let c=0;for(let o=0;o<n.length;o++){const e=n[o];if(null!=e.value){c++;for(let t=0;t<a;t++)l[t][o]=e.value[t]}}c!==n.length&&l.forEach((e,t)=>{l[t]=e.subarray(0,c)});return h(new o({pixels:l,pixelType:s}))}async function E(t,i,n){const r=await j(t,n);if(!r.attributeTable||!r.pixelType.startsWith("u"))return null;const o=r.attributeTable.clone(),a=o.fields.find(e=>"value"===e.name.toLowerCase()),s=o.fields.find(e=>"count"===e.name.toLowerCase());if(!a||!s)throw new e("compute-attribute-table","Value or count field not found in attribute table");const l=2**Number(r.pixelType.slice(1)),c=new Uint32Array(l),{geometry:p}=i;return await G(t,p,(e,t)=>f(e,c),n),o.features.forEach(e=>{const t=e.attributes[a.name];e.attributes[s.name]=c[t]}),o}async function N(e,t,i){const{geometry:n}=t;if("point"===n.type)return C(e,n,i);if("multipoint"===n.type){const t=n.points.map((e,t)=>n.getPoint(t)).map(t=>C(e,t,i)),r=(await Promise.all(t)).filter(e=>null!=e);if(0===r.length)return null;return U(r).map(e=>e/r.length)}const r=await G(e,n,(e,t)=>A(e),i),o=r?.filter(e=>e.count>0);if(!o?.length)return null;const a=U(o.map(e=>e.bandSum)),s=o.map(e=>e.count).reduce((e,t)=>e+t);return a.map(e=>e/s)}function U(e){return e.reduce((e,t)=>e.map((e,i)=>e+t[i]))}function A(e){const{width:t,height:i,pixels:n,mask:r}=e,o=new Array(n.length).fill(0);let a=0;for(let s=0;s<i;s++)for(let e=0;e<t;e++){const i=s*t+e;if(!r||r[i]){for(let e=0;e<n.length;e++)o[e]+=n[e][i];a++}}return{bandSum:o,count:a}}async function D(e,t,i){const n=await G(e,t.geometry,u,i);return n?.flat()??[]}async function G(i,n,r,o){const a=i.spatialReference;if("polyline"===n.type&&!n.spatialReference.equals(a)){const t=(await import("../../../geometry/operators/projectOperator.js")).execute(n,a);if(null==t)throw new e("read-pixels","failed to fetch pixels");n=t}const s="polyline"===n.type?n.extent:n,c=await I(s,a),p="polyline"===n.type?n:c,u=await j(i,o),f={geometry:c,autoResample:!1},m=[],x=T(i,await F(u,f),!0,o);for await(const e of x){if(!e.pixelBlock)continue;const{extent:i}=e,n=r(await l(e.pixelBlock,i,p),i);m.push(n),t(o)}return m}async function V(e,t){const{rasterJobHandler:i}=e,{pixelBlock:n}=e,{statistics:r,histograms:o}=i?await i.computeStatisticsHistograms({pixelBlock:n},t):y(n);return{statistics:r,histograms:o}}async function W(e,t){const{extent:i,fields:n,skipFactor:r,rasterJobHandler:o,pixelIdOffset:a,imageRowSize:s}=e,{pixelBlock:l}=e,c=n.map(({name:e})=>e),u=o?await o.convertPixelBlockToFeatures({pixelBlock:l,extent:i,fieldNames:c,skipFactor:r,pixelIdOffset:a,imageRowSize:s},t):p({pixelBlock:l,extent:i,fieldNames:c,skipFactor:r,pixelIdOffset:a,imageRowSize:s});return u?{fields:n,features:u}:void 0}function K(e){return"_rasterJobHandler"in e?e._rasterJobHandler:null}async function L(e,t,i){const n=await j(e);t={...t,maxPixelCount:t.maxPixelCount??2**28};const r=await F(n,t);M(r,n.pixelType,t.maxPixelCount);const o=[],a=T(e,r,!1,i);for await(const c of a)o.push(c.pixelBlock);if(!o.some(e=>null!=e))return null;const{width:s,height:l}=r,p=Math.ceil(s/k),u=Math.ceil(l/k),f={width:p*k,height:u*k};let m;const x=K(e);if(x){const e=await x.mosaicAndTransform({srcPixelBlocks:o,srcMosaicSize:f,destDimension:f},{...i,transferPixelsToWorker:!0});m=e?.pixelBlock}else m=c(o,f);return m}async function _(t,i,n){if(!i.geometry)throw new e("compute-statistics-histograms","geometry is required to fetch pixel feature set");const r=await L(t,i,n);if(!r)throw new e("compute-statistics-histograms","failed to get intersecting pixels");const o=K(t);return o?await o.computeStatisticsHistograms({pixelBlock:r,includeSkewnessKurtosis:!0},{...n,transferPixelsToWorker:!0}):y(r,{includeSkewnessKurtosis:!0})}export{H as computeBoxStatistics,E as computeRasterAttributeTable,_ as computeStatisticsHistograms,P as convertPixelSampleResultToFeatureSet,v as createPixelFeatureSetCursor,L as fetchLargePixelBlock,z as fetchPixelFeatureSet,N as identifyAveragePixelValue,D as readIntersectingPixels};
|
|
5
|
+
import e from"../../../core/Error.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import r from"../Field.js";import o from"../PixelBlock.js";import{getByteCount as a}from"../rasterFormats/pixelRangeUtils.js";import{snapToRaster as s,clip as l}from"../rasterFunctions/clipUtils.js";import{mosaic as c,convertPixelBlockToFeatures as p,getValidPixels as u,countCategoricalPixels as f}from"../rasterFunctions/pixelUtils.js";import{load as m,projectPolygon as x}from"../rasterFunctions/rasterProjectionHelper.js";import{computeBoxStatistics as h,computeStatisticsHistograms as y}from"../rasterFunctions/stretchUtils.js";import{getBandNames as d}from"../../../renderers/support/rasterRendererHelper.js";import w from"../../../rest/support/ImageIdentifyParameters.js";const g=2**30,k=2048,b=2**20,B=20,S=100;async function j(e,t){return"imagery"===e.type?await e.generateRasterInfo(e.rasterFunction,t)??e.serviceRasterInfo:e.raster.rasterInfo}function R(e){const t=[new r({name:"PixelID",alias:"Pixel ID",type:"oid"})],{pixelType:i}=e,n="f32"===i?"single":"f64"===i?"double":"integer";return d(e).forEach(e=>{t.push(new r({name:e,alias:e,type:n}))}),t.map(e=>e.toJSON())}function P(e,t){const i=R(t),n=i.map(({name:e})=>e),r=[],o=n.length-1;for(let a=0;a<e.length;a++){const t=e[a];if(t.pixelValue){const e={objectId:a};for(let i=0;i<o;i++)e[n[i+1]]=t.pixelValue[i];r.push({geometry:t.location,attributes:e})}}return{fields:i,features:r}}async function I(t,i){if(t.spatialReference.equals(i))return t;if("polyline"===t.type){const n=(await import("../../../geometry/operators/projectOperator.js")).execute(t,i);if(null==n)throw new e("read-pixels","failed to project the geometry into the layer's spatial reference");return n}if("extent"===t.type||t.rings[0].length<B){const e=(await import("../../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"})/S;t=(await import("../../../geometry/operators/densifyOperator.js")).execute(t,e,{unit:"meters"}),await m(),t=x(t,i)}return t}async function F(e,t){const{spatialReference:i}=e,r=t?.geometry,o=await I(r??e.extent,i),a="extent"===o.type?o:o.extent,l=null==r||"extent"===r.type&&r.spatialReference.equals(i)?void 0:o,c=new n({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:i}),p=!!t?.autoResample,u=p?c:t?.pixelSize??c;let{extent:f,width:m,height:x}=s(e,a,u);if(!p)return{extent:f,clipGeometry:l,width:m,height:x,pixelSize:u};const h=e.storageInfo?.pyramidScalingFactor??2;let{x:y,y:d}=u;const w=t?.maxPixelCount??b;if(m*x>w)for(;m*x>w;)y*=h,d*=h,m/=h,x/=h;return m=Math.round(m),x=Math.round(x),{extent:f,clipGeometry:l,width:m,height:x,pixelSize:new n({x:y,y:d,spatialReference:i})}}async function*T(e,n,r=!1,o){const{extent:a,clipGeometry:s,width:c,height:p}=n,u=a.width/c,f=a.height/p,m=Math.ceil(c/k),x=Math.ceil(p/k),h=u*k,y=f*k,{xmin:d,xmax:w,ymin:g,ymax:b}=a,B=x*m,S={bandIds:n.bandIds?.length?n.bandIds:void 0,interpolation:"nearest",...o};for(let j=0;j<x;j++)for(let n=0;n<m;n++){t(S);const o=new i({xmin:d+n*h,xmax:r?Math.min(w,d+(n+1)*h):d+(n+1)*h,ymax:b-j*y,ymin:r?Math.max(g,b-(j+1)*y):b-(j+1)*y,spatialReference:a.spatialReference}),c={row:j,col:n},p=j*m+n+1;if(s&&!o.intersects(s)){yield{extent:o,pixelBlock:null,id:c,total:B,current:p};continue}const x=r?Math.round(o.width/u):k,R=r?Math.round(o.height/f):k;let{pixelBlock:P}=await e.fetchPixels(o,x,R,S).catch(()=>({pixelBlock:void 0}));P&&s&&(P=await l(P,o,s)),yield{extent:o,pixelBlock:P,id:c,total:B,current:p}}}async function*v(e,i,n){const r=await j(e,n),o=R(r),a={...i,geometry:i?.geometry??r.extent},s=T(e,await F(r,a),!0,n),l=r.width;for await(const c of s){if(!c.pixelBlock){yield{...c};continue}const a=K(e),{pixelBlock:s}=c,{statistics:p,histograms:u}=await V({pixelBlock:s,rasterJobHandler:a},n),f=c;f.statistics=p,f.histograms=u;const m=c.id.row*r.width*k+c.id.col*k;t(n),f.featureSet=await W({pixelBlock:s,extent:c.extent,fields:o,skipFactor:i?.skipFactor??1,rasterJobHandler:a,pixelIdOffset:m,imageRowSize:l},n),t(n),yield f}}function M(t,i,n){const r=a(i),{width:o,height:s}=t;if(o*s*r>g)throw new e("fetch-pixels","failed to fetch pixels as pixel byte count exceeds the 1GB limit");if(n&&o*s>n)throw new e("fetch-pixels",`failed to fetch pixels as pixel count exceeds the ${n} limit`)}async function z(t,i,n){if(!i.geometry)throw new e("fetch-pixels","geometry is required to fetch pixel feature set");const r=await j(t),o=await F(r,i);M(o,r.pixelType);const{extent:a,pixelSize:s}=o,l=Math.round(r.extent.width/s.x),c=R(r),p={fields:c,features:[]},u=p.features,f=T(t,o,!1,n);for await(const e of f){if(!e.pixelBlock)continue;const o=K(t),a=Math.floor((r.extent.ymax-e.extent.ymax)/s.y)*l+Math.floor((e.extent.xmin-r.extent.xmin)/s.x),p=await W({pixelBlock:e.pixelBlock,extent:e.extent,fields:c,skipFactor:i?.skipFactor??1,rasterJobHandler:o,pixelIdOffset:a,imageRowSize:l},n);if(p?.features?.length){const{features:e}=p,t=e.length;for(let i=0;i<t;i++){const t=e.pop();u.push(t)}}}return{extent:a,featureSet:p,pixelSize:s}}async function H(e,t,i){const{geometry:n}=t;if("multipoint"===n.type)return O(e,n,i);if("polyline"===n.type)return q(e,n,i);const r=await L(e,{geometry:n},i);if(!r)return null;return h(r)}async function O(e,t,i){const n=await j(e,i),r=t.points.map((e,i)=>t.getPoint(i)).map(t=>C(e,t,i)),a=(await Promise.all(r)).filter(e=>null!=e);if(a.length<=1)return J(a[0]);const s=a[0].map((e,t)=>a.map(e=>e[t]));return h(new o({pixels:s,pixelType:n.pixelType}))}async function C(e,t,i){if("imagery"===e.type){const n=await e.identify(new w({geometry:t,returnCatalogItems:!1}),i).catch(()=>null);return null==n?.value||n.value.includes("NoData")?null:n.value.replaceAll(", "," ").split(" ").map(e=>Number(e))}const n=await e.identify(t,i).catch(()=>null);return n?.value}function J(e){return e?.map(e=>({min:e,max:e,avg:e,median:e,quartile1:e,quartile3:e}))}async function q(e,t,i){const n=await D(e,{geometry:t},i),r=await j(e,i),{bandCount:a,pixelType:s}=r,l=new Array(a).fill(0).map(()=>o.createEmptyBand(s,n.length));let c=0;for(let o=0;o<n.length;o++){const e=n[o];if(null!=e.value){c++;for(let t=0;t<a;t++)l[t][o]=e.value[t]}}c!==n.length&&l.forEach((e,t)=>{l[t]=e.subarray(0,c)});return h(new o({pixels:l,pixelType:s}))}async function E(t,i,n){const r=await j(t,n);if(!r.attributeTable||!r.pixelType.startsWith("u"))return null;const o=r.attributeTable.clone(),a=o.fields.find(e=>"value"===e.name.toLowerCase()),s=o.fields.find(e=>"count"===e.name.toLowerCase());if(!a||!s)throw new e("compute-attribute-table","Value or count field not found in attribute table");const l=2**Number(r.pixelType.slice(1)),c=new Uint32Array(l),{geometry:p}=i;return await G(t,p,(e,t)=>f(e,c),n),o.features.forEach(e=>{const t=e.attributes[a.name];e.attributes[s.name]=c[t]}),o}async function N(e,t,i){const{geometry:n}=t;if("point"===n.type)return C(e,n,i);if("multipoint"===n.type){const t=n.points.map((e,t)=>n.getPoint(t)).map(t=>C(e,t,i)),r=(await Promise.all(t)).filter(e=>null!=e);if(0===r.length)return null;return U(r).map(e=>e/r.length)}const r=await G(e,n,(e,t)=>A(e),i),o=r?.filter(e=>e.count>0);if(!o?.length)return null;const a=U(o.map(e=>e.bandSum)),s=o.map(e=>e.count).reduce((e,t)=>e+t);return a.map(e=>e/s)}function U(e){return e.reduce((e,t)=>e.map((e,i)=>e+t[i]))}function A(e){const{width:t,height:i,pixels:n,mask:r}=e,o=new Array(n.length).fill(0);let a=0;for(let s=0;s<i;s++)for(let e=0;e<t;e++){const i=s*t+e;if(!r||r[i]){for(let e=0;e<n.length;e++)o[e]+=n[e][i];a++}}return{bandSum:o,count:a}}async function D(e,t,i){const n=await G(e,t.geometry,u,i);return n?.flat()??[]}async function G(i,n,r,o){const a=i.spatialReference;if("polyline"===n.type&&!n.spatialReference.equals(a)){const t=(await import("../../../geometry/operators/projectOperator.js")).execute(n,a);if(null==t)throw new e("read-pixels","failed to fetch pixels");n=t}const s="polyline"===n.type?n.extent:n,c=await I(s,a),p="polyline"===n.type?n:c,u=await j(i,o),f={geometry:c,autoResample:!1},m=[],x=T(i,await F(u,f),!0,o);for await(const e of x){if(!e.pixelBlock)continue;const{extent:i}=e,n=r(await l(e.pixelBlock,i,p),i);m.push(n),t(o)}return m}async function V(e,t){const{rasterJobHandler:i}=e,{pixelBlock:n}=e,{statistics:r,histograms:o}=i?await i.computeStatisticsHistograms({pixelBlock:n},t):y(n);return{statistics:r,histograms:o}}async function W(e,t){const{extent:i,fields:n,skipFactor:r,rasterJobHandler:o,pixelIdOffset:a,imageRowSize:s}=e,{pixelBlock:l}=e,c=n.map(({name:e})=>e),u=o?await o.convertPixelBlockToFeatures({pixelBlock:l,extent:i,fieldNames:c,skipFactor:r,pixelIdOffset:a,imageRowSize:s},t):p({pixelBlock:l,extent:i,fieldNames:c,skipFactor:r,pixelIdOffset:a,imageRowSize:s});return u?{fields:n,features:u}:void 0}function K(e){return"_rasterJobHandler"in e?e._rasterJobHandler:null}async function L(e,t,i){const n=await j(e);t={...t,maxPixelCount:t.maxPixelCount??2**28};const r=await F(n,t);M(r,n.pixelType,t.maxPixelCount);const o=[],a=T(e,r,!1,i);for await(const c of a)o.push(c.pixelBlock);if(!o.some(e=>null!=e))return null;const{width:s,height:l}=r,p=Math.ceil(s/k),u=Math.ceil(l/k),f={width:p*k,height:u*k};let m;const x=K(e);if(x){const e=await x.mosaicAndTransform({srcPixelBlocks:o,srcMosaicSize:f,destDimension:f},{...i,transferPixelsToWorker:!0});m=e?.pixelBlock}else m=c(o,f);return m}async function _(t,i,n){if(!i.geometry)throw new e("compute-statistics-histograms","geometry is required to fetch pixel feature set");const r=await L(t,i,n);if(!r)throw new e("compute-statistics-histograms","failed to get intersecting pixels");const o=K(t);return o?await o.computeStatisticsHistograms({pixelBlock:r,includeSkewnessKurtosis:!0},{...n,transferPixelsToWorker:!0}):y(r,{includeSkewnessKurtosis:!0})}export{H as computeBoxStatistics,E as computeRasterAttributeTable,_ as computeStatisticsHistograms,P as convertPixelSampleResultToFeatureSet,v as createPixelFeatureSetCursor,L as fetchLargePixelBlock,z as fetchPixelFeatureSet,N as identifyAveragePixelValue,D as readIntersectingPixels};
|
package/libs/parquet/parquet.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../request.js";import t from"../../core/Error.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as r,GeometryInfo as o,GeometryType as a,PrimaryGeometryField as i}from"../../chunks/bundle.js";const s=t=>async function(n,r,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(n,{responseType:"array-buffer",query:s,headers:{range:`bytes=${r}-${o}`}});return u},u=t=>async function(n){const{data:r}=await e(n,{responseType:"native",method:"head",query:t?.()}),o=r.headers.get("Content-Length");if(null==o)throw new Error("Unable to parse content length");return parseInt(o,10)};function l(e){switch(e){case"esriGeometryPoint":return a.Point;case"esriGeometryPolygon":return a.Polygon;case"esriGeometryPolyline":return a.Polyline;case"esriGeometryMultipoint":return a.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function c(e){switch(e.encoding.type){case"wkb":return i.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:n}=e.encoding;return i.fromLocation(t,n)}}}function m(e,n){const a=e.spatialReference.wkid,i=n.wkid;if(!a||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=l(e.geometryType),u=c(e),m=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,n]=e.transform.translate,[o,a]=e.transform.scale,i=new Float64Array([t,n]),s=new Float64Array([o,a]);m.push(r.new(e.level,e.column,i,s))}}return o.new(s,a,i,u,m)}async function f(e,t={}){const{ParquetFile:r}=await n(),o=s(t.getCustomParameters),a=u(t.getCustomParameters),i=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference):null;return r.fromUrl(e,o,a,i)}async function y(e,t={}){const{ParquetFile:r}=await n(),o=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference):null;return r.fromBinary(e,o)}function d(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function p(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{f as createParquetFile,y as createParquetFileFromBytes,p as readEsriMetadata,d as readGeoMetadata};
|
|
5
|
+
import e from"../../request.js";import t from"../../core/Error.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as r,GeometryInfo as o,GeometryType as a,PrimaryGeometryField as i}from"../../chunks/bundle.js";const s=t=>async function(n,r,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(n,{responseType:"array-buffer",query:s,headers:{range:`bytes=${r}-${o}`}});return u},u=t=>async function(n){const{data:r}=await e(n,{responseType:"native",method:"head",query:t?.()}),o=r.headers.get("Content-Length");if(null==o)throw new Error("Unable to parse content length");return parseInt(o,10)};function l(e){switch(e){case"esriGeometryPoint":return a.Point;case"esriGeometryPolygon":return a.Polygon;case"esriGeometryPolyline":return a.Polyline;case"esriGeometryMultipoint":return a.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function c(e){switch(e.encoding.type){case"wkb":return i.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:n}=e.encoding;return i.fromLocation(t,n)}}}function m(e,n){const a=e.spatialReference.wkid,i=n.wkid;if(!a||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=l(e.geometryType),u=c(e),m=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,n]=e.transform.translate,[o,a]=e.transform.scale,i=new Float64Array([t,n]),s=new Float64Array([o,a]);m.push(r.new(e.level,e.column,i,s))}}return o.new(s,a,i,u,m)}async function f(e,t={}){const{ParquetFile:r}=await n(),o=s(t.getCustomParameters),a=u(t.getCustomParameters),i=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference??t.geometryInfo.spatialReference):null;return r.fromUrl(e,o,a,i)}async function y(e,t={}){const{ParquetFile:r}=await n(),o=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference):null;return r.fromBinary(e,o)}function d(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function p(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{f as createParquetFile,y as createParquetFileFromBytes,p as readEsriMetadata,d as readGeoMetadata};
|
package/networks/RulesTable.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../request.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as r}from"../core/Loadable.js";import{sqlIn as o,sqlAnd as n,sqlOr as i}from"../core/sql.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 c}from"../core/accessorSupport/decorators/subclass.js";import{getAssetFieldNames as u,getRuleValues as p,getCompatibleRuleElements as l,getFeatureSourceLayerId as d,doesRuleAllowAssociation as y}from"./support/utils.js";import{isGraphic as h}from"../support/guards.js";let f=class extends(s(r)){constructor(e){super(e),this.rulesCategorized={attachment:[],containment:[],connectivity:[]},this.request=t}initialize(){}async load(e){const t=this.rulesLayer.load(e).then(()=>this._initializeRulesTable());return this.addResolvingPromise(t),this}getFeaturesCanAssociateWithClause(e,t,s){const r=new Map,[i,a]=u(e.sourceLayer);if(!i||!a)return"";const c=p(e),d=p(t);s.forEach(e=>{const{type:t,direction:s}=e;this._getRulesForAssociationType(t).forEach(e=>{l(e,c,s).filter(e=>e.networkSource?.layerId===d.layerId).forEach(e=>{const t=e.assetGroup?.assetGroupCode,s=e.assetType?.assetTypeCode;if(null!=t&&null!=s){const e=r.get(t)??new Set;e.add(s),r.set(t,e)}})})});let y=[];return this._mergeAssetCodes(r).forEach((e,t)=>{const s=`${i} IN (${t})`,r=o(a,[...e]);s&&r&&y.push(n(s,r))}),y.length>1&&(y=y.map(e=>`(${e})`)),y.join(" OR ")}getFeaturesCanAssociateWith(e,t,s){return null==d(e)?[]:t.filter(t=>this.canAssociateFeatures(e,t,s))}canAssociateFeatures(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const r=p(e),o=p(t);return s.some(e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some(e=>"to"===s?y(e,o,r):y(e,r,o))})}getLayersCanAssociateWith(e,t,s){return null==d(e)?[]:t.filter(t=>this.canAssociateFeatureToLayer(e,t,s))}canAssociateFeatureToLayer(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const r=p(e),o=p(t);return s.some(e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some(e=>"to"===s?y(e,o,r):y(e,r,o))})}getFeatureSQL(e,t){const s=e.layerId.toString(),r=e.fieldsIndex?.normalizeFieldName("assetGroup"),o=e.fieldsIndex?.normalizeFieldName("assetType"),n=r?t.attributes[r]:null,i=o?t.attributes[o]:null,a=this.rulesHash[s];if(a){const e=a.assetGroupHash[n];if(e){return e.assetTypeHash[i]||null}}return null}
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../request.js";import{JSONSupportMixin as s}from"../core/JSONSupport.js";import{Loadable as r}from"../core/Loadable.js";import{sqlIn as o,sqlAnd as n,sqlOr as i}from"../core/sql.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 c}from"../core/accessorSupport/decorators/subclass.js";import{getAssetFieldNames as u,getRuleValues as p,getCompatibleRuleElements as l,getFeatureSourceLayerId as d,doesRuleAllowAssociation as y}from"./support/utils.js";import{isGraphic as h}from"../support/guards.js";let f=class extends(s(r)){constructor(e){super(e),this.rulesCategorized={attachment:[],containment:[],connectivity:[]},this.request=t}initialize(){}async load(e){const t=this.rulesLayer.load(e).then(()=>this._initializeRulesTable());return this.addResolvingPromise(t),this}getFeaturesCanAssociateWithClause(e,t,s){const r=new Map,[i,a]=u(e.sourceLayer);if(!i||!a)return"";const c=p(e),d=p(t);s.forEach(e=>{const{type:t,direction:s}=e;this._getRulesForAssociationType(t).forEach(e=>{l(e,c,s).filter(e=>e.networkSource?.layerId===d.layerId).forEach(e=>{const t=e.assetGroup?.assetGroupCode,s=e.assetType?.assetTypeCode;if(null!=t&&null!=s){const e=r.get(t)??new Set;e.add(s),r.set(t,e)}})})});let y=[];return this._mergeAssetCodes(r).forEach((e,t)=>{const s=`${i} IN (${t})`,r=o(a,[...e]);s&&r&&y.push(n(s,r))}),y.length>1&&(y=y.map(e=>`(${e})`)),y.join(" OR ")}getFeaturesCanAssociateWith(e,t,s){return null==d(e)?[]:t.filter(t=>this.canAssociateFeatures(e,t,s))}canAssociateFeatures(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const r=p(e),o=p(t);return s.some(e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some(e=>"to"===s?y(e,o,r):y(e,r,o))})}getLayersCanAssociateWith(e,t,s){return null==d(e)?[]:t.filter(t=>this.canAssociateFeatureToLayer(e,t,s))}canAssociateFeatureToLayer(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const r=p(e),o=p(t);return s.some(e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some(e=>"to"===s?y(e,o,r):y(e,r,o))})}getFeatureSQL(e,t){const s=e.layerId.toString(),r=e.fieldsIndex?.normalizeFieldName("assetGroup"),o=e.fieldsIndex?.normalizeFieldName("assetType"),n=r?t.attributes[r]:null,i=o?t.attributes[o]:null,a=this.rulesHash[s];if(a){const e=a.assetGroupHash[n];if(e){return e.assetTypeHash[i]||null}}return null}_initializeRulesTable(){const e={},t=[{networkSourceId:"fromNetworkSource",assetGroupId:"fromAssetGroup",assetTypeId:"fromAssetType"},{networkSourceId:"toNetworkSource",assetGroupId:"toAssetGroup",assetTypeId:"toAssetType"},{networkSourceId:"viaNetworkSource",assetGroupId:"viaAssetGroup",assetTypeId:"viaAssetType"}];this.rulesCategorized={attachment:[],containment:[],connectivity:[]};for(const s of this.rules){if(3===s.ruleType){this.rulesCategorized.attachment.push(s);continue}if(2===s.ruleType){this.rulesCategorized.containment.push(s);continue}if(1===s.ruleType){this.rulesCategorized.connectivity.push(s);continue}this.rulesCategorized.connectivity.push(s);let r=[[0,1],[1,0]];5===s.ruleType&&(r=[[0,2],[2,0],[1,2],[2,1]]);for(const o of r){const r=o.shift(),a=o.shift();let c=!1;switch(s.ruleType){case 5:c=0===r||1===r;break;case 4:c=1===r}const u=t[r],p=s[u.networkSourceId]?.layerId.toString()??"",l=s[u.assetGroupId]?.assetGroupCode?.toString(),d=s[u.assetTypeId],y=d?.assetTypeCode?.toString(),h=t[a],f=s[h.networkSourceId]?.layerId.toString()??"",m=s[h.assetGroupId]?.assetGroupCode?.toString(),g=s[h.assetTypeId],T=g?.assetTypeCode?.toString(),S=e[p]??{assetGroupHash:{}};if(!(l&&y&&m&&T))continue;const v=S.assetGroupHash[l]??{assetTypeHash:{}},A=v.assetTypeHash[y]??{};if(A[f]=A[f]??{},c){A[p]=A[p]??{};const e=n(`assetgroup = ${l}`,`assettype = ${y}`);"esriNECPEndVertex"===g?.connectivityPolicy?A[p].endVertex=A[p]?.endVertex?`${A[p].endVertex}`:`(${e})`:A[p].anyVertex=A[p].anyVertex?`${A[p].anyVertex}`:`(${e})`}const C=n(`assetgroup = ${m}`,`assettype = ${T}`);"esriNECPEndVertex"===g?.connectivityPolicy?A[f].endVertex=A[f]?.endVertex?i(A[f].endVertex,C):`(${C})`:A[f].anyVertex=A[f]?.anyVertex?i(A[f].anyVertex,C):`(${C})`,v.assetTypeHash[y]=A,S.assetGroupHash[l]=v,e[p]=S}}this._set("rulesHash",e)}_getRulesForAssociationType(e){const{rulesCategorized:t}=this;switch(e){case"attachment":return t.attachment;case"containment":return t.containment;case"connectivity":case"junction-junction-connectivity":return t.connectivity.filter(e=>1===e.ruleType);case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":return t.connectivity.filter(e=>4===e.ruleType||5===e.ruleType);default:return[]}}_areSetsEqual(e,t){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}_mergeAssetCodes(e){const t=new Map,s=new Set;for(const[r,o]of e){const n=new Set([r]);for(const[t,a]of e)r!==t&&!s.has(t)&&this._areSetsEqual(o,a)&&(n.add(t),s.add(t));const i=Array.from(n).sort().join(",");t.set(i,o)}return t}_canSupportAssociations(e){return e.every(e=>{const t=h(e)?e.sourceLayer:e,[s,r]=u(t);return null!=s&&null!=r})}};e([a({constructOnly:!0})],f.prototype,"rulesLayer",void 0),e([a({constructOnly:!0})],f.prototype,"rules",void 0),e([a({readOnly:!0})],f.prototype,"rulesHash",void 0),e([a()],f.prototype,"rulesCategorized",void 0),e([a({constructOnly:!0})],f.prototype,"request",void 0),f=e([c("esri.networks.RulesTable")],f);export{f as default};
|
package/package.json
CHANGED