@arcgis/core 5.1.0-next.100 → 5.1.0-next.101
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/{d345030a89914348d3c5.js → 00a25dd4b057cc9f2a7e.js} +1 -1
- package/assets/esri/core/workers/chunks/0d81409721d29d8bc276.js +1 -0
- package/assets/esri/core/workers/chunks/{6881ae969b48bd04f064.js → 156efa014b6edd9ccce9.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b2e5628d08d0e3108d2.js → 17de1c251242b692cf45.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ad7c221ad317706387a.js → 22fa4aa2b76573bafe21.js} +1 -1
- package/assets/esri/core/workers/chunks/{40137b23d8ad4af7ff9c.js → 3996149146dd1eca7cc5.js} +1 -1
- package/assets/esri/core/workers/chunks/{fff4b9e43464ebb3fb4e.js → 40ffb1aa17cbfae17b23.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8d10d8db44c7c6acebe.js → 48a0e7a32ebd44045c8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js → 53bf9b0c2b8da12820ea.js} +2 -2
- package/assets/esri/core/workers/chunks/{0253292939b981134663.js → 5b07f3253403fe25ce5b.js} +1 -1
- package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +1 -0
- package/assets/esri/core/workers/chunks/{df232b8aa77f7e3285e3.js → 657268b3fde6da2dd735.js} +1 -1
- package/assets/esri/core/workers/chunks/{889a0405e3cdfa59b8e7.js → 7bb17d0ab1cc2b89c035.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6b6f190687813267d77.js → 7db09c5bf024242becfa.js} +1 -1
- package/assets/esri/core/workers/chunks/{07ddf1b1f7602063ceb0.js → 8f9117d589de7caaa02d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9478a0478fb49a88685e.js → 99f726f05cf80b0330ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{490e4a648cb2ab3e7956.js → a318cf6bb900e0ee268c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js → a58662698c69190a12d8.js} +2 -2
- package/assets/esri/core/workers/chunks/{3ba29e7cf9fba3aa5f41.js → b1b8a7c00ec4d998ab84.js} +1 -1
- package/assets/esri/core/workers/chunks/{9940b318f38ea9d7a533.js → bafe489e54f34d1841e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{765ee0f2bfcec6d5bcc6.js → bc6a809a965355eb425f.js} +1 -1
- package/assets/esri/core/workers/chunks/{53ff47c06ccfc0be885c.js → d30790c69724258dab2b.js} +1 -1
- package/chunks/GaussianSplatShadow.glsl.js +39 -0
- package/chunks/GlobalIllumination.glsl.js +1 -1
- package/config.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/KnowledgeGraphLayer.d.ts +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +73 -24
- package/layers/ParquetLayer.js +1 -1
- package/layers/SceneLayer.d.ts +2 -2
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -1
- package/layers/support/ParquetFilesData.d.ts +46 -0
- package/layers/support/ParquetFilesData.js +2 -0
- package/layers/support/ParquetPortalItemData.d.ts +25 -0
- package/layers/support/ParquetPortalItemData.js +2 -0
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/types.d.ts +9 -0
- package/networks/UtilityNetworkTraceAnalysis.d.ts +1 -1
- package/networks/UtilityNetworkTraceAnalysis.js +1 -1
- package/package.json +3 -3
- package/renderers/support/ClassBreakInfo.d.ts +3 -3
- package/renderers/support/ClassBreakInfo.js +1 -1
- package/renderers/support/UniqueValueInfo.d.ts +3 -3
- package/renderers/support/UniqueValueInfo.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +5 -2
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +2 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +2 -0
- package/views/3d/webgl.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/26f28406056ddc0e159c.js +0 -1
- package/assets/esri/core/workers/chunks/b06cc59068d32baaaa87.js +0 -1
- /package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js.LICENSE.txt → 53bf9b0c2b8da12820ea.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js.LICENSE.txt → a58662698c69190a12d8.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import o from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as u}from"../../../../core/QueueProcessor.js";import{parseWhereClause as p}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as d,expandWithRect as f,expandWithAABB as m,negativeInfinity as y,fromRect as h}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as g,QueryEngine as w}from"../../data/QueryEngine.js";import{QueryEngineResult as _}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as I}from"../../data/queryUtils.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as x,getParquetRowId as R}from"./parquetIdUtils.js";import S from"../../../support/Field.js";import q from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as v,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as O}from"../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as Q,readGeoMetadata as T}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as j}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as P}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as M}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as A}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as G}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const B=new j,D=4,z="__OBJECTID",W=new TextDecoder;class U{constructor(){this._fileInfos=new Map,this._queue=new u({concurrency:D,process:(e,t)=>this._executeQuery(e,t)}),this._indexMap={}}async load(s){const a=s.spatialReference?l.fromJSON(s.spatialReference):void 0;if(a&&!a.isWGS84&&!a.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const n=await E({urls:new r(s.urls),fields:s.fields?.map(e=>S.fromJSON(e)),geometryEncoding:s.geometryEncoding?C(s.geometryEncoding):null,geometryType:s.geometryType?v(s.geometryType):null,displayOptimization:s.displayOptimization,spatialReference:a},{customParameters:s.customParameters});if(!n.fields)throw new i("parquet:unsupported","Fields must be defined");let u;if(n.spatialReference&&n.geometryType){if(!n.spatialReference)throw new i("parquet:unsupported","SpatialReference must be defined");if(!n.spatialReference.isGeographic&&!n.spatialReference.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");n.spatialReference.isGeographic&&!n.spatialReference.isWGS84&&(o.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:n.spatialReference}),n.spatialReference=l.WGS84),u={geometry:n.geometryEncoding?{geometryType:b(n.geometryType),spatialReference:n.spatialReference.toJSON(),encoding:n.geometryEncoding.toJSON()}:null,displayOptimization:n.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=u;const p=s.urls;for(const e of p)this._addFile(e);this._capabilities=H(await this.getFileStatistics());const m=this._fileInfos.values().next().value;if(!m)return{layerDefinition:{},capabilities:H(null)};const h=await m,{fields:g}=n;if(null==g)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",g);g.push(new S({name:z,type:"oid",alias:z}));for(const e of g){const t=h.file.columnForFieldName(e.name);null!=t&&(this._indexMap[e.name]=t)}const w=new q(g.map(e=>e.toJSON()));this._fieldsIndex=w;const _=b(n.geometryType??"point");if(this._metadata=A.createFeature({fieldsIndex:w.toJSON(),geometryType:_,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:n.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:_,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:n.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},n.spatialReference){const e=await this.getFileInfos();this._fullExtent=V(e,n.spatialReference.toJSON())}if(null==this._fullExtent&&"location"===n.geometryEncoding?.type){const{xField:r,yField:s}=n.geometryEncoding,i=c(d(),y);for(const o of await this.getFileInfos())for(const a of o.file.rowGroups()){const o={stack:[],error:void 0,hasError:!1};try{const t=e(o,a.columnDescriptorForAttribute(r),!1),n=e(o,a.columnDescriptorForAttribute(s),!1),u=[t.minValue(),n.minValue(),t.maxValue(),n.maxValue()];f(i,u),a.free()}catch(I){o.error=I,o.hasError=!0}finally{t(o)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:n.spatialReference?.toJSON()}}return{capabilities:this._capabilities,layerDefinition:{fields:n.fields?.map(e=>e.toJSON()),drawingInfo:F(_),extent:this._fullExtent??void 0,geometryType:_,geometryEncoding:n.geometryEncoding?.toJSON(),displayOptimization:n.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.then(e=>e.file.free);this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async getFileId(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return(await t).id}async getFileInfo(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return t}async getFileInfos(){return Promise.all(Array.from(this._fileInfos.values()))}async getFileStatistics(){if(!this._fileInfos.size)return null;const e=(await this.getFileInfos()).reduce((e,t)=>e+t.file.byteLength(),0);return{featureCount:await this._getFeatureCount(),byteLength:e}}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.then(e=>e.file.free()),this._fileInfos.delete(r));await Promise.all(Array.from(t.values()).map(e=>this._addFile(e)))}async queryFeatures(e,t){this._validateQuery(e),Z(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!N(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=s(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;const o=c(d(),y),a=d(),n=await this._enqueueQuery(r,t);let u=0;for(const s of n.items)s.getBounds(a)&&(m(o,a),u+=1);return{count:u,extent:g(o,i,r.outSR?s(r.outSR):i,i,!1)}}async queryStream(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=(await O()).Query.new();"tile"===t.type&&(i.setExtent(t.extent),i.setQuantizationTransform(t.transform),i.setScale(t.scale)),i.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),i.setOutSpatialReference(t.outSpatialReference.wkid),i.setReturnGeometry(!0),t.where&&await this._setWhereClause(i,s.file,t.where);const o=await s.file.executeQuery(i,r.signal),n=s.streamIdCounter++,u=a(r.signal,e=>{const t=s.streams.get(n);null!=t&&(t.handle.remove(),s.streams.delete(n))});return s.streams.set(n,{stream:o,handle:u}),n}async getStreamNext(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=s.streams.get(t);if(!i)return null;const o=await i.stream.next(r.signal);return null==o&&(i.handle.remove(),s.streams.delete(t)),o?.serialize().buffer}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const o=await this.getFileInfo(e);return(await o.file.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getFile(e){for(const t of await this.getFileInfos())if(t.id===e)return t.file;throw new Error(`InternalError: File ${e} does not exist`)}_addFile(e){const t=this._fileInfos.size;this._fileInfos.set(e,this._createFileInfo(e,t))}async _createFileInfo(e,t){return{id:t,file:await Q(e,{geometryInfo:this._geometryInfo,getCustomParameters:()=>this._customParameters}),streamIdCounter:0,streams:new Map}}async _getFeatureCount(){return(await this.getFileInfos()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new i("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new i("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new i("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const s=this._indexMap,o=this._fieldsIndex,a={getAttribute(e,r){const i=t.readAttribute(e.rowGroup,e.row,s[r]);if(null==i)return null;const a=o.get(r);return"esriFieldTypeString"===a.type||"esriFieldTypeDateOnly"===a.type||"esriFieldTypeTimeOnly"===a.type||"esriFieldTypeTimestampOffset"===a.type?W.decode(i):i}},n=await p(r,this._fieldsIndex);if(!n.isStandardized)throw new i("sql-parse-error","expression is not standardized");const u=(e,t)=>n.testFeatureCompiled({rowGroup:e,row:t},a,null);e.setWhere(r),e.setWhereEvaluator(u),e.setWhereFields(n.fieldNames)}async*_fetchChunks(e,t){const r=await O();for(const s of await this.getFileInfos()){const i=r.Query.new();i.setOutFields(e.fields),i.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(i,s.file,e.where);const o=await s.file.executeQuery(i),a=[],u=o.next(t);for(let e=0;e<D;e++)a.push(o.next(t));let p=await u;for(;null!=p;){n(t);const e=new G(this._metadata,this._indexMap,p,s.id),r=k([new P(e,null,0,!1)],this._queryEngineParams),i=a.shift();a.push(o.next(t)),yield r,p=await i}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=x(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,o]of r.entries()){const r=await this._executeFileIdQuery(e,i,o,t);for(const e of r)s.push(e)}return new _(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const o=[];for await(const a of this._fetchChunks(r,t)){const r=await a.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)o.push(e);if(i=0,s-=t.length,0===s)return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),o=(await O()).Query.new();o.setOutFields(i.fields),o.setReturnGeometry(i.returnGeometry),o.setIds(new Uint32Array(r));const a=await this._getFile(t),n=await a.executeQuery(o,s);let u=await n.next(s),p=0;const l=[];for(;null!=u;){const e=new G(this._metadata,this._indexMap,u,t),r=new P(e,null,p++,!1);l.push(r),u=await n.next(s)}return k(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function N(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function k(e,t){const r=new M;for(const s of e)r.insert(s);return new w({...t,featureStore:r})}function J(e){switch(e.length){case 4:return h(d(),e);case 6:return e;default:throw new i("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function V(e,t){const r=c(d(),y);for(const s of e){const e=T(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const i=J(t.bbox);m(r,i)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}function H(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,supportsStatisticsAggregatedIds:!1,supportsCacheHint:!1,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsOutDistance:!1,supportsDistinct:r,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:r,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:r,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Z(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{U as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import o from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as u}from"../../../../core/QueueProcessor.js";import{parseWhereClause as p}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as d,expandWithRect as f,expandWithAABB as m,negativeInfinity as y,fromRect as h}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as g,QueryEngine as w}from"../../data/QueryEngine.js";import{QueryEngineResult as _}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as I}from"../../data/queryUtils.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as x,getParquetRowId as R}from"./parquetIdUtils.js";import S from"../../../support/Field.js";import q from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as v,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as O}from"../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as Q,readGeoMetadata as T}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as j}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as P}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as M}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as A}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as G}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const B=new j,D=4,z="__OBJECTID",W=new TextDecoder;class U{constructor(){this._fileInfos=new Map,this._queue=new u({concurrency:D,process:(e,t)=>this._executeQuery(e,t)}),this._indexMap={}}async load(s){const{urls:a}=s,n=s.spatialReference?l.fromJSON(s.spatialReference):void 0;if(n&&!n.isWGS84&&!n.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const u=await E({urls:new r(a),fields:s.fields?.map(e=>S.fromJSON(e)),geometryEncoding:s.geometryEncoding?C(s.geometryEncoding):null,geometryType:s.geometryType?v(s.geometryType):null,displayOptimization:s.displayOptimization,spatialReference:n},{customParameters:s.customParameters});if(!u.fields)throw new i("parquet:unsupported","Fields must be defined");let p;if(u.spatialReference&&u.geometryType){if(!u.spatialReference)throw new i("parquet:unsupported","SpatialReference must be defined");if(!u.spatialReference.isGeographic&&!u.spatialReference.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");u.spatialReference.isGeographic&&!u.spatialReference.isWGS84&&(o.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:u.spatialReference}),u.spatialReference=l.WGS84),p={geometry:u.geometryEncoding?{geometryType:b(u.geometryType),spatialReference:u.spatialReference.toJSON(),encoding:u.geometryEncoding.toJSON()}:null,displayOptimization:u.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=p;for(const e of a)this._addFile(e);this._capabilities=H(await this.getFileStatistics());const m=this._fileInfos.values().next().value;if(!m)return{layerDefinition:{},capabilities:H(null)};const h=await m,{fields:g}=u;if(null==g)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",g);g.push(new S({name:z,type:"oid",alias:z}));for(const e of g){const t=h.file.columnForFieldName(e.name);null!=t&&(this._indexMap[e.name]=t)}const w=new q(g.map(e=>e.toJSON()));this._fieldsIndex=w;const _=b(u.geometryType??"point");if(this._metadata=A.createFeature({fieldsIndex:w.toJSON(),geometryType:_,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:u.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:_,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:u.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},u.spatialReference){const e=await this.getFileInfos();this._fullExtent=V(e,u.spatialReference.toJSON())}if(null==this._fullExtent&&"location"===u.geometryEncoding?.type){const{xField:r,yField:s}=u.geometryEncoding,i=c(d(),y);for(const o of await this.getFileInfos())for(const a of o.file.rowGroups()){const o={stack:[],error:void 0,hasError:!1};try{const t=e(o,a.columnDescriptorForAttribute(r),!1),n=e(o,a.columnDescriptorForAttribute(s),!1),u=[t.minValue(),n.minValue(),t.maxValue(),n.maxValue()];f(i,u),a.free()}catch(I){o.error=I,o.hasError=!0}finally{t(o)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:u.spatialReference?.toJSON()}}return{capabilities:this._capabilities,layerDefinition:{fields:u.fields?.map(e=>e.toJSON()),drawingInfo:F(_),extent:this._fullExtent??void 0,geometryType:_,geometryEncoding:u.geometryEncoding?.toJSON(),displayOptimization:u.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.then(e=>e.file.free);this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async getFileId(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return(await t).id}async getFileInfo(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return t}async getFileInfos(){return Promise.all(Array.from(this._fileInfos.values()))}async getFileStatistics(){if(!this._fileInfos.size)return null;const e=(await this.getFileInfos()).reduce((e,t)=>e+t.file.byteLength(),0);return{featureCount:await this._getFeatureCount(),byteLength:e}}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.then(e=>e.file.free()),this._fileInfos.delete(r));await Promise.all(Array.from(t.values()).map(e=>this._addFile(e)))}async queryFeatures(e,t){this._validateQuery(e),Z(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!N(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=s(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;const o=c(d(),y),a=d(),n=await this._enqueueQuery(r,t);let u=0;for(const s of n.items)s.getBounds(a)&&(m(o,a),u+=1);return{count:u,extent:g(o,i,r.outSR?s(r.outSR):i,i,!1)}}async queryStream(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=(await O()).Query.new();"tile"===t.type&&(i.setExtent(t.extent),i.setQuantizationTransform(t.transform),i.setScale(t.scale)),i.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),i.setOutSpatialReference(t.outSpatialReference.wkid),i.setReturnGeometry(!0),t.where&&await this._setWhereClause(i,s.file,t.where);const o=await s.file.executeQuery(i,r.signal),n=s.streamIdCounter++,u=a(r.signal,e=>{const t=s.streams.get(n);null!=t&&(t.handle.remove(),s.streams.delete(n))});return s.streams.set(n,{stream:o,handle:u}),n}async getStreamNext(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=s.streams.get(t);if(!i)return null;const o=await i.stream.next(r.signal);return null==o&&(i.handle.remove(),s.streams.delete(t)),o?.serialize().buffer}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const o=await this.getFileInfo(e);return(await o.file.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getFile(e){for(const t of await this.getFileInfos())if(t.id===e)return t.file;throw new Error(`InternalError: File ${e} does not exist`)}_addFile(e){const t=this._fileInfos.size;this._fileInfos.set(e,this._createFileInfo(e,t))}async _createFileInfo(e,t){return{id:t,file:await Q(e,{geometryInfo:this._geometryInfo,getCustomParameters:()=>this._customParameters}),streamIdCounter:0,streams:new Map}}async _getFeatureCount(){return(await this.getFileInfos()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new i("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new i("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new i("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const s=this._indexMap,o=this._fieldsIndex,a={getAttribute(e,r){const i=t.readAttribute(e.rowGroup,e.row,s[r]);if(null==i)return null;const a=o.get(r);return"esriFieldTypeString"===a.type||"esriFieldTypeDateOnly"===a.type||"esriFieldTypeTimeOnly"===a.type||"esriFieldTypeTimestampOffset"===a.type?W.decode(i):i}},n=await p(r,this._fieldsIndex);if(!n.isStandardized)throw new i("sql-parse-error","expression is not standardized");const u=(e,t)=>n.testFeatureCompiled({rowGroup:e,row:t},a,null);e.setWhere(r),e.setWhereEvaluator(u),e.setWhereFields(n.fieldNames)}async*_fetchChunks(e,t){const r=await O();for(const s of await this.getFileInfos()){const i=r.Query.new();i.setOutFields(e.fields),i.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(i,s.file,e.where);const o=await s.file.executeQuery(i),a=[],u=o.next(t);for(let e=0;e<D;e++)a.push(o.next(t));let p=await u;for(;null!=p;){n(t);const e=new G(this._metadata,this._indexMap,p,s.id),r=k([new P(e,null,0,!1)],this._queryEngineParams),i=a.shift();a.push(o.next(t)),yield r,p=await i}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=x(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,o]of r.entries()){const r=await this._executeFileIdQuery(e,i,o,t);for(const e of r)s.push(e)}return new _(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const o=[];for await(const a of this._fetchChunks(r,t)){const r=await a.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)o.push(e);if(i=0,s-=t.length,0===s)return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),o=(await O()).Query.new();o.setOutFields(i.fields),o.setReturnGeometry(i.returnGeometry),o.setIds(new Uint32Array(r));const a=await this._getFile(t),n=await a.executeQuery(o,s);let u=await n.next(s),p=0;const l=[];for(;null!=u;){const e=new G(this._metadata,this._indexMap,u,t),r=new P(e,null,p++,!1);l.push(r),u=await n.next(s)}return k(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function N(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function k(e,t){const r=new M;for(const s of e)r.insert(s);return new w({...t,featureStore:r})}function J(e){switch(e.length){case 4:return h(d(),e);case 6:return e;default:throw new i("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function V(e,t){const r=c(d(),y);for(const s of e){const e=T(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const i=J(t.bbox);m(r,i)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}function H(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,supportsStatisticsAggregatedIds:!1,supportsCacheHint:!1,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsOutDistance:!1,supportsDistinct:r,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:r,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:r,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Z(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{U as default};
|
|
@@ -94,6 +94,8 @@ export interface KnowledgeGraphSublayerProperties extends LayerProperties, Refre
|
|
|
94
94
|
* })
|
|
95
95
|
*/
|
|
96
96
|
formTemplate?: FormTemplateProperties | null;
|
|
97
|
+
/** The unique ID assigned to the layer. */
|
|
98
|
+
id?: string;
|
|
97
99
|
/**
|
|
98
100
|
* The label definition for this sublayer, specified as an array of
|
|
99
101
|
* [label classes](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/). Use this property to specify
|
|
@@ -378,7 +380,7 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
|
|
|
378
380
|
*/
|
|
379
381
|
get hasZ(): boolean;
|
|
380
382
|
/** The unique ID assigned to the layer. */
|
|
381
|
-
|
|
383
|
+
accessor id: string;
|
|
382
384
|
/**
|
|
383
385
|
* The label definition for this sublayer, specified as an array of
|
|
384
386
|
* [label classes](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/). Use this property to specify
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type Collection from "../../core/Collection.js";
|
|
2
|
+
import type { Clonable } from "../../core/Clonable.js";
|
|
3
|
+
import type { JSONSupportMixin } from "../../core/JSONSupport.js";
|
|
4
|
+
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
|
|
5
|
+
|
|
6
|
+
export interface ParquetFilesDataProperties {
|
|
7
|
+
/**
|
|
8
|
+
* Collection of urls for Parquet files.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated since 5.1. Use [data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data) with [ParquetFilesData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/) instead.
|
|
11
|
+
* @example
|
|
12
|
+
* // Legacy file-backed alias
|
|
13
|
+
* const layer = new ParquetLayer({
|
|
14
|
+
* urls: [
|
|
15
|
+
* "https://example.com/path/to/parquetfile1.parquet",
|
|
16
|
+
* "https://example.com/path/to/parquetfile2.parquet"
|
|
17
|
+
* ]
|
|
18
|
+
* });
|
|
19
|
+
*/
|
|
20
|
+
urls?: ReadonlyArrayOrCollection<string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* File-backed data source configuration for a [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/).
|
|
25
|
+
*
|
|
26
|
+
* @see [ParquetLayer.data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data)
|
|
27
|
+
*/
|
|
28
|
+
export default class ParquetFilesData extends ParquetFilesDataSuperclass {
|
|
29
|
+
constructor(properties?: ParquetFilesDataProperties);
|
|
30
|
+
/**
|
|
31
|
+
* Collection of urls for Parquet files.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated since 5.1. Use [data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data) with [ParquetFilesData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/) instead.
|
|
34
|
+
* @example
|
|
35
|
+
* // Legacy file-backed alias
|
|
36
|
+
* const layer = new ParquetLayer({
|
|
37
|
+
* urls: [
|
|
38
|
+
* "https://example.com/path/to/parquetfile1.parquet",
|
|
39
|
+
* "https://example.com/path/to/parquetfile2.parquet"
|
|
40
|
+
* ]
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
get urls(): Collection<string>;
|
|
44
|
+
set urls(value: ReadonlyArrayOrCollection<string>);
|
|
45
|
+
}
|
|
46
|
+
declare const ParquetFilesDataSuperclass: typeof Clonable & typeof JSONSupportMixin
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as r}from"tslib";import{Clonable as o}from"../../core/Clonable.js";import s from"../../core/Collection.js";import e from"../../core/Error.js";import{JSONSupportMixin as t}from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{t as l}from"../../chunks/persistableUrlUtils.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";let c=class extends(t(o)){constructor(r){super(r),this.type="files",this.urls=new s}writeUrls(r,o,s,t){const i=r.toArray().map(r=>l(r,t)).filter(r=>!!r);i.length?o.urls=i:t.messages?.push(new e("parquet-layer:missing-urls","Missing or empty 'urls'",{data:this}))}};r([i({type:["files"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],c.prototype,"type",void 0),r([i({type:s.ofType(String),json:{write:{isRequired:!0}}})],c.prototype,"urls",void 0),r([a("urls")],c.prototype,"writeUrls",null),c=r([p("esri.layers.support.ParquetFilesData")],c);export{c as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type PortalItem from "../../portal/PortalItem.js";
|
|
2
|
+
import type { Clonable } from "../../core/Clonable.js";
|
|
3
|
+
import type { JSONSupportMixin } from "../../core/JSONSupport.js";
|
|
4
|
+
import type { PortalItemProperties } from "../../portal/PortalItem.js";
|
|
5
|
+
|
|
6
|
+
export interface ParquetPortalItemDataProperties {
|
|
7
|
+
/** The portal item containing the Parquet data. */
|
|
8
|
+
portalItem?: PortalItemProperties;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Portal-item-backed data source configuration for a [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/).
|
|
13
|
+
*
|
|
14
|
+
* @beta
|
|
15
|
+
* @see [ParquetLayer.data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data)
|
|
16
|
+
*/
|
|
17
|
+
export default class ParquetPortalItemData extends ParquetPortalItemDataSuperclass {
|
|
18
|
+
constructor(properties?: ParquetPortalItemDataProperties);
|
|
19
|
+
/** The portal item containing the Parquet data. */
|
|
20
|
+
get portalItem(): PortalItem;
|
|
21
|
+
set portalItem(value: PortalItemProperties);
|
|
22
|
+
/** The type of data source. */
|
|
23
|
+
get type(): "portal-item";
|
|
24
|
+
}
|
|
25
|
+
declare const ParquetPortalItemDataSuperclass: typeof Clonable & typeof JSONSupportMixin
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as r}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as o}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../portal/PortalItem.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{writer as i}from"../../core/accessorSupport/decorators/writer.js";let m=class extends(o(t)){constructor(r){super(r),this.type="portal-item"}readPortalItem(r,t,o){if(t.itemId)return new s({id:t.itemId,portal:o?.portal})}writePortalItem(r,t){r?.id&&(t.itemId=r.id)}};r([e({type:["portal-item"],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],m.prototype,"type",void 0),r([e({type:s,json:{write:{isRequired:!0}}})],m.prototype,"portalItem",void 0),r([a("portalItem",["itemId"])],m.prototype,"readPortalItem",null),r([i("portalItem",{itemId:{type:String}})],m.prototype,"writePortalItem",null),m=r([p("esri.layers.support.ParquetPortalItemData")],m);const l=m;export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import n from"../../geometry/SpatialReference.js";import i from"./Field.js";import{isNumericField as r}from"./fieldUtils.js";import s from"./GeometryEncodingLocation.js";import l from"./GeometryEncodingWkb.js";import{inferLocationInfo as
|
|
2
|
+
import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import n from"../../geometry/SpatialReference.js";import i from"./Field.js";import{isNumericField as r}from"./fieldUtils.js";import s from"./GeometryEncodingLocation.js";import l from"./GeometryEncodingWkb.js";import{inferLocationInfo as a}from"./locationUtils.js";import{createParquetFile as p,readGeoMetadata as c,readGeodisplayMetadata as u}from"../../libs/parquet/parquet.js";const m=new o({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"}),d=new Set(["uncompressed","snappy","gzip"]);function f(e){return m.toJSON(e)}function y(e){return m.fromJSON(e)}function g(t,o={}){return w({urls:new e(t)},o)}async function w(e,o={}){if(e.urls.length<1)throw new t("parquet:bad-input","At least one url must be specified",e);if(e.geometryType&&e.spatialReference&&e.geometryEncoding&&e.fields)return e;const s=await p(e.urls.getItemAt(0),{getCustomParameters:()=>o.customParameters});for(const n of s.compressionCodecs())if(!d.has(n))throw new t("parquet:unsupported",`Compression codec ${n} is unsupported. Must be of type ${Array.from(d).join(",")}`);const l=c(s),a={...e,file:s};if(null==a.fields&&(a.fields=s.fields(!1).map(e=>i.fromJSON({name:e.name,alias:e.name,type:e.type}))),null!=a.geometryEncoding){const e=a.geometryEncoding;switch(e.type){case"wkb":{const o=a.fields.find(t=>t.name===e.field);if(!o)throw new t("parquet:unsupported",`Geometry encoding references field ${e.field} which does not exist`);if("blob"!==o.type)throw new t("parquet:unsupported",`Invalid field type for geometry encoding. Found ${o.type} but expected 'blob'`);break}case"location":for(const o of[e.xField,e.yField])if(null!=o){const e=a.fields.find(e=>e.name===o);if(!e)throw new t("parquet:unsupported",`Geometry encoding references field ${o} which does not exist`);if(!r(e))throw new t("parquet:unsupported",`Invalid field type for location geometry encoding. Found ${e.type} but expected a numeric`)}}}null==a.geometryEncoding&&(a.geometryEncoding=h(l,a.fields));const m=u(s);if(m&&(a.displayOptimization=m),a.geometryEncoding)switch(a.geometryEncoding.type){case"location":null==a.spatialReference&&(a.spatialReference=n.WGS84),null==a.geometryType&&(a.geometryType="point");break;case"wkb":{if(!l)return a;const e=l.primary_column,t=l.columns[e];if(a.geometryType||(a.geometryType=j(t)),a.spatialReference||(a.spatialReference=k(t)),a.fields)for(const o of Object.keys(l.columns))a.fields=a.fields.filter(e=>e.name!==o)}}if(a.displayOptimization){const e=a.displayOptimization.index;if(!a.spatialReference&&e.wkid&&(a.spatialReference=new n({wkid:e.wkid})),!a.geometryType)switch(e.type){case"z":a.geometryType="point";break;case"xz":a.geometryType=e.geometryType}}return a}function h(e,t){if(null!=e){const t=e.primary_column,o=e.columns[t];return new l({field:t,orientation:"counterclockwise"===o.orientation?"counter-clockwise":null})}const o=t.filter(e=>r(e)).map(e=>e.name),n=a(o);return n.latitudeFieldName&&n.longitudeFieldName?new s({xField:n.longitudeFieldName,yField:n.latitudeFieldName}):null}function b(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function j(e){const{geometry_types:o}=e,n=new Set;for(const t of o){const e=b(t);e&&n.add(e)}if(n.size>1)throw new t("parquet:unsupported","Parquet mixed geometry types are not supported",{geometryTypes:n});return 1===n.size?n.values().next().value:void 0}function k(e){const t=e.crs?.id?.code;return t&&"number"==typeof t?new n({wkid:t}):void 0}async function q(e,t){switch(e?.type){case"files":return e.urls.toArray();case"portal-item":return await e.portalItem.load(t),[x(e.portalItem)];default:return[]}}function x(e){const o=e.itemCdnUrl?`${e.itemCdnUrl}/data`:`${e.itemUrl}/data`;if(!o)throw new t("parquet-layer:missing-portal-item-id","Portal item data requires a portal item id",{portalItem:e});return o}export{w as completeParquetLayerInfo,y as fromParquetJSONGeometryType,g as getParquetLayerInfo,m as parquetGeometryTypeKebabDict,q as resolveParquetDataUrls,f as toParquetJSONGeometryType};
|
|
@@ -9,6 +9,8 @@ import type GeometryEncodingLocation from "./GeometryEncodingLocation.js";
|
|
|
9
9
|
import type GeometryEncodingWkb from "./GeometryEncodingWkb.js";
|
|
10
10
|
import type InheritedDomain from "./InheritedDomain.js";
|
|
11
11
|
import type NumberFieldFormat from "./NumberFieldFormat.js";
|
|
12
|
+
import type ParquetFilesData from "./ParquetFilesData.js";
|
|
13
|
+
import type ParquetPortalItemData from "./ParquetPortalItemData.js";
|
|
12
14
|
import type RangeDomain from "./RangeDomain.js";
|
|
13
15
|
import type { AbortOptions } from "../../core/promiseUtils.js";
|
|
14
16
|
import type { ElevationLayerUnion, QueryRelatedCapabilities } from "../types.js";
|
|
@@ -637,6 +639,13 @@ export interface ExifTag {
|
|
|
637
639
|
*/
|
|
638
640
|
export type ParquetGeometryEncodingUnion = GeometryEncodingWkb | GeometryEncodingLocation;
|
|
639
641
|
|
|
642
|
+
/**
|
|
643
|
+
* Supported Parquet data source types.
|
|
644
|
+
*
|
|
645
|
+
* @since 5.1
|
|
646
|
+
*/
|
|
647
|
+
export type ParquetDataUnion = ParquetFilesData | ParquetPortalItemData;
|
|
648
|
+
|
|
640
649
|
/**
|
|
641
650
|
* Options for creating an elevation sampler.
|
|
642
651
|
*
|
|
@@ -83,7 +83,7 @@ export interface NamedTraceConfigurationParameters {
|
|
|
83
83
|
export type UtilityNetworkTraceAnalysisExecutionError = "trace-error";
|
|
84
84
|
|
|
85
85
|
/** @since 5.0 */
|
|
86
|
-
export type UtilityNetworkTraceAnalysisLoadError = "no-user-type-extension" | "no-utility-network" | "no-view" | "sceneView-not-supported";
|
|
86
|
+
export type UtilityNetworkTraceAnalysisLoadError = "no-user-type-extension" | "no-utility-network" | "no-view" | "sceneView-not-supported" | "utility-network-load-failed";
|
|
87
87
|
|
|
88
88
|
/** @since 5.0 */
|
|
89
89
|
export type UtilityNetworkTraceAnalysisState = "disabled" | "executing" | "loading" | "ready";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import r from"../core/Accessor.js";import e from"../core/Error.js";import o from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as s,subclass as a}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import l from"../layers/FeatureLayer.js";import{getOwningPortalUrl as u}from"../layers/support/layerUtils.js";import d from"../portal/Portal.js";import{hasUserTypeExtension as c}from"../portal/support/utils.js";let h=class extends r{constructor(t){super(t),this._updatingHandlesLoad=new n,this._updatingHandlesExecute=new n}initialize(){this.addHandles([i(()=>[this.view,this.utilityNetwork],()=>{this._setUp()},{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this._get("utilityNetwork")}set utilityNetwork(t){this._get("utilityNetwork")!==t&&this._set("utilityNetwork",t)}get view(){return this._get("view")}set view(t){this._get("view")!==t&&this._set("view",t)}async executeNamedTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(t))}async executeTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(t))}async _executeNamedTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}async _executeTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}_logError(t,r){o.getLogger(this).error(new e(t,r??""))}async _setUp(){const{utilityNetwork:t,view:r}=this;this._updatingHandlesLoad.consumePromise((async()=>{if(this._loadError=null,!r)return void(this._loadError="no-view");if("2d"!==r.type)return void(this._loadError="sceneView-not-supported");const e=r.map;await e.load();const o=e.utilityNetworks;o?.length
|
|
2
|
+
import{__decorate as t}from"tslib";import r from"../core/Accessor.js";import e from"../core/Error.js";import o from"../core/Logger.js";import{watch as i}from"../core/reactiveUtils.js";import{property as s,subclass as a}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import l from"../layers/FeatureLayer.js";import{getOwningPortalUrl as u}from"../layers/support/layerUtils.js";import d from"../portal/Portal.js";import{hasUserTypeExtension as c}from"../portal/support/utils.js";let h=class extends r{constructor(t){super(t),this._updatingHandlesLoad=new n,this._updatingHandlesExecute=new n}initialize(){this.addHandles([i(()=>[this.view,this.utilityNetwork],()=>{this._setUp()},{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this._get("utilityNetwork")}set utilityNetwork(t){this._get("utilityNetwork")!==t&&this._set("utilityNetwork",t)}get view(){return this._get("view")}set view(t){this._get("view")!==t&&this._set("view",t)}async executeNamedTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(t))}async executeTraceConfiguration(t){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(t))}async _executeNamedTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}async _executeTraceConfiguration(t){if("disabled"===this.state){const t="trace-analysis-view-model:load-error";throw this._logError(t,this.loadError),new e(t,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(t).catch(t=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),t})}_logError(t,r){o.getLogger(this).error(new e(t,r??""))}async _setUp(){const{utilityNetwork:t,view:r}=this;this._updatingHandlesLoad.consumePromise((async()=>{if(this._loadError=null,!r)return void(this._loadError="no-view");if("2d"!==r.type)return void(this._loadError="sceneView-not-supported");const e=r.map;await e.load();const o=e.utilityNetworks;if(o?.length)if(t&&o.includes(t)||(this.utilityNetwork=o.getItemAt(0)??null),"utility"===this.utilityNetwork?.type){if(!this.utilityNetwork.loaded)try{await this.utilityNetwork.load()}catch{return void(this._loadError="utility-network-load-failed")}await this._checkUserTypeExtension(this.utilityNetwork)}else this._loadError="utility-network-load-failed";else this._loadError="no-utility-network"})())}async _checkUserTypeExtension(t){const r=new l({url:t.networkSystemLayers.dirtyAreasLayerUrl});await r.load();const e=r.version;if(Number(e)<=11.1){const r=await u(t.layerUrl),e=new d({url:r});await e.load();const o=e.user?.username??"";if(!await c(e,o,"utilityNetwork")){const t="trace-analysis-view-model:load-error";this._loadError="no-user-type-extension",this._logError(t,this.loadError)}}}};t([s()],h.prototype,"_executionError",void 0),t([s()],h.prototype,"_loadError",void 0),t([s()],h.prototype,"executionError",null),t([s()],h.prototype,"loadError",null),t([s({readOnly:!0})],h.prototype,"state",null),t([s()],h.prototype,"utilityNetwork",null),t([s()],h.prototype,"view",null),h=t([a("esri.networks.UtilityNetworkTraceAnalysis")],h);const y=h;export{y as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.101",
|
|
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": [
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.17.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.102",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.0-next.47",
|
|
25
|
-
"@vaadin/grid": "~25.1.
|
|
25
|
+
"@vaadin/grid": "~25.1.3",
|
|
26
26
|
"@zip.js/zip.js": "~2.8.26",
|
|
27
27
|
"luxon": "~3.7.2",
|
|
28
28
|
"marked": "~18.0.3",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type CIMSymbol from "../../symbols/CIMSymbol.js";
|
|
2
2
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
3
4
|
import type { SymbolUnion } from "../../symbols/types.js";
|
|
4
5
|
import type { WebStyleSymbolProperties } from "../../symbols/WebStyleSymbol.js";
|
|
5
6
|
import type { PolygonSymbol3DProperties } from "../../symbols/PolygonSymbol3D.js";
|
|
@@ -7,7 +8,6 @@ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
|
|
|
7
8
|
import type { MeshSymbol3DProperties } from "../../symbols/MeshSymbol3D.js";
|
|
8
9
|
import type { LineSymbol3DProperties } from "../../symbols/LineSymbol3D.js";
|
|
9
10
|
import type { LabelSymbol3DProperties } from "../../symbols/LabelSymbol3D.js";
|
|
10
|
-
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
11
11
|
import type { TextSymbolProperties } from "../../symbols/TextSymbol.js";
|
|
12
12
|
import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
|
|
13
13
|
import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js";
|
|
@@ -54,7 +54,7 @@ export interface ClassBreakInfoProperties extends Partial<Pick<ClassBreakInfo, "
|
|
|
54
54
|
* ]
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
alternateSymbols?: CIMSymbolProperties[] | null;
|
|
57
|
+
alternateSymbols?: (CIMSymbolProperties | CIMSymbolProperties)[] | null;
|
|
58
58
|
/**
|
|
59
59
|
* Defines the symbol used to render features with data values that are within the bounds
|
|
60
60
|
* defined for the class break. This value may be autocast by specifying the symbol `type`.
|
|
@@ -118,7 +118,7 @@ export default class ClassBreakInfo extends JSONSupport {
|
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
120
|
get alternateSymbols(): CIMSymbol[] | null | undefined;
|
|
121
|
-
set alternateSymbols(value: CIMSymbolProperties[] | null | undefined);
|
|
121
|
+
set alternateSymbols(value: (CIMSymbolProperties | CIMSymbolProperties)[] | null | undefined);
|
|
122
122
|
/**
|
|
123
123
|
* Describes the data represented by the class break. This label will appear in the
|
|
124
124
|
* [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) next to the symbol representing the break.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import{requiredRendererSymbolProperty as l}from"./commonProperties.js";import r from"../../symbols/CIMSymbol.js";var a;let i=a=class extends t{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}get alternateSymbols(){return this._get("alternateSymbols")??null}set alternateSymbols(e){e?this._set("alternateSymbols",e.map(e=>e instanceof r?e:(delete e.type,new r(e)))):this._set("alternateSymbols",null)}clone(){return new a({alternateSymbols:this.alternateSymbols?.map(e=>e.clone()),description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}};e([s({type:String,json:{write:!0}})],i.prototype,"description",void 0),e([s({type:String,json:{write:!0}})],i.prototype,"label",void 0),e([s({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],i.prototype,"minValue",void 0),e([s({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],i.prototype,"maxValue",void 0),e([s(l)],i.prototype,"symbol",void 0),e([s({type:[r],useTypeForAutocast:!1,json:{write:!0,origins:{"web-scene":{write:!1}}}})],i.prototype,"alternateSymbols",null),i=a=e([o("esri.renderers.support.ClassBreakInfo")],i);export{i as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type CIMSymbol from "../../symbols/CIMSymbol.js";
|
|
2
2
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
3
4
|
import type { SymbolUnion } from "../../symbols/types.js";
|
|
4
5
|
import type { WebStyleSymbolProperties } from "../../symbols/WebStyleSymbol.js";
|
|
5
6
|
import type { PolygonSymbol3DProperties } from "../../symbols/PolygonSymbol3D.js";
|
|
@@ -7,7 +8,6 @@ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
|
|
|
7
8
|
import type { MeshSymbol3DProperties } from "../../symbols/MeshSymbol3D.js";
|
|
8
9
|
import type { LineSymbol3DProperties } from "../../symbols/LineSymbol3D.js";
|
|
9
10
|
import type { LabelSymbol3DProperties } from "../../symbols/LabelSymbol3D.js";
|
|
10
|
-
import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js";
|
|
11
11
|
import type { TextSymbolProperties } from "../../symbols/TextSymbol.js";
|
|
12
12
|
import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
|
|
13
13
|
import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js";
|
|
@@ -52,7 +52,7 @@ export interface UniqueValueInfoProperties extends Partial<Pick<UniqueValueInfo,
|
|
|
52
52
|
* ]
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
alternateSymbols?: CIMSymbolProperties[] | null;
|
|
55
|
+
alternateSymbols?: (CIMSymbolProperties | CIMSymbolProperties)[] | null;
|
|
56
56
|
/**
|
|
57
57
|
* Defines the symbol used to render features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value).
|
|
58
58
|
*
|
|
@@ -116,7 +116,7 @@ export default class UniqueValueInfo extends JSONSupport {
|
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
118
|
get alternateSymbols(): CIMSymbol[] | null | undefined;
|
|
119
|
-
set alternateSymbols(value: CIMSymbolProperties[] | null | undefined);
|
|
119
|
+
set alternateSymbols(value: (CIMSymbolProperties | CIMSymbolProperties)[] | null | undefined);
|
|
120
120
|
/**
|
|
121
121
|
* Describes the [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) represented by the [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol). This label will appear in the
|
|
122
122
|
* [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) next to the symbol representing the value.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{requiredRendererSymbolProperty as l,uniqueValueProperty as r}from"./commonProperties.js";import i from"../../symbols/CIMSymbol.js";var n;let a=n=class extends e{constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.value=null}get alternateSymbols(){return this._get("alternateSymbols")??null}set alternateSymbols(t){t?this._set("alternateSymbols",t.map(t=>t instanceof i?t:(delete t.type,new i(t)))):this._set("alternateSymbols",null)}clone(){return new n({alternateSymbols:this.alternateSymbols?.map(t=>t.clone()),value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}};t([o({type:String,json:{write:!0}})],a.prototype,"description",void 0),t([o({type:String,json:{write:!0}})],a.prototype,"label",void 0),t([o(l)],a.prototype,"symbol",void 0),t([o({type:[i],useTypeForAutocast:!1,json:{write:!0,origins:{"web-scene":{write:!1}}}})],a.prototype,"alternateSymbols",null),t([o(r)],a.prototype,"value",void 0),a=n=t([s("esri.renderers.support.UniqueValueInfo")],a);export{a as default};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const f="20260514",a="e8bfa63f196d4fbec93aa83cf16f7f8d04123417";export{f as buildDate,a as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as r}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as s}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as o}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{DisposableFramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import m from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";const p=160,h=new Set(["f32","f64","u16","s16","u32","s32"]);class d extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new s,stretch:new n,shadedRelief:new o},this._mosaicFbo=null,this._statisticsTechnique=null,this._draTimer=0}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const r=i.bitmaps.some(f);r||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const s=r?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:r}=e.symbolizerParameters,o="stretch"===r?this._getStretchOptions(e,s):"lut"===r?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(o.defines.bilinear=!0),i.submitDrawMesh(t.context,o,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const r=this._statisticsTechnique;let s=has("esri-2d-dra-delay");if(null==s){const e=t.bitmaps.find(f),{stretchType:i,bandCount:r}=e.symbolizerParameters,{pixelType:o}=e.source;"minMax"===i&&r>=3&&h.has(o)&&(s=p)}if(s){const i=performance.now();(i-this._draTimer>=s||e.stationary||!r.minValuesTexture)&&(this._mosaic(e,t),r.render(e,{fbo:this._mosaicFbo}),this._draTimer=i)}else this._mosaic(e,t),r.render(e,{fbo:this._mosaicFbo});return{minTexture:r.minValuesTexture,maxTexture:r.maxValuesTexture,meanTexture:r.meanValuesTexture,stddevTexture:r.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:r}=e,s=i.boundFramebuffer;if(null==s)return;if(this._mosaicFbo)this._mosaicFbo.resize(s.width,s.height);else{const e=x(i,s.width,s.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const o="RasterColorizerMosaic";for(const n of t.bitmaps){if(!f(n))continue;e.timeline.begin(o),r.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,r.submitDrawMesh(e.context,i,r.quadMesh,n),n.interpolation=t,e.timeline.end(o)}i.bindFramebuffer(s)}_getLutOptions(e){const{config:t,projectionConfig:i,projectionTextures:s,colormapConfig:o,colormapTextures:n,textures:a,projectionDefines:u}=this._getCommonConfig(e),c=r(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o},textures:{...a,projectionTextures:s,colormapTextures:n},defines:{...u,...c,applyPixelMask:!!a.pixelMaskTexture,applyPixelHighlights:!!a.highlightTexture},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const
|
|
2
|
+
import has from"../../../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as r}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as s}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as o}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{DisposableFramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import m from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";const p=160,h=new Set(["f32","f64","u16","s16","u32","s32"]);class d extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new s,stretch:new n,shadedRelief:new o},this._mosaicFbo=null,this._statisticsTechnique=null,this._draTimer=0}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const r=i.bitmaps.some(f);r||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const s=r?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:r}=e.symbolizerParameters,o="stretch"===r?this._getStretchOptions(e,s):"lut"===r?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(o.defines.bilinear=!0),i.submitDrawMesh(t.context,o,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const r=this._statisticsTechnique;let s=has("esri-2d-dra-delay");if(null==s){const e=t.bitmaps.find(f),{stretchType:i,bandCount:r}=e.symbolizerParameters,{pixelType:o}=e.source;"minMax"===i&&r>=3&&h.has(o)&&(s=p)}if(s){const i=performance.now();(i-this._draTimer>=s||e.stationary||!r.minValuesTexture)&&(this._mosaic(e,t),r.render(e,{fbo:this._mosaicFbo}),this._draTimer=i)}else this._mosaic(e,t),r.render(e,{fbo:this._mosaicFbo});return{minTexture:r.minValuesTexture,maxTexture:r.maxValuesTexture,meanTexture:r.meanValuesTexture,stddevTexture:r.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:r}=e,s=i.boundFramebuffer;if(null==s)return;if(this._mosaicFbo)this._mosaicFbo.resize(s.width,s.height);else{const e=x(i,s.width,s.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const o="RasterColorizerMosaic";for(const n of t.bitmaps){if(!f(n))continue;e.timeline.begin(o),r.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n,void 0,!0);i.defines.noOp=!0,r.submitDrawMesh(e.context,i,r.quadMesh,n),n.interpolation=t,e.timeline.end(o)}i.bindFramebuffer(s)}_getLutOptions(e){const{config:t,projectionConfig:i,projectionTextures:s,colormapConfig:o,colormapTextures:n,textures:a,projectionDefines:u}=this._getCommonConfig(e),c=r(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o},textures:{...a,projectionTextures:s,colormapTextures:n},defines:{...u,...c,applyPixelMask:!!a.pixelMaskTexture,applyPixelHighlights:!!a.highlightTexture},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t,i=!1){const s=e.symbolizerParameters,{config:o,projectionConfig:n,projectionTextures:a,colormapConfig:u,colormapTextures:c,textures:m,projectionDefines:l,textureUnit:p}=this._getCommonConfig(e),h=r(e),d=t?{numberOfStandardDeviations:s.numberOfStandardDeviations||2}:void 0,x=t?{minTexture:{texture:t.minTexture,unit:p},maxTexture:{texture:t.maxTexture,unit:p+1},meanTexture:{texture:t.meanTexture,unit:p+2},stddevTexture:{texture:t.stddevTexture,unit:p+3}}:void 0,f=t?"standardDeviation"===s.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:n,config:o,stretchConfig:s,colormapConfig:u,statisticsConfig:d},textures:{...m,projectionTextures:a,colormapTextures:c,statisticsTextures:x},defines:{...l,...h,isMultiband:s.bandCount>1,applyColormap:!!u,useGamma:s.useGamma,noOp:e.isRenderedSource&&!e.processed,applyPixelMask:!!m.pixelMaskTexture,applyPixelHighlights:!i&&!!m.highlightTexture,draStretchType:f},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:s,projectionTextures:o,colormapConfig:n,colormapTextures:a,textures:u,projectionDefines:c}=this._getCommonConfig(e),m=r(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:s,config:i,hillshadeConfig:t,colormapConfig:n},textures:{...u,projectionTextures:o,colormapTextures:a},defines:{...c,...m,isMultidirectional:t.hillshadeType>0,applyColormap:!!n,applyPixelMask:!!u.pixelMaskTexture,applyPixelHighlights:!!u.highlightTexture},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:r}=e,{names:s,textures:o}=e.getTextures({useProcessedTexture:e.processed}),n=o[s.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={dvsMat3:r.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m={texture:{texture:n,unit:u++},pixelMaskTexture:null,highlightTexture:null},l=o[s.indexOf("u_transformGrid")],{transformGrid:p}=e,h=!(!l||!p),d=h?{targetImageSize:[e.width,e.height],transformSpacing:p.spacing,transformGridSize:p.size}:void 0,x=h?{transformTexture:{texture:l,unit:u++}}:void 0,f=o[s.indexOf("u_colormap")],{colormap:g,colormapOffset:T}=e.symbolizerParameters,b=f&&g?{colormapOffset:T??0,colormapMaxIndex:g.length/4-1}:void 0,_=f&&g?{colormapTexture:{texture:f,unit:u++}}:void 0,C=o[s.indexOf("u_mask")];C&&(m.pixelMaskTexture={texture:C,unit:u++});const{highlightTexture:j}=e;j&&(m.highlightTexture={texture:j,unit:u++});return{config:c,projectionConfig:d,projectionTextures:x,colormapConfig:b,colormapTextures:_,textures:m,projectionDefines:{applyProjection:h,lookupProjection:h&&1===p.spacing[0]},textureUnit:u}}}function x(e,t,i){const r=new l(t,i);return r.internalFormat=a.RGBA32F,r.samplingMode=9728,r.dataType=u.FLOAT,r.wrapMode=33071,new m(e,r)}function f(e){return!e.suspended&&null!=e.source&&!e.isRenderedSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{d as RasterColorizerTechnique};
|