@arcgis/core 5.2.0-next.145 → 5.2.0-next.147

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.
Files changed (51) hide show
  1. package/arcade/featureSetUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/2062d46f638eabfc9499.js +1 -0
  4. package/assets/esri/core/workers/chunks/{8ba32d3a0df4a206ef1c.js → 392bcef780df52fb4cca.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{d201fbf3ceff946d2bd6.js → 44d5508042cacdfcac47.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{d4926545193414cf2f16.js → 4ed8655770a3e018e366.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{cbe6c0f32608cb504695.js → 776ae25a34352d3468bc.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{fccbb902fe08448f91de.js → 9c1e69ac82e2bf746191.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8b54589f173259c1ba55.js → b8054adc45bca069b948.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{43fc42405167a5537039.js → f095cf98940e3f95d51e.js} +1 -1
  11. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  16. package/chunks/GlobalIllumination.glsl.js +4 -2
  17. package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
  18. package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
  19. package/config.js +1 -1
  20. package/core/colorUtils.js +1 -1
  21. package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
  22. package/kernel.js +1 -1
  23. package/layers/ParquetLayer.d.ts +9 -8
  24. package/layers/ParquetLayer.js +1 -1
  25. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  26. package/layers/raster/datasets/TIFFRaster.js +1 -1
  27. package/layers/support/ParquetPortalItemData.d.ts +2 -0
  28. package/layers/support/ParquetPortalItemData.js +1 -1
  29. package/layers/support/PortalItemData.d.ts +21 -0
  30. package/layers/support/parquetUtils.d.ts +1 -1
  31. package/layers/support/types.d.ts +1 -1
  32. package/package.json +2 -2
  33. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  34. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  35. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  36. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
  37. package/views/interactive/options/SnappingOptions.d.ts +1 -0
  38. package/views/interactive/options/TooltipOptions.d.ts +1 -0
  39. package/views/interactive/options/ViewOptions.d.ts +1 -0
  40. package/views/interactive/support/Units.d.ts +1 -0
  41. package/views/layers/ParquetLayerView.js +1 -1
  42. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  43. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  44. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  45. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +6 -0
  46. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  47. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  48. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  49. package/widgets/BatchAttributeForm.js +1 -1
  50. package/widgets/FeatureForm.d.ts +2 -2
  51. package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +0 -1
@@ -1 +1 @@
1
- {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentEditingDisabled":"Attachment editing is disabled.","attachmentLimitExceeded":"Attachment limit exceeded","attachmentLimitReached":"Attachment limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","captureUnsupportedAdd":"Capture is not supported on this device.","captureUnsupportedDetail":"Capture is not supported on this device.","chooseFile":"Choose file","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximumAudioLength":"Max audio length: {maxDuration}","maximumFileSize":"Maximum file size: {maxSize}","maximumNumberOfFiles":"Maximum number of files: {count}","maximumVideoLength":"Max video length: {maxDuration}","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachmentsShort":"Max: {count}","maxAttachments":"Maximum attachments: {count}","minimumNotMet":"Minimum attachment requirement not met","minimumNumberOfFiles":"Minimum number of files: {count}","minAttachmentsShort":"Min: {count}","minAttachments":"Minimum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","recordAudio":"Record audio","takePhoto":"Take photo","takeVideo":"Take video","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"addFeature":"Add feature","addRecord":"Add record","unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","noDynamicChoices":"No choices are available","noDynamicChoicesWithNoValue":"No other choices are available","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"other":"Other","recommended":"Recommended","relatedRecords":{"noOriginKeyFeature":"A feature cannot be added to '{relatedLayerName}' until the '{originKeyField}' has been entered.","noOriginKeyRecord":"A record cannot be added to '{relatedLayerName}' until the '{originKeyField}' has been entered.","noRecordsFound":"No records were found.","noRelatedRecordsFound":"No related records were found.","relatedRecordsTitle":"Related records","untitledLayer":"Untitled layer"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAll":"Show all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"totalCount":"Total: {count}","unsupported":"Unsupported","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Field is required.","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Select at least {min} of the options","tooManySelectedChoices":"Select no more than {max} of the options","tooShort":"This field requires a minimum of {min} characters","valuesIncompatible":"Value is incompatible with other selected values"},"valueExpressionError":"Failed to calculate value","viewAll":"View all","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."}}
1
+ {"attachments":{"addFile":"Add file","attachmentNumberedLabel":"Attachment {index}","attach":"Attach","attachmentEditingDisabled":"Attachment editing is disabled.","attachmentLimitExceeded":"Attachment limit exceeded","attachmentLimitReached":"Attachment limit reached","attachmentMustBeShorterThan":"Attachment must be shorter than {maxDuration}","attachmentsMustBeShorterThan":"Attachments must be shorter than {maxDuration}","attachmentMustBeSmallerThan":"Attachment must be smaller than {maxSize}","attachmentsMustBeSmallerThan":"Attachments must be smaller than {maxSize}","durationInSecond":"{count} second","durationInSeconds":"{count} seconds","capture":"Capture","captureMethodNotSupported":"Capture method is not supported","captureUnsupportedAdd":"Capture is not supported on this device.","captureUnsupportedDetail":"Capture is not supported on this device.","chooseFile":"Choose file","count":"Count: {count}","deleted":"Deleted","download":"Download","dragAndDropFile":"Drag and drop file.","fileExceedsMaximumSize":"File exceeds the maximum size","fileName":"File name","fileSelected":"File selected","fileToBeReplaced":"File to be replaced","imageResizedToMeetRequirements":"Image has been resized to meet requirements","maximumAudioLength":"Max audio length: {maxDuration}","maximumFileSize":"Maximum file size: {maxSize}","maximumNumberOfFiles":"Maximum number of files: {count}","maximumVideoLength":"Max video length: {maxDuration}","maximize":"Maximize","maximumNumberReachedRemoveToContinue":"Maximum number reached. Remove attachments to continue.","maxAttachmentsShort":"Max: {count}","maxAttachments":"Maximum attachments: {count}","minimumNotMet":"Minimum attachment requirement not met","minimumNumberOfFiles":"Minimum number of files: {count}","minAttachmentsShort":"Min: {count}","minAttachments":"Minimum attachments: {count}","noAttachments":"No attachments","noPreviewAvailable":"No preview available","remove":"Remove","replace":"Replace","recordAudio":"Record audio","takePhoto":"Take photo","takeVideo":"Take video","searchAttachments":"Search attachments","replaceFile":"Replace file","selectFile":"Select file","size":"Size","type":"Type","unableToAddAttachment":"Unable to add attachment","unableToAddAttachments":"Unable to add attachments","unsupportedDevice":"Unsupported device","unsupportedDeviceCaptureMessage":"This device does not support the required capture method.","viewAll":"View all","youCanAddUpToOneAttachment":"You can add up to 1 attachment","youCanAddUpToAttachments":"You can add up to {count} attachments"},"addFeature":"Add feature","addRecord":"Add record","unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","noDynamicChoices":"No choices are available","noDynamicChoicesWithNoValue":"No other choices are available","otherOptionLabel":"Other","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","footerButtons":{"add":"Add","delete":"Delete","discard":"Discard","done":"Done","replace":"Replace","reset":"Reset","update":"Update"},"footerNotices":{"deleteDisabledMinimumAttachments":"Delete disabled. This feature requires a minimum number of attachments."},"formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"other":"Other","recommended":"Recommended","relatedRecords":{"noOriginKeyFeature":"A feature cannot be added to '{relatedLayerName}' until the '{originKeyField}' has been entered.","noOriginKeyRecord":"A record cannot be added to '{relatedLayerName}' until the '{originKeyField}' has been entered.","noRecordsFound":"No records were found.","noRelatedRecordsFound":"No related records were found.","relatedRecordsTitle":"Related records","untitledLayer":"Untitled layer"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","deselectAllLabel":"Deselect all","selectAllLabel":"Select all","showAll":"Show all","showAllOptions":"Show all options","titles":{"addAttachments":"Add attachments","attachments":"Attachments","editFeature":"Edit feature","editFeatures":"Edit features","editAttachment":"Edit attachment","replaceAttachment":"Replace attachment"},"totalCount":"Total: {count}","unsupported":"Unsupported","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Field is required.","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooFewSelectedChoices":"Minimum selections required: {min}","tooManySelectedChoices":"Maximum selections allowed: {max}","tooShort":"This field requires a minimum of {min} characters","valuesIncompatible":"Value is incompatible with other selected values"},"valueExpressionError":"Failed to calculate value","viewAll":"View all","subtypes":{"changeWarning":"The subtype {newType} may have different default values from {originalType}. Keeping the current values may cause unexpected results.","changeWarningTitle":"Subtype changed","useDefaultValuesOption":"Use default values","keepCurrentValuesOption":"Keep current values","unsupportedDomainGroupTitle":"Unsupported","fieldOutOfSubtypeDomainWarning":"This field's value is out of range for its domain."}}
@@ -237,12 +237,14 @@ return value * 2.0 - 1.0;
237
237
  fragGlobalIllumination.rgb = vec3(0.0);
238
238
  `)}
239
239
 
240
- // Tone-map accumulated color before quantizing it for storage.
240
+ // Tone-map only the accumulated RGB lighting, not alpha (inverse occlusion).
241
241
  fragGlobalIllumination.rgb = tonemapKhronosNeutral(fragGlobalIllumination.rgb);
242
- fragGlobalIllumination.rgb = quantizeGlobalIlluminationColor(fragGlobalIllumination.rgb);
243
242
 
244
243
  // Accumulate occlusion
245
244
  fragGlobalIllumination.a = mix(lastFrameGlobalIllumination.a + accumulationDither, fragGlobalIllumination.a, occlusionBlendWeight);
246
245
 
246
+ // Quantize all channels after temporal blending and dithering for consistent RGBA8 storage.
247
+ fragGlobalIllumination = quantizeGlobalIlluminationColor(fragGlobalIllumination);
248
+
247
249
  fragWeight = vec2(occlusionBlendWeight, colorBlendWeight * storedColorBlendWeightScale);
248
250
  `),x}const M=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:A,build:j,defaultColorBleedWeight:0,defaultEmissionBoostFactor:x,defaultFactorDaylightDirectional:C,defaultRayMarchMaxReach:E,defaultRayMarchMaxReachEmissionWeight:1,defaultRayMarchMaxSteps:16,defaultRayMarchMinReach:T,defaultRayMarchMinReachEmissionWeight:1,defaultRayMarchWorldReach:25},Symbol.toStringTag,{value:`Module`}));export{A as G,M as a,k as b,j as c,E as d,S as e,x as f,C as g,O as h,T as i,D as j,w as k};
@@ -55,10 +55,7 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
55
55
  bool shouldReuseCenterOcclusion = isScaledGlobalIllumination && centerOcclusionBlendWeight <= ${c.float(g)};
56
56
  bool shouldSkipLowQualityBlur = !hasEmission && shouldReuseCenterOcclusion;
57
57
  if (shouldSkipLowQualityBlur) {
58
- fragColor = vec4(
59
- quantizeGlobalIlluminationColor(centerGlobalIllumination.rgb),
60
- centerGlobalIllumination.a
61
- );
58
+ fragColor = quantizeGlobalIlluminationColor(centerGlobalIllumination);
62
59
  return;
63
60
  }
64
61
 
@@ -100,5 +97,6 @@ import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{Sc
100
97
  float dither = ditherNoise(vec4(blurredEmission, occlusion)) - ${c.float(30517578125e-15)};
101
98
  blurredEmission += isScaledGlobalIllumination ? ${c.float(.85)} * dither : dither;
102
99
 
103
- fragColor = vec4(quantizeGlobalIlluminationColor(blurredEmission), occlusion);
100
+ // Quantize both filtered lighting and inverse occlusion before RGBA8 storage.
101
+ fragColor = quantizeGlobalIlluminationColor(vec4(blurredEmission, occlusion));
104
102
  `),e}const v=new p;v.useFloatBlend=!1;const y=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:g,build:_},Symbol.toStringTag,{value:`Module`}));export{g as G,y as a,_ as b};
@@ -79,4 +79,4 @@ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/Scr
79
79
  ) / jointBilateralWeightSum;
80
80
  }
81
81
  `),l.outputs.add(`fragColor`,`vec4`,0),l.outputs.add(`fragWeight`,`vec2`,1),f.main.add(a`sampleJointBilateralUpscale(uv, fragColor, fragWeight);
82
- fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),l}const m=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:`Module`}));export{f as G,m as a,p as b};
82
+ fragColor = quantizeGlobalIlluminationColor(fragColor);`),l}const m=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:`Module`}));export{f as G,m as a,p as b};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.144/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={apiKey:void 0,apiKeys:{scopes:[]},applicationName:``,applicationUrl:globalThis.location?.href,assetsPath:``,fontsUrl:`https://static.arcgis.com/fonts`,geometryServiceUrl:`https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer`,geoRSSServiceUrl:`https://utility.arcgis.com/sharing/rss`,kmlServiceUrl:`https://utility.arcgis.com/sharing/kml`,userPrivilegesApplied:!0,portalUrl:`https://www.arcgis.com`,respectPrefersReducedMotion:!0,routeServiceUrl:`https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`,workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[`arcgis.com`,`arcgisonline.com`,`esrikr.com`,`premiumservices.blackbridge.com`,`esripremium.accuweather.com`,`gbm.digitalglobe.com`,`firstlook.digitalglobe.com`,`msi.digitalglobe.com`],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:`high`,proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@5.2.0-next.146/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../Color.js";import{colorGamma as t,invColorGamma as n}from"../colorUtils.js";import{shuffle as r,getRandomNumberGenerator as i}from"./arrayUtils.js";import{clone as a}from"./lang.js";import{clamp as o}from"./mathUtils.js";import{equals as s}from"./libs/gl-matrix-2/math/vec4.js";import{fromValues as c}from"./libs/gl-matrix-2/factories/vec4f64.js";function l(e){return`r`in e&&`g`in e&&`b`in e}function u(e){return`h`in e&&`s`in e&&`v`in e}function d(e){return`l`in e&&`a`in e&&`b`in e}function f(e){return`l`in e&&`c`in e&&`h`in e}function p(e){return`x`in e&&`y`in e&&`z`in e}const m=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],h=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function g(e,t){let n=[],r,i;if(e[0].length!==t.length)throw Error(`dimensions do not match`);let a=e.length,o=e[0].length,s=0;for(r=0;r<a;r++){for(s=0,i=0;i<o;i++)s+=e[r][i]*t[i];n.push(s)}return n}function _(e){let t=[e.r/255,e.g/255,e.b/255].map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),n=g(m,t);return{x:n[0]*100,y:n[1]*100,z:n[2]*100}}function v(e){let t=g(h,[e.x/100,e.y/100,e.z/100]).map(e=>{let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))});return{r:Math.round(t[0]*255),g:Math.round(t[1]*255),b:Math.round(t[2]*255)}}function y(e){let t=[e.x/95.047,e.y/100,e.z/108.883].map(e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29);return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function b(e){let t=e.l,n=e.a,r=e.b,i=[(t+16)/116+n/500,(t+16)/116,(t+16)/116-r/200].map(e=>e>6/29?e**3:3*(6/29)**2*(e-4/29));return{x:i[0]*95.047,y:i[1]*100,z:i[2]*108.883}}function x(e){let t=e.l,n=e.a,r=e.b,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a=a>0?a:a+2*Math.PI,{l:t,c:i,h:a}}function S(e){let t=e.l,n=e.c,r=e.h;return{l:t,a:n*Math.cos(r),b:n*Math.sin(r)}}function C(e){return y(_(e))}function w(e){return v(b(e))}function T(e){return x(y(_(e)))}function E(e){return v(b(S(e)))}function D(e){let{r:t,g:n,b:r}=e,i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=i,s=a===0?0:i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,c=a===0?0:a/o;return s<0&&(s+=6),s*=60,c*=100,o*=100/255,{h:s,s:c,v:o}}function O(e){let t=(e.h+360)%360/60,n=e.s/100,r=e.v/100*255,i=r*n,a=i*(1-Math.abs(t%2-1)),o;switch(Math.floor(t)){case 0:o={r:i,g:a,b:0};break;case 1:o={r:a,g:i,b:0};break;case 2:o={r:0,g:i,b:a};break;case 3:o={r:0,g:a,b:i};break;case 4:o={r:a,g:0,b:i};break;case 5:case 6:o={r:i,g:0,b:a};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+r-i),o.g=Math.round(o.g+r-i),o.b=Math.round(o.b+r-i),o}function k(e){return l(e)?e:f(e)?E(e):d(e)?w(e):p(e)?v(e):u(e)?O(e):e}function A(e){return u(e)?e:D(k(e))}function j(e){return d(e)?e:C(k(e))}function M(e){return f(e)?e:T(k(e))}function N(e){return P(e).isBright?`light`:`dark`}function P(t){let{r:n,g:r,b:i,a}=t;return a<1&&(n=Math.round(a*n+(1-a)*255),r=Math.round(a*r+(1-a)*255),i=Math.round(a*i+(1-a)*255)),new e({r:n,g:r,b:i})}function F(e,t){let{r:n,g:r,b:i}=t?.ignoreAlpha?e:P(e);return .2126*n+.7152*r+.0722*i}function I(t,n=225){return F(t,{ignoreAlpha:!0})>n?new e([0,0,0,t.a]):new e([255,255,255,t.a])}function L(e,t){let n=j(e);n.l*=1-t;let r=k(n),i=e.clone();return i.setColor(r),i.a=e.a,i}function R(e,t){let n=e.clone();return n.a*=t,n}function z(e,t){let n=A(e);n.s*=t;let r=k(n),i=e.clone();return i.setColor(r),i.a=e.a,i}function B(e,t){return e===t||e!=null&&e.equals(t)}function V(e,t){return e===t||e!=null&&t!=null&&s(e,t)}function H(e){return c(e[0],e[1],e[2],e.length>3?e[3]:1)}function U(e){return e[0]??=0,e[1]??=0,e[2]??=0,e}function W(e){return e.length=4,U(e),e[3]??=1,o(e[3],0,1),e}function G(e,t){let n=e.toUnitRGBA();return n[3]*=t,n}function K(t,n,i={}){if(t.length===0||n<=0)return[];if(t=t.map(t=>typeof t==`string`?new e(t):t),t.length===1||n===1){let e=[],r=t[0];for(let t=0;t<n;t++)e.push(r.clone());return e}if(i.shuffle&&(t=r(a(t),i.seed)),t.length>=n){let e=[],r=(t.length-1)/(n-1);for(let i=0;i<n;i++){let n=Math.round(i*r);e.push(t[n].clone())}return e}return Z(t,n,i)}function q(t,n){let r=new e(t);if(!n?.strength||n.source!==`color`)return r;let[i,a,o]=r.toUnitRGB(),s=X(i,a,o),c=J(s.r+s.r*n.strength,s.g+s.g*n.strength,s.b+s.b*n.strength,r.a),l=J(i,a,o,r.a),[u,d,f]=c.toUnitRGB(),[p,m,h]=l.toUnitRGB(),g=Y(i+u-p,a+d-m,o+f-h);return new e([g.r*255,g.g*255,g.b*255,r.a])}function J(t,n,r,i){let a=.76,o=Math.max(t,Math.max(n,r));if(o<a)return new e([t*255,n*255,r*255,i]);let s=.24,c=1-s*s/(o+s-a),l=c/o,u=1-1/(.15*(o-c)+1),d=new e([t*l*255,n*l*255,r*l*255,i]),f=new e([c*255,c*255,c*255,i]);return e.blendColors(d,f,u)}function Y(e,t,r){return{r:e**n,g:t**n,b:r**n}}function X(e,n,r){return{r:e**t,g:n**t,b:r**t}}function Z(e,t,n={}){let i=[],a=e.length-1,o=Math.ceil((t-e.length)/a);outerLoop:for(let r=0;r<a;r++){let a=e[r],s=e[r+1];for(let r=1;r<=o;r++){let c=r/(o+1);if(i.push($(a,s,c,n)),i.length+e.length===t)break outerLoop}}return[...e.map(e=>e.clone()),...r(i,n.seed??1)]}const Q=(e,t)=>{let n=Math.floor(t()*10)-5;return Math.min(255,Math.max(0,e+n))};function $(t,n,r,a={}){let o=t.r,s=t.g,c=t.b,l=n.r,u=n.g,d=n.b,f=Math.round(o+(l-o)*r),p=Math.round(s+(u-s)*r),m=Math.round(c+(d-c)*r);if(!a.offset)return new e([f,p,m]);let h=i(a.seed);return new e([Q(f,h),Q(p,h),Q(m,h)])}export{B as colorEquals,V as colorVectorEquals,H as colorVectorToColorAndOpacity,K as createUniqueColors,L as darken,z as desaturate,F as getColorLuminance,N as getColorTheme,q as getColorWithEmissiveStrength,I as getContrast,l as isRGB,R as multiplyOpacity,G as multiplyOpacityToUnitRGBA,A as toHSV,j as toLAB,M as toLCH,k as toRGB,U as validateColor,W as validateColorAndOpacity};
2
+ import e from"../Color.js";import{colorGamma as t,invColorGamma as n}from"../colorUtils.js";import{shuffle as r,getRandomNumberGenerator as i}from"./arrayUtils.js";import{clone as a}from"./lang.js";import{clamp as o}from"./mathUtils.js";import{equals as s}from"./libs/gl-matrix-2/math/vec4.js";import{fromValues as c}from"./libs/gl-matrix-2/factories/vec4f64.js";function l(e){return`r`in e&&`g`in e&&`b`in e}function u(e){return`h`in e&&`s`in e&&`v`in e}function d(e){return`l`in e&&`a`in e&&`b`in e}function f(e){return`l`in e&&`c`in e&&`h`in e}function p(e){return`x`in e&&`y`in e&&`z`in e}const m=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],h=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function g(e,t){let n=[],r,i;if(e[0].length!==t.length)throw Error(`dimensions do not match`);let a=e.length,o=e[0].length,s=0;for(r=0;r<a;r++){for(s=0,i=0;i<o;i++)s+=e[r][i]*t[i];n.push(s)}return n}function _(e){let t=[e.r/255,e.g/255,e.b/255].map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),n=g(m,t);return{x:n[0]*100,y:n[1]*100,z:n[2]*100}}function v(e){let t=g(h,[e.x/100,e.y/100,e.z/100]).map(e=>{let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))});return{r:Math.round(t[0]*255),g:Math.round(t[1]*255),b:Math.round(t[2]*255)}}function y(e){let t=[e.x/95.047,e.y/100,e.z/108.883].map(e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29);return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function b(e){let t=e.l,n=e.a,r=e.b,i=[(t+16)/116+n/500,(t+16)/116,(t+16)/116-r/200].map(e=>e>6/29?e**3:3*(6/29)**2*(e-4/29));return{x:i[0]*95.047,y:i[1]*100,z:i[2]*108.883}}function x(e){let t=e.l,n=e.a,r=e.b,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a=a>0?a:a+2*Math.PI,{l:t,c:i,h:a}}function S(e){let t=e.l,n=e.c,r=e.h;return{l:t,a:n*Math.cos(r),b:n*Math.sin(r)}}function C(e){return y(_(e))}function w(e){return v(b(e))}function T(e){return x(y(_(e)))}function E(e){return v(b(S(e)))}function D(e){let{r:t,g:n,b:r}=e,i=Math.max(t,n,r),a=i-Math.min(t,n,r),o=i,s=a===0?0:i===t?(n-r)/a%6:i===n?(r-t)/a+2:(t-n)/a+4,c=a===0?0:a/o;return s<0&&(s+=6),s*=60,c*=100,o*=100/255,{h:s,s:c,v:o}}function O(e){let t=(e.h+360)%360/60,n=e.s/100,r=e.v/100*255,i=r*n,a=i*(1-Math.abs(t%2-1)),o;switch(Math.floor(t)){case 0:o={r:i,g:a,b:0};break;case 1:o={r:a,g:i,b:0};break;case 2:o={r:0,g:i,b:a};break;case 3:o={r:0,g:a,b:i};break;case 4:o={r:a,g:0,b:i};break;case 5:case 6:o={r:i,g:0,b:a};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+r-i),o.g=Math.round(o.g+r-i),o.b=Math.round(o.b+r-i),o}function k(e){return l(e)?e:f(e)?E(e):d(e)?w(e):p(e)?v(e):u(e)?O(e):e}function A(e){return u(e)?e:D(k(e))}function j(e){return d(e)?e:C(k(e))}function M(e){return f(e)?e:T(k(e))}function N(e){return P(e).isBright?`light`:`dark`}function P(t){let{r:n,g:r,b:i,a}=t;return a<1&&(n=Math.round(a*n+(1-a)*255),r=Math.round(a*r+(1-a)*255),i=Math.round(a*i+(1-a)*255)),new e({r:n,g:r,b:i})}function F(e,t){let{r:n,g:r,b:i}=t?.ignoreAlpha?e:P(e);return .2126*n+.7152*r+.0722*i}function I(t,n=225){return F(t,{ignoreAlpha:!0})>n?new e([0,0,0,t.a]):new e([255,255,255,t.a])}function L(e,t){let n=j(e);n.l*=1-t;let r=k(n),i=e.clone();return i.setColor(r),i.a=e.a,i}function R(e,t){let n=e.clone();return n.a*=t,n}function z(e,t){let n=A(e);n.s*=t;let r=k(n),i=e.clone();return i.setColor(r),i.a=e.a,i}function B(e,t){return e===t||e!=null&&e.equals(t)}function V(e,t){return e===t||e!=null&&t!=null&&s(e,t)}function H(e){return c(e[0],e[1],e[2],e.length>3?e[3]:1)}function U(e){return e[0]??=0,e[1]??=0,e[2]??=0,e}function W(e){return e.length=4,U(e),e[3]??=1,o(e[3],0,1),e}function G(e,t){let n=e.toUnitRGBA();return n[3]*=t,n}function K(t,n,i={}){if(t.length===0||n<=0)return[];if(t=t.map(t=>typeof t==`string`?new e(t):t),t.length===1||n===1){let e=[],r=t[0];for(let t=0;t<n;t++)e.push(r.clone());return e}if(i.shuffle&&(t=r(a(t),i.seed)),t.length>=n){let e=[],r=(t.length-1)/(n-1);for(let i=0;i<n;i++){let n=Math.round(i*r);e.push(t[n].clone())}return e}return Z(t,n,i)}function q(t,n){let r=new e(t);if(!n?.strength||n.source!==`color`)return r;let[i,a,o]=r.toUnitRGB(),s=X(i,a,o),c=J(s.r+s.r*n.strength,s.g+s.g*n.strength,s.b+s.b*n.strength,r.a),l=J(s.r,s.g,s.b,r.a),[u,d,f]=c.toUnitRGB(),[p,m,h]=l.toUnitRGB(),g=Y(s.r+u-p,s.g+d-m,s.b+f-h);return new e([g.r*255,g.g*255,g.b*255,r.a])}function J(t,n,r,i){let a=.76,o=Math.max(t,Math.max(n,r));if(o<a)return new e([t*255,n*255,r*255,i]);let s=.24,c=1-s*s/(o+s-a),l=c/o,u=1-1/(.15*(o-c)+1),d=new e([t*l*255,n*l*255,r*l*255,i]),f=new e([c*255,c*255,c*255,i]);return e.blendColors(d,f,u)}function Y(e,t,r){return{r:e**n,g:t**n,b:r**n}}function X(e,n,r){return{r:e**t,g:n**t,b:r**t}}function Z(e,t,n={}){let i=[],a=e.length-1,o=Math.ceil((t-e.length)/a);outerLoop:for(let r=0;r<a;r++){let a=e[r],s=e[r+1];for(let r=1;r<=o;r++){let c=r/(o+1);if(i.push($(a,s,c,n)),i.length+e.length===t)break outerLoop}}return[...e.map(e=>e.clone()),...r(i,n.seed??1)]}const Q=(e,t)=>{let n=Math.floor(t()*10)-5;return Math.min(255,Math.max(0,e+n))};function $(t,n,r,a={}){let o=t.r,s=t.g,c=t.b,l=n.r,u=n.g,d=n.b,f=Math.round(o+(l-o)*r),p=Math.round(s+(u-s)*r),m=Math.round(c+(d-c)*r);if(!a.offset)return new e([f,p,m]);let h=i(a.seed);return new e([Q(f,h),Q(p,h),Q(m,h)])}export{B as colorEquals,V as colorVectorEquals,H as colorVectorToColorAndOpacity,K as createUniqueColors,L as darken,z as desaturate,F as getColorLuminance,N as getColorTheme,q as getColorWithEmissiveStrength,I as getContrast,l as isRGB,R as multiplyOpacity,G as multiplyOpacityToUnitRGBA,A as toHSV,j as toLAB,M as toLCH,k as toRGB,U as validateColor,W as validateColorAndOpacity};
@@ -4,21 +4,51 @@ import type { SingleChoiceInputProperties } from "./SingleChoiceInput.js";
4
4
  export interface DynamicChoiceInputProperties extends SingleChoiceInputProperties, Partial<Pick<DynamicChoiceInput, "choiceExpression">> {}
5
5
 
6
6
  /**
7
- * The `DynamicChoiceInput` class defines the desired user interface for a dynamic choice group input. This [FieldElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#input) is used in [field elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate`. This is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget.
7
+ * The `DynamicChoiceInput` class defines the desired user interface for a dynamic choice group input. It lets users select a field value from a list of choices generated by an [Arcade](https://developers.arcgis.com/arcade) expression, rather than a fixed list. It is supported in both single and batch feature editing. Use a [dynamic choice input](/references/core/form/elements/inputs/DynamicChoiceInput/) when the available options depend on the feature being edited, values entered in other fields, or data queried from another layer or table.
8
+ *
9
+ * This [FieldElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#input) is used in [field elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) `formTemplate`. This is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/).
10
+ *
11
+ * To configure a dynamic choice input, set its [choiceExpression](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/DynamicChoiceInput/#choiceExpression) to the name of an Arcade expression in the form template's [FormTemplate.expressionInfos](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/#expressionInfos). The expression returns a dictionary containing a `choices` array, where each choice has a `name` for its display text and a `code` for the value stored in the field.
8
12
  *
9
13
  * @since 5.2
10
14
  * @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/)
11
15
  * @example
12
16
  * // Creates a new dynamic choice input for a field element within a form
13
17
  * const dynamicChoiceInput = new DynamicChoiceInput({
14
- * choiceExpression: "expr/dynamicChoiceExpression",
15
- * noValueOptionLabel: "No Value",
16
- * showNoValueOption: true,
18
+ * choiceExpression: dynamicChoiceExpression.name, // reference to the defined expression
19
+ * noValueOptionLabel: "No Value (null)",
20
+ * showNoValueOption: false,
17
21
  * });
18
22
  */
19
23
  export default class DynamicChoiceInput extends SingleChoiceInput {
20
24
  constructor(properties?: DynamicChoiceInputProperties);
21
- /** A reference to an [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expression that returns a dictionary. The dictionary should have a `choices` array of objects, with each object in the array having a `name` property that is the text displayed to the user, and a `code` property that is the value assigned to the field when that choice is selected. */
25
+ /**
26
+ * A reference to an [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expression that returns a dictionary. The dictionary should have a `choices` array of objects, with each object in the array having a `name` property that is the text displayed to the user, and a `code` property that is the value assigned to the field when that choice is selected.
27
+ *
28
+ * @example
29
+ * // Set the choice expression for the dynamic choice input
30
+ * fieldElement.input = new DynamicChoiceInput({
31
+ * choiceExpression: dynamicChoiceExpression.name
32
+ * });
33
+ *
34
+ * const dynamicChoiceExpression = new ExpressionInfo({
35
+ * name: "dynamic-material-choices",
36
+ * title: "Dynamic material choices",
37
+ * expression:
38
+ * `var choices = [
39
+ * { name: "Unknown", code: 0 },
40
+ * { name: "Cast Iron - CAS", code: 83 },
41
+ * { name: "Copper - COP", code: 84 },
42
+ * { name: "Ductile Iron - DIP", code: 88 },
43
+ * { name: "Polyvinyl Chloride - PVC", code: 94 },
44
+ * { name: "Lead - LP", code: 109 }
45
+ * ];
46
+ * return {
47
+ * choices: choices
48
+ * };`,
49
+ * returnType: "dictionary",
50
+ * });
51
+ */
22
52
  accessor choiceExpression: string | null | undefined;
23
53
  /** The type of form element input. */
24
54
  get type(): "dynamic-choice";
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.144`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}has(`host-webworker`)||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has(`host-webworker`);export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
2
+ import has from"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.146`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}has(`host-webworker`)||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has(`host-webworker`);export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
@@ -41,6 +41,7 @@ import type { UniqueValueRendererProperties } from "../renderers/UniqueValueRend
41
41
  import type { ClassBreaksRendererProperties } from "../renderers/ClassBreaksRenderer.js";
42
42
  import type { SimpleRendererProperties } from "../renderers/SimpleRenderer.js";
43
43
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
44
+ import type { PortalItemDataProperties } from "./support/PortalItemData.js";
44
45
  import type { ParquetPortalItemDataProperties } from "./support/ParquetPortalItemData.js";
45
46
  import type { ParquetFilesDataProperties } from "./support/ParquetFilesData.js";
46
47
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
@@ -49,7 +50,7 @@ import type { LayerProperties } from "./Layer.js";
49
50
  export interface ParquetLayerProperties extends LayerProperties, CustomParametersMixinProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, DataSeriesLayerProperties, OrderedLayerProperties, BlendLayerProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, Partial<Pick<ParquetLayer, "charts" | "copyright" | "definitionExpression" | "geometryType" | "labelsVisible" | "legendEnabled" | "outFields" | "popupEnabled">> {
50
51
  /**
51
52
  * The data source for the ParquetLayer. Set this property to [parquet files](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/)
52
- * or a [portal item](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetPortalItemData/) to define which Parquet content the layer loads.
53
+ * or a [portal item](https://developers.arcgis.com/javascript/latest/references/core/layers/support/PortalItemData/) to define which Parquet content the layer loads.
53
54
  *
54
55
  * @since 5.1
55
56
  * @example
@@ -65,14 +66,14 @@ export interface ParquetLayerProperties extends LayerProperties, CustomParameter
65
66
  * @example
66
67
  * // Create a parquet layer from arcgis online portal item
67
68
  * const layer = new ParquetLayer({
68
- * data: new ParquetPortalItemData({
69
+ * data: new PortalItemData({
69
70
  * portalItem: {
70
71
  * id: "6ab6f959c1684eb5a54db91644a89747",
71
72
  * },
72
73
  * }),
73
74
  * });
74
75
  */
75
- data?: (ParquetFilesDataProperties | (ParquetPortalItemDataProperties & { type: "portal-item" })) | null;
76
+ data?: (ParquetFilesDataProperties | (ParquetPortalItemDataProperties & { type: "portal-item" }) | (PortalItemDataProperties & { type: "portal-item" })) | null;
76
77
  /**
77
78
  * An array of fields in the layer.
78
79
  *
@@ -261,7 +262,7 @@ export interface ParquetLayerProperties extends LayerProperties, CustomParameter
261
262
  *
262
263
  * // Create a parquet layer from arcgis online portal item
263
264
  * const layer = new ParquetLayer({
264
- * data: new ParquetPortalItemData({
265
+ * data: new PortalItemData({
265
266
  * portalItem: {
266
267
  * id: "6ab6f959c1684eb5a54db91644a89747",
267
268
  * },
@@ -321,7 +322,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
321
322
  /**
322
323
  * @example
323
324
  * const layer = new ParquetLayer({
324
- * data: new ParquetPortalItemData({
325
+ * data: new PortalItemData({
325
326
  * portalItem: {
326
327
  * id: "6ab6f959c1684eb5a54db91644a89747",
327
328
  * },
@@ -342,7 +343,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
342
343
  accessor copyright: string | null | undefined;
343
344
  /**
344
345
  * The data source for the ParquetLayer. Set this property to [parquet files](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/)
345
- * or a [portal item](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetPortalItemData/) to define which Parquet content the layer loads.
346
+ * or a [portal item](https://developers.arcgis.com/javascript/latest/references/core/layers/support/PortalItemData/) to define which Parquet content the layer loads.
346
347
  *
347
348
  * @since 5.1
348
349
  * @example
@@ -358,7 +359,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
358
359
  * @example
359
360
  * // Create a parquet layer from arcgis online portal item
360
361
  * const layer = new ParquetLayer({
361
- * data: new ParquetPortalItemData({
362
+ * data: new PortalItemData({
362
363
  * portalItem: {
363
364
  * id: "6ab6f959c1684eb5a54db91644a89747",
364
365
  * },
@@ -366,7 +367,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
366
367
  * });
367
368
  */
368
369
  get data(): ParquetDataUnion | null | undefined;
369
- set data(value: (ParquetFilesDataProperties | (ParquetPortalItemDataProperties & { type: "portal-item" })) | null | undefined);
370
+ set data(value: (ParquetFilesDataProperties | (ParquetPortalItemDataProperties & { type: "portal-item" }) | (PortalItemDataProperties & { type: "portal-item" })) | null | undefined);
370
371
  /**
371
372
  * The SQL where clause used to filter features on the client. Only the features that satisfy the definition
372
373
  * expression are displayed in the map. Setting a definition expression is useful
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import a from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{getFilename as u}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import g from"../graphic/ParquetGraphicOrigin.js";import _ from"./Layer.js";import{ParquetSource as v}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{FeatureEffectLayer as S}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as C}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{OrderedLayer as T}from"./mixins/OrderedLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as D}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as O,legendEnabled as k,popupEnabled as A}from"./support/commonProperties.js";import j from"./support/FeatureTemplate.js";import M from"./support/Field.js";import{defineFieldProperties as N}from"./support/fieldProperties.js";import{fixRendererFields as P}from"./support/fieldUtils.js";import F from"./support/GeometryEncodingLocation.js";import I from"./support/GeometryEncodingWkb.js";import L from"./support/LabelClass.js";import{reader as R}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import B from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as V}from"./support/parquetUtils.js";import{rendererTypes as H}from"../renderers/support/typeUtils.js";import U from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{utc as G}from"../time/constants.js";const K=N(),q=`__OBJECTID`,J={types:{key:`type`,base:null,typeMap:{wkb:I,location:F}},json:{name:`layerDefinition.geometryEncoding`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryEncoding`}}}}};let Y=class extends C(S(y(T(x(D(E(w(s(b(n(_))))))))))){constructor(e){super(e),this._emptyUrls=new r,this.charts=null,this.copyright=null,this.definitionExpression=null,this.returnM=void 0,this.returnZ=void 0,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new g(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=q,this.operationalLayerType=`ParquetLayer`,this.outFields=null,this.persistenceEnabled=!!has(`parquetlayer-persistence-enabled`),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.type=`parquet`,this.data=null}initialize(){this.addHandles(l(()=>this.source,`source-changed`,()=>{this.emit(`refresh`,{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get dateFieldsTimeZone(){return G}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,n,r){let i=e.filter(e=>e.name!==q||e.type!==`oid`).map(e=>e.toJSON(r));c(n,i,t)}get isTable(){return this.geometryEncoding==null&&this.displayOptimization==null}set renderer(e){P(e,this.fieldsIndex),this._set(`renderer`,e)}get title(){let e=this._get(`title`);if(e&&this.originOf(`title`)!==`defaults`)return e;switch(this.data?.type){case`files`:{let t=this.data.urls?.at(0);e=t?u(t,[`parquet`]):null;break}case`portal-item`:e=this.data.portalItem?.title}return e||`Parquet`}set title(e){this._set(`title`,e)}writeData(e,t,n,r){if(!e)return;if(e.type===`portal-item`&&e.portalItem?.type!==`Parquet Feature Layer`){r.messages?.push(new a(`parquet-layer:unsupported-data`,`Portal item with type '${e.portalItem?.type}' is not supported in web maps`,{layer:this,itemId:e.portalItem?.id}));return}let i=e.write({},r);i&&(t.source=i)}get urls(){return this.data?.type===`files`?this.data.urls:this._emptyUrls}set urls(e){i(o.getLogger(this),`urls`,{replacement:`data`,version:`5.1`,warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return W(this,e)}createQuery(){let e=new U;return e.returnGeometry=!0,e.outFields=[`*`],e.where=this.definitionExpression||`1=1`,e}async createSource(e){let t=new v({layer:this});return await t.load(e),t}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();let n=await this.source.queryFeatures(this._normalizeQuery(e),t),r=this.graphicOrigin;if(n?.features)for(let e of n.features)e.layer=e.sourceLayer=this,e.origin=r;return n}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}async hasDataChanged(){if(this.data?.type===`portal-item`){let e=this.data.portalItem,t=e.modified?.getTime();if(await e.reload(),t===e.modified?.getTime())return!1}return await this.source.reload(null),!0}_normalizeQuery(e){return U.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new r(e):e??new r}async _load(e){this.data?.type===`portal-item`&&await this.data.portalItem.load();let t=await this.createSource(e);this._set(`source`,t),this.read(t.sourceJSON,{origin:`service`}),[`fields`].forEach(e=>this.revertToOrigin(e,`service`)),P(this.renderer,this.fieldsIndex),this.spatialReference??=h.WGS84}};e([d({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,`capabilities`,null),e([d({json:{origins:{"web-scene":{write:!1}},write:!0}})],Y.prototype,`charts`,void 0),e([d({type:String})],Y.prototype,`copyright`,void 0),e([d({readOnly:!0})],Y.prototype,`dateFieldsTimeZone`,null),e([d({readOnly:!0})],Y.prototype,`defaultPopupTemplate`,null),e([d({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Y.prototype,`definitionExpression`,void 0),e([d({type:Boolean})],Y.prototype,`returnM`,void 0),e([d({type:Boolean})],Y.prototype,`returnZ`,void 0),e([d()],Y.prototype,`displayOptimization`,void 0),e([d({type:[M],json:{name:`layerDefinition.fields`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:`fields`}}}})],Y.prototype,`fields`,void 0),e([p(`fields`)],Y.prototype,`writeFields`,null),e([d(K.fieldsIndex)],Y.prototype,`fieldsIndex`,void 0),e([d(J)],Y.prototype,`geometryEncoding`,void 0),e([d({type:m,json:{name:`extent`}})],Y.prototype,`fullExtent`,void 0),e([d({type:V.apiValues,json:{name:`layerDefinition.geometryType`,read:{reader:V.read},write:{writer:V.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryType`,reader:V.read}}}}})],Y.prototype,`geometryType`,void 0),e([d({readOnly:!0,clonable:!1})],Y.prototype,`graphicOrigin`,void 0),e([d(O)],Y.prototype,`labelsVisible`,void 0),e([d({type:[L],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:R},write:!0}})],Y.prototype,`labelingInfo`,void 0),e([d(k)],Y.prototype,`legendEnabled`,void 0),e([d()],Y.prototype,`file`,void 0),e([d({type:String,readOnly:!0})],Y.prototype,`objectIdField`,void 0),e([d({type:[`ParquetLayer`]})],Y.prototype,`operationalLayerType`,void 0),e([d(K.outFields)],Y.prototype,`outFields`,void 0),e([d(A)],Y.prototype,`popupEnabled`,void 0),e([d({type:t,json:{name:`popupInfo`,write:!0}})],Y.prototype,`popupTemplate`,void 0),e([d({types:H,json:{name:`layerDefinition.drawingInfo.renderer`,write:!0,origins:{service:{read:{source:`drawingInfo.renderer`}}}}})],Y.prototype,`renderer`,null),e([d({type:v,readOnly:!0,cast:null,json:{read:!1}})],Y.prototype,`source`,void 0),e([d({type:h,json:{name:`layerDefinition.spatialReference`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`extent.spatialReference`}}}}})],Y.prototype,`spatialReference`,void 0),e([d({type:[j]})],Y.prototype,`templates`,void 0),e([d()],Y.prototype,`title`,null),e([d({json:{read:!1},readOnly:!0})],Y.prototype,`type`,void 0),e([d({types:{key:`type`,base:null,typeMap:{files:z,"portal-item":B}},json:{name:`source`,origins:{"web-map":{write:{target:`source`,ignoreOrigin:!0}}}}})],Y.prototype,`data`,void 0),e([p(`web-map`,`data`)],Y.prototype,`writeData`,null),e([d({type:r.ofType(String),json:{read:!1,write:!1}})],Y.prototype,`urls`,null),Y=e([f(`esri.layers.ParquetLayer`)],Y);export{Y as default};
2
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import a from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as c}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{getFilename as u}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import g from"../graphic/ParquetGraphicOrigin.js";import _ from"./Layer.js";import{ParquetSource as v}from"./graphics/sources/ParquetSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{FeatureEffectLayer as S}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as C}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{OrderedLayer as T}from"./mixins/OrderedLayer.js";import{RefreshableLayer as E}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as D}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as O,legendEnabled as k,popupEnabled as A}from"./support/commonProperties.js";import j from"./support/FeatureTemplate.js";import M from"./support/Field.js";import{defineFieldProperties as N}from"./support/fieldProperties.js";import{fixRendererFields as P}from"./support/fieldUtils.js";import F from"./support/GeometryEncodingLocation.js";import I from"./support/GeometryEncodingWkb.js";import L from"./support/LabelClass.js";import{reader as R}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import{parquetGeometryTypeKebabDict as B}from"./support/parquetUtils.js";import V from"./support/PortalItemData.js";import{rendererTypes as H}from"../renderers/support/typeUtils.js";import U from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{utc as G}from"../time/constants.js";const K=N(),q=`__OBJECTID`,J={types:{key:`type`,base:null,typeMap:{wkb:I,location:F}},json:{name:`layerDefinition.geometryEncoding`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryEncoding`}}}}};let Y=class extends C(S(y(T(x(D(E(w(s(b(n(_))))))))))){constructor(e){super(e),this._emptyUrls=new r,this.charts=null,this.copyright=null,this.definitionExpression=null,this.returnM=void 0,this.returnZ=void 0,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new g(this),this.hasM=!1,this.hasZ=!1,this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=q,this.operationalLayerType=`ParquetLayer`,this.outFields=null,this.persistenceEnabled=!!has(`parquetlayer-persistence-enabled`),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.type=`parquet`,this.data=null}initialize(){this.addHandles(l(()=>this.source,`source-changed`,()=>{this.emit(`refresh`,{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get dateFieldsTimeZone(){return G}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,n,r){let i=e.filter(e=>e.name!==q||e.type!==`oid`).map(e=>e.toJSON(r));c(n,i,t)}get isTable(){return this.geometryEncoding==null&&this.displayOptimization==null}set renderer(e){P(e,this.fieldsIndex),this._set(`renderer`,e)}get title(){let e=this._get(`title`);if(e&&this.originOf(`title`)!==`defaults`)return e;switch(this.data?.type){case`files`:{let t=this.data.urls?.at(0);e=t?u(t,[`parquet`]):null;break}case`portal-item`:e=this.data.portalItem?.title}return e||`Parquet`}set title(e){this._set(`title`,e)}writeData(e,t,n,r){if(!e)return;if(e.type===`portal-item`&&e.portalItem?.type!==`Parquet Feature Layer`){r.messages?.push(new a(`parquet-layer:unsupported-data`,`Portal item with type '${e.portalItem?.type}' is not supported in web maps`,{layer:this,itemId:e.portalItem?.id}));return}let i=e.write({},r);i&&(t.source=i)}get urls(){return this.data?.type===`files`?this.data.urls:this._emptyUrls}set urls(e){i(o.getLogger(this),`urls`,{replacement:`data`,version:`5.1`,warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return W(this,e)}createQuery(){let e=new U;return e.returnGeometry=!0,e.outFields=[`*`],e.where=this.definitionExpression||`1=1`,e}async createSource(e){let t=new v({layer:this});return await t.load(e),t}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,t){await this.load();let n=await this.source.queryFeatures(this._normalizeQuery(e),t),r=this.graphicOrigin;if(n?.features)for(let e of n.features)e.layer=e.sourceLayer=this,e.origin=r;return n}async queryObjectIds(e,t){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),t)}async queryFeatureCount(e,t){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),t)}async queryExtent(e,t){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),t)}async hasDataChanged(){if(this.data?.type===`portal-item`){let e=this.data.portalItem,t=e.modified?.getTime();if(await e.reload(),t===e.modified?.getTime())return!1}return await this.source.reload(null),!0}_normalizeQuery(e){return U.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new r(e):e??new r}async _load(e){this.data?.type===`portal-item`&&await this.data.portalItem.load();let t=await this.createSource(e);this._set(`source`,t),this.read(t.sourceJSON,{origin:`service`}),[`fields`].forEach(e=>this.revertToOrigin(e,`service`)),P(this.renderer,this.fieldsIndex),this.spatialReference??=h.WGS84}};e([d({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,`capabilities`,null),e([d({json:{origins:{"web-scene":{write:!1}},write:!0}})],Y.prototype,`charts`,void 0),e([d({type:String})],Y.prototype,`copyright`,void 0),e([d({readOnly:!0})],Y.prototype,`dateFieldsTimeZone`,null),e([d({readOnly:!0})],Y.prototype,`defaultPopupTemplate`,null),e([d({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Y.prototype,`definitionExpression`,void 0),e([d({type:Boolean})],Y.prototype,`returnM`,void 0),e([d({type:Boolean})],Y.prototype,`returnZ`,void 0),e([d()],Y.prototype,`displayOptimization`,void 0),e([d({type:[M],json:{name:`layerDefinition.fields`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:`fields`}}}})],Y.prototype,`fields`,void 0),e([p(`fields`)],Y.prototype,`writeFields`,null),e([d(K.fieldsIndex)],Y.prototype,`fieldsIndex`,void 0),e([d(J)],Y.prototype,`geometryEncoding`,void 0),e([d({type:m,json:{name:`extent`}})],Y.prototype,`fullExtent`,void 0),e([d({type:B.apiValues,json:{name:`layerDefinition.geometryType`,read:{reader:B.read},write:{writer:B.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`geometryType`,reader:B.read}}}}})],Y.prototype,`geometryType`,void 0),e([d({readOnly:!0,clonable:!1})],Y.prototype,`graphicOrigin`,void 0),e([d({type:Boolean,json:{read:!1,write:!1,origins:{service:{read:!0}}}})],Y.prototype,`hasM`,void 0),e([d({type:Boolean,json:{read:!1,write:!1,origins:{service:{read:!0}}}})],Y.prototype,`hasZ`,void 0),e([d(O)],Y.prototype,`labelsVisible`,void 0),e([d({type:[L],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:R},write:!0}})],Y.prototype,`labelingInfo`,void 0),e([d(k)],Y.prototype,`legendEnabled`,void 0),e([d()],Y.prototype,`file`,void 0),e([d({type:String,readOnly:!0})],Y.prototype,`objectIdField`,void 0),e([d({type:[`ParquetLayer`]})],Y.prototype,`operationalLayerType`,void 0),e([d(K.outFields)],Y.prototype,`outFields`,void 0),e([d(A)],Y.prototype,`popupEnabled`,void 0),e([d({type:t,json:{name:`popupInfo`,write:!0}})],Y.prototype,`popupTemplate`,void 0),e([d({types:H,json:{name:`layerDefinition.drawingInfo.renderer`,write:!0,origins:{service:{read:{source:`drawingInfo.renderer`}}}}})],Y.prototype,`renderer`,null),e([d({type:v,readOnly:!0,cast:null,json:{read:!1}})],Y.prototype,`source`,void 0),e([d({type:h,json:{name:`layerDefinition.spatialReference`,write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:`extent.spatialReference`}}}}})],Y.prototype,`spatialReference`,void 0),e([d({type:[j]})],Y.prototype,`templates`,void 0),e([d()],Y.prototype,`title`,null),e([d({json:{read:!1},readOnly:!0})],Y.prototype,`type`,void 0),e([d({types:{key:`type`,base:null,typeMap:{files:z,"portal-item":V}},json:{name:`source`,origins:{"web-map":{write:{target:`source`,ignoreOrigin:!0}}}}})],Y.prototype,`data`,void 0),e([p(`web-map`,`data`)],Y.prototype,`writeData`,null),e([d({type:r.ofType(String),json:{read:!1,write:!1}})],Y.prototype,`urls`,null),Y=e([f(`esri.layers.ParquetLayer`)],Y);export{Y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as n}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../../core/units.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as ee,negativeInfinity as h}from"../../../../geometry/support/aaBoundingBox.js";import{copy as te,negativeInfinity as g,create as ne,expandWithRect as re}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as _,isWGS84 as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as y,readParquetFileAttribute as b}from"../../../parquet.js";import{convertToGeometry as x}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as S}from"../../data/attributeSupport.js";import{getQueryResultExtent as C,getQueryBoundingRects as w,QueryEngine as T}from"../../data/QueryEngine.js";import{queryCapabilities as ie}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as ae}from"./clientSideDefaults.js";import{getParquetFileId as oe,getParquetRowId as se,getParquetObjectId as ce}from"./parquetIdUtils.js";import A from"../../../support/Field.js";import j from"../../../support/FieldsIndex.js";import{isNumericField as M}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as N}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as F,toParquetJSONGeometryType as I}from"../../../support/parquetUtils.js";import{loadParquetModule as L}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as R}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as z}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as H}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as U}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const W=new z,G=`__OBJECTID`,K=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){s(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new c({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let n=await this._provider.getMetadata(),i=await P(n,{fields:e.fields?.map(e=>A.fromJSON(e)),geometryEncoding:e.geometryEncoding?N(e.geometryEncoding):null,geometryType:e.geometryType?F(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!n?.hasZ,this._hasM=!!n?.hasM,!i.fields)throw new r(`parquet:unsupported`,`Fields must be defined`);let o;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new r(`parquet:unsupported`,`SpatialReference must be defined`);if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:i.spatialReference}),i.spatialReference=d.WGS84),o={geometry:i.geometryEncoding?{geometryType:I(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;i.file=c;let{fields:l}=i;if(l==null)throw new r(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new A({name:G,type:`oid`,alias:G}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=j.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=I(i.geometryType??`point`);return this._metadata=H.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:G},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:R}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:G},hasM:this._hasM,hasZ:this._hasZ,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=n?.extent?n.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:ae(f),extent:this._fullExtent??void 0,geometryType:f,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),we(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,K):K,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!q(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),q(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new r(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let r=await D(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!q(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};let i=n(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;let a=f(p(),h),o=p(),s=await this._enqueueQuery(r,t),c=0;for(let e of s.items)e.getBounds(o)&&(m(a,o),c+=1);let l=C(a,i,r.outSR?n(r.outSR):i.toJSON(),i,!1);return{count:c,extent:l}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,K,n)}),i=this._streamIdCounter++,a=o(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await L()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new U(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=x(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?Ce(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await L();switch(t.type){case`xz`:return{type:`xz`,fieldName:y(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:y(t.xColumn),yFieldName:y(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),h),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];ee(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await L()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(_(c)||v(c))){let t=te(ne(),g);for(let n of w(e.geometry))re(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await L()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,n,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,r){let i=a[r];if(i==null){if(o.get(r)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return ce(n,t)}return null}let s=o.get(r);return b(t,e.rowGroup,e.row,i,s.type)}},c=await l(i,this._fieldsIndex);if(!c.isStandardized)throw new r(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>c.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=c.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,K),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new U(this._metadata,this._indexMap,e,s.id);return X([new B(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??K,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i){if(n>0){n--;continue}if(s.push(e),--r<=0)return s}l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=oe(t),r=se(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new r(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let n=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=n?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return n||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=await this._getRequiredFields(e),a=(await L()).Query.new();a.setOutFields(i),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,K,r),s=await o.next(r),c=0,l=[];for(;s!=null;){let e=new U(this._metadata,this._indexMap,s,t),n=new B(e,null,c++,!1);l.push(n),s=await o.next(r)}return X(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of S(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!_(t)&&!v(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=u(t)/u(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function q(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!q(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&M(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return J(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function J(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Se(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Se(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new V;for(let t of e)n.insert(t);return new T({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ce(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},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:{...ie,maxRecordCount:K,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},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 we(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as n}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as o,throwIfAborted as s}from"../../../../core/promiseUtils.js";import{QueueProcessor as c}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../../core/units.js";import d from"../../../../geometry/SpatialReference.js";import{set as f,create as p,expandWithAABB as m,expandWithRect as ee,negativeInfinity as h}from"../../../../geometry/support/aaBoundingBox.js";import{copy as te,negativeInfinity as g,create as ne,expandWithRect as re}from"../../../../geometry/support/aaBoundingRect.js";import{isWebMercator as _,isWGS84 as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{normalizeColumnPath as y,readParquetFileAttribute as b}from"../../../parquet.js";import{convertToGeometry as x}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as S}from"../../data/attributeSupport.js";import{getQueryResultExtent as C,getQueryBoundingRects as w,QueryEngine as T}from"../../data/QueryEngine.js";import{queryCapabilities as ie}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as D}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{readFieldStatistic as k}from"../parquet/ParquetFileStatistics.js";import{createDrawingInfo as ae}from"./clientSideDefaults.js";import{getParquetFileId as oe,getParquetRowId as se,getParquetObjectId as ce}from"./parquetIdUtils.js";import A from"../../../support/Field.js";import j from"../../../support/FieldsIndex.js";import{isNumericField as M}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as N}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as F,toParquetJSONGeometryType as I}from"../../../support/parquetUtils.js";import{loadParquetModule as L}from"../../../../libs/librust-parquet/loadParquetModule.js";import{utc as R}from"../../../../time/constants.js";import{FeatureStoreQueryAdapter as z}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as V}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as H}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as U}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const W=new z,G=`__OBJECTID`,K=8e3;class le{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){s(e),await this._fill(e);let t=await ue(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,t.chunk!=null)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<8;){let t=this._getOrCreateNextStream(e);if(t==null)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){let t=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<t){let t=this._files[this._fileIndex++],n=new de(t.id,this._createFileStream(t,e));return this._streams.push(n),n}return this._getNextStream()}_getNextStream(){let e=this._streams.length;for(let t=0;t<e;t++){let n=(this._streamIndex+t)%e,r=this._streams[n];if(r.canRead)return this._streamIndex=(n+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ue(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class de{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&this._readCount===0}async read(e){this._readCount++;try{let t=await(await this._stream).next(e);return t==null?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:t}}finally{this._readCount--}}}class fe{constructor(){this._hasZ=!1,this._hasM=!1,this._queue=new c({concurrency:4,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){let t=e.spatialReference?d.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);this._customParameters=e.customParameters,this._loadParameters=e,await this._updateProvider(O(e.provider,null,()=>this._customParameters));let n=await this._provider.getMetadata(),i=await P(n,{fields:e.fields?.map(e=>A.fromJSON(e)),geometryEncoding:e.geometryEncoding?N(e.geometryEncoding):null,geometryType:e.geometryType?F(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(this._hasZ=!!n?.hasZ,this._hasM=!!n?.hasM,!i.fields)throw new r(`parquet:unsupported`,`Fields must be defined`);let o;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new r(`parquet:unsupported`,`SpatialReference must be defined`);if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new r(`parquet:unsupported-projection`,`Only WGS84 and Web Mercator are supported`);i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger(`parquet:unsupported-projection`).warn(`Found a geographic projection that is not WGS84. Handling as WGS84.`,{spatialReference:i.spatialReference}),i.spatialReference=d.WGS84),o={geometry:i.geometryEncoding?{geometryType:I(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(o),this._capabilities=$(await this._getFileStatistics(),this._hasZ,this._hasM);let s=await this._provider.getFiles();if(!s.length)return{layerDefinition:{},capabilities:$(null,this._hasZ,this._hasM)};let c=await s[0].file;i.file=c;let{fields:l}=i;if(l==null)throw new r(`parquet-layer:missing-metadata`,`Unable to create parquet source: cannot infer fields`,l);l.push(new A({name:G,type:`oid`,alias:G}));for(let e of l){let t=c.getColumnId(e.name);t!=null&&(this._indexMap[e.name]=t)}let u=j.fromLayerJSON({fields:l.map(e=>e.toJSON()),dateFieldsTimeReference:{timeZoneIANA:`UTC`}});this._fieldsIndex=u;let f=I(i.geometryType??`point`);return this._metadata=H.createFeature({fieldsIndex:u.toJSON(),geometryType:f,hasZ:this._hasZ,hasM:this._hasM,featureIdInfo:{type:`object-id`,fieldName:G},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,attributeSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:R}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:f,featureIdInfo:{type:`object-id`,fieldName:G},hasM:this._hasM,hasZ:this._hasZ,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=n?.extent?n.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:ae(f),extent:this._fullExtent??void 0,geometryType:f,hasZ:this._hasZ,hasM:this._hasM,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(let{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy(``)}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._loadParameters={...this._loadParameters,provider:e};let t=O(e,this._provider.getGeometryInfo(),()=>this._customParameters);await this._updateProvider(t)}async getDiagnosticsSnapshot(){let e=await this._provider.getFiles();return{files:await Promise.all(e.map(e=>e.getDiagnosticsSnapshot()))}}async getColumnIndex(e){return(await this._getFileInfoById(e.fileId)).getColumnIndex(e.rowGroupIndex,e.columnIndex)}async getOffsetIndex(e){return(await this._getFileInfoById(e.fileId)).getOffsetIndex(e.rowGroupIndex,e.columnIndex)}async queryFeatures(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),we(n)||(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,K):K,n.resultOffset=n.resultOffset??0),n.outStatistics?this._queryStatistics(n,t):(n.returnDistinctValues&&(n.returnGeometry=void 0),(await this._enqueueQuery(n,t)).createQueryResponse())}async queryFeatureCount(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),!q(n)&&!n.returnDistinctValues&&!n.groupByFieldsForStatistics?.length&&!n.outStatistics?.length?this._getFeatureCount():(n.returnDistinctValues||(n.outFields=void 0),n.returnGeometry=void 0,(await this._enqueueQuery(n,t)).createQueryResponseForCount())}async queryObjectIds(e,t){let n=await D(e,null,this._queryEngineParams.spatialReference);return this._validateQuery(n),q(n)?(n.resultRecordCount=n.resultRecordCount?Math.min(n.resultRecordCount,8e3):8e3,n.resultOffset=n.resultOffset??0,n.returnGeometry=void 0,n.outFields=void 0,n.returnDistinctValues=void 0,(await this._enqueueQuery(n,t)).items.map(e=>e.getObjectId())):Array.from({length:await this._getFeatureCount()},(e,t)=>t)}async queryAttributeBins(e,t={}){throw new r(`parquet:unsupported`,`queryAttributeBins not supported.`)}async queryExtent(e,t){let r=await D(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!q(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};let i=n(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;let a=f(p(),h),o=p(),s=await this._enqueueQuery(r,t),c=0;for(let e of s.items)e.getBounds(o)&&(m(a,o),c+=1);let l=C(a,i,r.outSR?n(r.outSR):i.toJSON(),i,!1);return{count:c,extent:l}}async queryStream(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=await this._getCandidateFiles(e),r=new le(n,async(t,n)=>{let r=await t.file,i=await this._createParquetDisplayQuery(r,t.id,e);return r.executeQuery(i,K,n)}),i=this._streamIdCounter++,a=o(t.signal,e=>{let t=this._streams.get(i);t!=null&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw Error(`InternalError: AbortSignal must be passed`);let n=this._streams.get(e);if(!n)return{result:null};let r=await n.stream.next(t.signal);if(r==null)return n.handle.remove(),this._streams.delete(e),{result:null};let i=r.chunk.serialize().buffer,a={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){let{result:n}=await this.getStreamNext(e,t);if(n==null)return null;let r=(await L()).ParquetChunk.deserialize(new Uint8Array(n.buffer)),i=new U(this._metadata,this._indexMap,r,n.fileId),a=[];for(;i.next();){let e=x(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,n,r,i){if(!i.signal)throw Error(`InternalError: AbortSignal must be passed`);return(await(await(await this._getFileInfoById(e)).file).createChunkPatch(t,n,r,i.signal)).serialize().buffer}async _updateProvider(e){let t=this._provider;this._handles.removeAll(),this._provider=e,this._handles.add([e.events.on(`rangeRead`,e=>{this._source.onRangeRead(e)}),e.events.on(`sourceChanged`,async()=>{await this.reload(this._loadParameters),await this._source.onSourceChange()})]),await t?.destroy()}async _getCandidateFiles(e){let t=await this._provider.getFiles(),n=await this._getSpatialFilePruning(e);if(n==null)return t;let r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,n));return n.type===`xz`?Ce(r,n):r}async _queryStatistics(e,t){let n=await D({...e},null,this._queryEngineParams.spatialReference);if(n.returnGeometry=void 0,ve(n,this._fieldsIndex)){let e=await this._getStatisticsFromFiles(n);if(e)return e}return(await this._enqueueQuery(n,t)).createQueryResponse()}async _getStatisticsFromFiles(e){let t=await this._provider.getFiles(),n={},r=[];for(let i of e.outStatistics??[]){let e=xe(i,t);if(!e.available)return null;n[i.outStatisticFieldName]=e.value,r.push(be(i,this._fieldsIndex))}return{fields:r,features:[{attributes:n}]}}async _getSpatialFilePruning(e){if(e.type!==`tile`&&(e.type!==`arcade`||e.extent==null))return null;let t=this._displayOptimization?.index;if(t==null)return null;let n=e.outSpatialReference.wkid;if(t.wkid==null||n==null)return null;let r=t.wkid,i=await L();switch(t.type){case`xz`:return{type:`xz`,fieldName:y(t.code),intersects:(a,o)=>i.queryIntersectsXZStatistics(t.fullExtent,e.extent,n,r,t.maxLevel,a,o)};case`z`:return{type:`xy`,xFieldName:y(t.xColumn),yFieldName:y(t.yColumn),intersects:(t,a,o,s)=>i.queryIntersectsXYStatistics(e.extent,n,r,t,a,o,s)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case`xz`:{let n=Z(e,t);return n?.type===`null-only`?!1:n?.type!==`bounds`||t.intersects(n.minValue,n.maxValue)}case`xy`:{let n=e.statistics.statistics.get(t.xFieldName),r=e.statistics.statistics.get(t.yFieldName);return n?.type===`null-only`||r?.type===`null-only`?!1:n?.type!==`bounds`||r?.type!==`bounds`||t.intersects(n.minValue,n.maxValue,r.minValue,r.maxValue)}}}async _tryDeriveParquetFullExtent(n){if(!n.spatialReference)return null;if(this._fullExtent==null&&n.geometryEncoding?.type===`location`){let r=await this._provider.getFiles(),{xField:i,yField:a}=n.geometryEncoding,o=f(p(),h),s=!1;for(let n of r){let r=await n.file;for(let n of r.rowGroups()){let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,n.columnDescriptorForAttribute(i),!1),c=e(r,n.columnDescriptorForAttribute(a),!1),l=k(t),u=k(c);if(l?.type===`bounds`&&u?.type===`bounds`){let e=[l.minValue,u.minValue,l.maxValue,u.maxValue];ee(o,e),s=!0}n.free()}catch(e){r.error=e,r.hasError=!0}finally{t(r)}}}return s?{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:n.spatialReference?.toJSON()}:null}return null}async _getFileInfoById(e){let t=await this._provider.getFiles();for(let n of t)if(n.id===e)return n;throw Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,n,r,i){let a=(await L()).Query.new();n!=null&&a.setPreFilterStart(n),r!=null&&a.setPreFilterCount(r),i!=null&&a.setPostFilterCount(i);let o=await this._getRequiredFields(e);a.setOutFields(o),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM);let s=this._tryGetGeneralizedGeometryResolution(e);s!=null&&a.setSourceResolution(s);let c=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=c.wkid;if(e.geometry&&(_(c)||v(c))){let t=te(ne(),g);for(let n of w(e.geometry))re(t,n);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){let{id:n,file:r}=t;await this._setWhereClause(a,await r,n,e.where)}return a}async _createParquetDisplayQuery(e,t,n){let r=(await L()).Query.new();if(n.type===`tile`){r.setExtent(n.extent),r.setQuantizationTransform(n.transform);let e=this._sourceResolution(n.resolution,n.outSpatialReference);e!=null&&r.setSourceResolution(e)}else n.type===`arcade`&&n.extent!=null&&r.setExtent(n.extent);return r.setOutFields(n.outFields.filter(e=>this._indexMap[e]!=null)),r.setOutSpatialReference(n.outSpatialReference.wkid),r.setReturnGeometry(n.returnGeometry),r.setReturnZ(n.returnZ),r.setReturnM(n.returnM),n.where&&await this._setWhereClause(r,e,t,n.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r(`parquet:unsupported`,`Statistics queries are not supported`,{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r(`parquet:unsupported`,`Queries using orderBy are not supported`,{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r(`parquet:unsupported`,`Queries using returnDistinctValues are not supported`,{query:e})}async _setWhereClause(e,t,n,i){let a=this._indexMap,o=this._fieldsIndex,s={getAttribute(e,r){let i=a[r];if(i==null){if(o.get(r)?.name===`__OBJECTID`){let t=e.row+e.rowGroupStart;return ce(n,t)}return null}let s=o.get(r);return b(t,e.rowGroup,e.row,i,s.type)}},c=await l(i,this._fieldsIndex);if(!c.isStandardized)throw new r(`sql-parse-error`,`expression is not standardized`);let u=(e,t,n)=>c.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:n},s,null),d=c.fieldNames.map(e=>o.get(e)).filter(e=>e&&this._indexMap[e?.name]!=null);e.setWhere(i),e.setWhereEvaluator(u),e.setWhereFields(d.map(e=>e.name))}async*_streamFeatures(e,t,n,r,i){let a=await this._provider.getFiles(),o=0;for(let s of a){let a=o,c=o+s.statistics.rowCount;if(o+=s.statistics.rowCount,t!=null&&t>=c)continue;let l=t==null?null:Math.max(t-a,0),u=n;if(n!=null){let e=t??0,r=e+n;u=Math.max(Math.min(r,c)-Math.max(e,a),0)}if(u===0)continue;let d=await this._createParquetQuery(e,s,l,u,r),f=await(await s.file).executeQuery(d,K),p=async()=>{let e=await f.next(i);if(!e)return null;let t=new U(this._metadata,this._indexMap,e,s.id);return X([new B(t,null,0,!1)],this._queryEngineParams)},m=await p();for(;m!=null;)yield m,m=await p()}}async _queryFeaturesWithQueryEnginePagination(e,t){let n=[],r=this._streamFeatures(e,null,null,null,t),i=await r.next();for(;!i.done;){let a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of a)n.push(e);i=await r.next()}return n}async _queryFeaturesWithUpfrontPagination(e,t){let n=e.resultOffset??0,r=e.resultRecordCount??K,i,a,o;ge(e)?_e(e)||(o=n+r):(n&&=(i=n,0),a=e.resultRecordCount);let s=[],c=this._streamFeatures(e,i,a,o,t),l=await c.next();for(;!l.done&&r>0;){let i=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(let e of i){if(n>0){n--;continue}if(s.push(e),--r<=0)return s}l=await c.next()}return s}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){let n=new Map;for(let t of e.objectIds){let e=oe(t),r=se(t),i=n.get(e);i||(i=[],n.set(e,i)),i.push(r)}let r=[];for(let[i,a]of n.entries()){let n=await this._executeFileIdQuery(e,i,a,t);for(let e of n)r.push(e)}return new E(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}if(e.where===`1=1`&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>2e7&&!(this._displayOptimization&&e.geometry))throw new r(`parquet:cannot-execute-query`,`Unable to execute query, dataset is too large.`);let n=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=n?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return n||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:this._hasM,hasZ:this._hasZ,featureAdapter:W,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,n,r){let i=await this._getRequiredFields(e),a=(await L()).Query.new();a.setOutFields(i),a.setReturnGeometry(!!e.returnGeometry),a.setReturnZ(!!e.returnZ),a.setReturnM(!!e.returnM),a.setIds(new Uint32Array(n));let o=await(await this._getFile(t)).executeQuery(a,K,r),s=await o.next(r),c=0,l=[];for(;s!=null;){let e=new U(this._metadata,this._indexMap,s,t),n=new B(e,null,c++,!1);l.push(n),s=await o.next(r)}return X(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){let t=new Set;if(e.outStatistics)for(let n of S(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(n);else if(e.outFields)for(let n of e.outFields)t.add(n);return(t.has(`*`)?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>this._indexMap[e]!=null)}_tryGetGeneralizedGeometryResolution(e){if(!this._displayOptimization)return null;let t=e.outSR??this._queryEngineParams.spatialReference;if(!_(t)&&!v(t))return null;let n=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return n?this._sourceResolution(n,t):null}_sourceResolution(e,t){let n=this._queryEngineParams.spatialReference,r=u(t)/u(n)*e;return!Number.isFinite(r)||r<=0?null:r}}function pe(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:case`resultOffset`:case`resultRecordCount`:return!0;default:return!1}}function me(e){switch(e){case`fullText`:case`having`:case`timeExtent`:case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:case`objectIds`:case`where`:case`geometry`:return!0;default:return!1}}function he(e){switch(e){case`fullText`:case`having`:case`timeExtent`:return!0;case`historicMoment`:case`aggregateIds`:case`uniqueIds`:case`gdbVersion`:return!1;case`objectIds`:case`where`:case`resultOffset`:case`geometry`:case`resultRecordCount`:return!1}return!1}function q(e){for(let t in e){let n=t;if(pe(n)&&e[n]!==null)return!0}return!1}function ge(e){for(let t in e){let n=t;if(me(n)&&e[n]!==null)return!0}return!1}function _e(e){for(let t in e){let n=t;if(he(n)&&e[n]!==null)return!0}return!1}function ve(e,t){return!!e.outStatistics?.length&&!q(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case`count`:return e.onStatisticField===`1`||t.get(e.onStatisticField)!=null;case`min`:case`max`:{let n=t.get(e.onStatisticField);return n!=null&&M(n)}default:return!1}}function be(e,t){let n=e.statisticType===`exceedslimit`?null:t.get(e.onStatisticField),r=(e.statisticType===`min`||e.statisticType===`max`)&&n?.type===`esriFieldTypeDate`?n.type:`esriFieldTypeDouble`;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function xe(e,t){switch(e.statisticType){case`count`:return J(e,t);case`min`:return Y(e,t,Math.min);case`max`:return Y(e,t,Math.max);default:return{available:!1,value:null}}}function J(e,t){if(e.statisticType!==`count`)return{available:!1,value:null};if(e.onStatisticField===`1`)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let n=0;for(let r of t){let t=r.statistics.statistics.get(e.onStatisticField);if(t==null||t.nullCount==null)return{available:!1,value:null};n+=r.statistics.rowCount-t.nullCount}return{available:!0,value:n}}function Y(e,t,n){if(e.statisticType!==`min`&&e.statisticType!==`max`)return{available:!1,value:null};let r=null,i=e.statisticType===`min`?`minValue`:`maxValue`;for(let a of t){let t=a.statistics.statistics.get(e.onStatisticField);if(t==null)return{available:!1,value:null};switch(t.type){case`null-only`:continue;case`unknown`:return{available:!1,value:null};case`bounds`:{let e=Se(t[i]);if(e==null)return{available:!1,value:null};r=r==null?e:n(r,e);break}}}return{available:!0,value:r}}function Se(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function X(e,t){let n=new V;for(let t of e)n.insert(t);return new T({...t,featureStore:n})}function Z(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ce(e,t){return e.slice().sort((e,n)=>{let r=Q(e,t),i=Q(n,t);return r===i?0:r<i?-1:1})}function Q(e,t){let n=Z(e,t);return n?.type===`bounds`?n.maxValue-n.minValue:1/0}function $(e,t,n){let r=e?.featureCount,i=!1;return r!=null&&r<has(`parquetlayer-full-query-feature-count`)&&(i=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:n,supportsTrueCurve:!1,supportsZ:t},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:{...ie,maxRecordCount:K,supportsOrderBy:i,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},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 we(e){return!!e.objectIds?.length||!!e.outStatistics||!!e.orderByFields?.length||!!e.returnDistinctValues}export{fe as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import o from"../../../geometry/Point.js";import s from"../../../geometry/SpatialReference.js";import c from"./BaseRaster.js";import{parse as l}from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as d}from"./pamParser.js";import{parseSignature as f,getPyramidIFDs as p,getMaskIFDs as m,parseIFD as h,parseFieldValues as g,isBSQConfig as _,getTagNumericValues as v,getTagFirstNumericValue as y,getImageInfo as b}from"../formats/tiffParser.js";import{tiffTags as x,geoKeys as S}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as C}from"../functions/stretchUtils.js";import w from"../transforms/PolynomialTransform.js";import T from"../../support/RasterInfo.js";import E from"../../support/RasterStorageInfo.js";import D from"../../../rest/support/FeatureSet.js";let O=class extends c{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10*1024**2,this.datasetFormat=`TIFF`}async fetchRawTile(e,t,n,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,n))return null;let i=await this._fetchRawTiffTile(e,t,n,!1,r);if(i!=null&&this._headerInfo.hasMaskBand){let a=await this._fetchRawTiffTile(e,t,n,!0,r);a!=null&&a.pixels[0]instanceof Uint8Array&&(i.mask=a.pixels[0])}return i}async _open(e){let r=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:`array-buffer`,signal:r});if(!i)throw new t(`tiffraster:open`,`failed to open url `+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf(`/`)+1,this.url.lastIndexOf(`.`));let{littleEndian:a,firstIFDPos:o,isBigTiff:s}=f(i),c=[],l={fileChunk:i,posIFD:o,fileOffset:0};await this._readIFDs(c,l,a,s?8:4,r);let{imageInfo:u,rasterInfo:d}=k(c),h=p(c),g=m(c);if(this._headerInfo={littleEndian:a,isBigTiff:s,ifds:c,pyramidIFDs:h,maskIFDs:g,...u},this._set(`rasterInfo`,d),!u.isSupported)throw new t(`tiffraster:open`,`this tiff is not supported: `+u.message);if(!u.tileWidth)throw new t(`tiffraster:open`,`none-tiled tiff is not optimized for access, convert to COG and retry.`);d.isPseudoSpatialReference&&n.getLogger(this).warn(`The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.`);let _=c[0].get(`PREDICTOR`)?.values?.[0];if(c[0].get(`SAMPLEFORMAT`)?.values?.[0]===3&&_===2)throw new t(`tiffraster:open`,`unsupported horizontal difference encoding. Predictor=3 is supported for floating point data`);let{skipMapInfo:v,skipExtensions:y=[]}=this.ioConfig;if(!y.includes(`aux.xml`)&&!v){let t=await this._fetchAuxiliaryMetaData(e);t!=null&&A(t,d)}!y.includes(`vat.dbf`)&&d.bandCount===1&&d.pixelType===`u8`&&!v&&(d.attributeTable=await this._fetchAuxiliaryTable(e),d.attributeTable!=null&&(d.keyProperties.DataType=`thematic`)),v&&this.updateImageSpaceRasterInfo(d),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:n,fileOffset:r,posIFD:i}=e;return(i+8>=n.byteLength||i<0)&&(r=i+r,n=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:`array-buffer`,signal:t})).data,i=0),{fileChunk:n,fileOffset:r,posIFD:i}}async _readIFDs(e,n,r,i=4,a){if(!n.posIFD)return null;n=await this._validateOrFetchHeaderBuffer(n,a);let o=await this._readIFD(n,r,x,i,a);if(!o?.ifd)throw new t(`tiffraster:open`,`cannot parse tiff header. failed to open url `+this.url);if(e.push(o.ifd),!o.nextIFD)return null;n.posIFD=o.nextIFD-n.fileOffset,await this._readIFDs(e,n,r,i,a)}async _readIFD(e,t,n=x,r=4,i){let{fileChunk:a,posIFD:o,fileOffset:s}=e;if(!e.fileChunk)return null;let c=h(a,t,o,s,n,r);if(c.success){let e=[];if(c.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,c.nextIFD,i),c.ifd?.has(`GEOKEYDIRECTORY`)){let e=c.ifd.get(`GEOKEYDIRECTORY`),n=e?.values;if(n&&n.length>4){let r=n[0]+`.`+n[1]+`.`+n[2];o=e.valueOffset+6-s;let c=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:o,fileOffset:s},i);e.data=(await this._readIFD(c,t,S,2,i))?.ifd,e.data&&e.data.set(`GEOTIFFVersion`,{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return c}return c.requiredBufferSize?(a=(await this.request(this.url,{range:{from:s,to:s+o+c.requiredBufferSize+8},responseType:`array-buffer`,signal:i})).data,a.byteLength<o+c.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=s,this._readIFD(e,t,n,r,i))):null}async _fillOffsets(e,t,n,r){let i=e.filter(e=>e.offlineOffsetSize!=null);if(i.length===0)return;let a=i.map(e=>e.offlineOffsetSize),o=Math.min.apply(null,a.map(e=>e[0])),s=Math.max.apply(null,a.map(e=>e[0]+e[1])),c=a.length===1||s-o<=this._bufferSize;if(!c&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),c=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===s),c){let e=await this._fetchOffsets(o,Math.max(s,o+this._bufferSize),r);i.forEach(n=>g(e,t,n,o));return}let l=i.map(async e=>{let n=e.offlineOffsetSize,i=await this._fetchOffsets(n[0],n[1]+n[0],r);g(i,t,e,n[0])});await Promise.all(l)}async _fetchOffsets(e,t,n){let r=[],i=this._chunkSize,a=Math.ceil((t-e)/i),o=e;for(let e=0;e<a;e++)r.push(this.request(this.url,{range:{from:o,to:e===a-1?t:o+i-1},responseType:`array-buffer`,signal:n})),o+=i;let s=await Promise.all(r);if(a===1)return s[0].data;let c=new Uint8Array(t-e+1);for(let e=0;e<a;e++)c.set(new Uint8Array(s[e].data),e*i);return c.buffer}async _fetchRawTiffTile(e,t,n,r,i={}){let a=this._getTileLocation(e,t,n,r);if(!a)return null;let{ranges:o,actualTileWidth:s,actualTileHeight:c,ifd:l}=a,u=o.map(e=>this.request(this.url,{range:e,responseType:`array-buffer`,signal:i.signal})),d=await Promise.all(u),f=d.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=d.length===1?d[0].data:new ArrayBuffer(f),m=[0],h=[0];if(d.length>1){let e=new Uint8Array(p);for(let t=0,n=0;t<d.length;t++){let r=d[t].data;e.set(new Uint8Array(r),n),m[t]=n,n+=r.byteLength,h[t]=r.byteLength}}let{blockWidth:g,blockHeight:_}=this.getBlockWidthHeight(e),v=await this.decodePixelBlock(p,{format:`tiff`,customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:m,sizes:h},width:g,height:_,planes:null,pixelType:null});if(v==null)return null;if(s!==g||c!==_){let e=v.mask;if(e)for(let t=0;t<_;t++){let n=t*g;if(t<c)for(let t=s;t<g;t++)e[n+t]=0;else for(let t=0;t<g;t++)e[n+t]=0}else{e=new Uint8Array(g*_),v.mask=e;for(let t=0;t<c;t++){let n=t*g;for(let t=0;t<s;t++)e[n+t]=1}}}return v}_getTileLocation(e,t,n,r=!1){let{firstPyramidLevel:i,blockBoundary:a}=this.rasterInfo.storageInfo,o=e===0?0:e-(i-1),{_headerInfo:s}=this;if(!s)return null;let c=r?s.maskIFDs[o]:o===0?s.ifds[0]:s.pyramidIFDs[o-1];if(!c)return null;let l=_(c,s),u=v(c,`TILEOFFSETS`),d=v(c,`TILEBYTECOUNTS`);if(!u?.length||!d?.length)return null;let{minRow:f,minCol:p,maxRow:m,maxCol:h}=a[o];if(t>m||n>h||t<f||n<p)return null;let g=y(c,`IMAGEWIDTH`),b=y(c,`IMAGELENGTH`),x=y(c,`TILEWIDTH`),S=y(c,`TILELENGTH`),C=[];if(l){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(m+1)*(h+1)+t*(h+1)+n;C[r]={from:u[e],to:u[e]+d[e]-1}}}else{let e=t*(h+1)+n;C.push({from:u[e],to:u[e]+d[e]-1})}for(let e=0;e<C.length;e++)if(C[e].from==null||!C[e].to||C[e].to<0)return null;return{ranges:C,ifd:c,actualTileWidth:n===h&&g%x||x,actualTileHeight:t===m&&b%S||S}}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+`.aux.xml`,{responseType:`xml`,signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+`.vat.dbf`,{responseType:`array-buffer`,signal:e?.signal}),n=l(t);return n?.recordSet?D.fromJSON(n.recordSet):null}catch{return null}}};e([r()],O.prototype,`_files`,void 0),e([r()],O.prototype,`_headerInfo`,void 0),e([r()],O.prototype,`_bufferSize`,void 0),e([r()],O.prototype,`_chunkSize`,void 0),e([r({type:String,json:{write:!0}})],O.prototype,`datasetFormat`,void 0),O=e([i(`esri.layers.raster.datasets.TIFFRaster`)],O);function k(e){let t=b(e),{width:n,height:r,tileWidth:i,tileHeight:c,planes:l,pixelType:u,compression:f,firstPyramidLevel:p,maximumPyramidLevel:m,pyramidBlockWidth:h,pyramidBlockHeight:g,pyramidResolutions:_,tileBoundary:v,affine:y,metadata:x,colormap:S}=t,C=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid,D=d(C),O=!!t.isPseudoGeographic;D??=(O=!0,new s({wkid:3857}));let k=new a({...t.extent,spatialReference:D}),A=k?new o({x:k.xmin,y:k.ymax,spatialReference:D}):new o({x:0,y:0}),j=new E({blockWidth:i,blockHeight:c,pyramidBlockWidth:h,pyramidBlockHeight:g,compression:f,origin:A,firstPyramidLevel:p,maximumPyramidLevel:m,pyramidResolutions:_,blockBoundary:v}),M=new o({x:(k.xmax-k.xmin)/n,y:(k.ymax-k.ymin)/r,spatialReference:D}),N=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{},P=new T({width:n,height:r,bandCount:l,pixelType:u,pixelSize:M,storageInfo:j,spatialReference:D,isPseudoSpatialReference:O,keyProperties:N,extent:k,colormap:S,statistics:x?x.statistics:null});if(y?.length&&(P.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:n-.5,ymax:.5,spatialReference:D}),P.transform=new w({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),P.extent=P.transform.forwardTransform(P.nativeExtent),P.pixelSize=new o({x:(k.xmax-k.xmin)/n,y:(k.ymax-k.ymin)/r,spatialReference:D}),j.origin.x=-.5,j.origin.y=.5),_){let{x:e,y:t}=P.pixelSize;_.forEach(n=>{n.x*=e,n.y*=t})}return{imageInfo:t,rasterInfo:P}}function A(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&t.statistics==null&&(t.statistics=C(e.histograms)),e.transform&&t.transform==null){t.transform=e.transform,t.nativeExtent=t.extent;let n=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new o({x:(n.xmax-n.xmin)/t.width,y:(n.ymax-n.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=n}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}const j=O;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import o from"../../../geometry/Point.js";import s from"../../../geometry/SpatialReference.js";import c from"./BaseRaster.js";import{parse as l}from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as d}from"./pamParser.js";import{parseSignature as f,getPyramidIFDs as p,getMaskIFDs as m,parseIFD as h,parseFieldValues as g,isBSQConfig as _,getTagNumericValues as v,getTagFirstNumericValue as y,getImageInfo as b}from"../formats/tiffParser.js";import{tiffTags as x,geoKeys as S}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as C}from"../functions/stretchUtils.js";import w from"../transforms/PolynomialTransform.js";import T from"../../support/RasterInfo.js";import E from"../../support/RasterStorageInfo.js";import D from"../../../rest/support/FeatureSet.js";const O=`none-tiled tiff is not optimized for access, convert to COG and retry.`;let k=class extends c{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10*1024**2,this.datasetFormat=`TIFF`}async fetchRawTile(e,t,n,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,n))return null;let i=await this._fetchRawTiffTile(e,t,n,!1,r);if(i!=null&&this._headerInfo.hasMaskBand){let a=await this._fetchRawTiffTile(e,t,n,!0,r);a!=null&&a.pixels[0]instanceof Uint8Array&&(i.mask=a.pixels[0])}return i}async _open(e){let r=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:`array-buffer`,signal:r});if(!i)throw new t(`tiffraster:open`,`failed to open url `+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf(`/`)+1,this.url.lastIndexOf(`.`));let{littleEndian:a,firstIFDPos:o,isBigTiff:s}=f(i),c=[],l={fileChunk:i,posIFD:o,fileOffset:0};await this._readIFDs(c,l,a,s?8:4,r);let{imageInfo:u,rasterInfo:d}=A(c),h=p(c),g=m(c);if(this._headerInfo={littleEndian:a,isBigTiff:s,ifds:c,pyramidIFDs:h,maskIFDs:g,...u},this._set(`rasterInfo`,d),!u.isSupported)throw new t(`tiffraster:open`,`this tiff is not supported: `+u.message);if(!u.tileWidth||!u.tileHeight)throw new t(`tiffraster:open`,O);d.isPseudoSpatialReference&&n.getLogger(this).warn(`The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.`);let _=c[0].get(`PREDICTOR`)?.values?.[0];if(c[0].get(`SAMPLEFORMAT`)?.values?.[0]===3&&_===2)throw new t(`tiffraster:open`,`unsupported horizontal difference encoding. Predictor=3 is supported for floating point data`);let{skipMapInfo:v,skipExtensions:y=[]}=this.ioConfig;if(!y.includes(`aux.xml`)&&!v){let t=await this._fetchAuxiliaryMetaData(e);t!=null&&j(t,d)}!y.includes(`vat.dbf`)&&d.bandCount===1&&d.pixelType===`u8`&&!v&&(d.attributeTable=await this._fetchAuxiliaryTable(e),d.attributeTable!=null&&(d.keyProperties.DataType=`thematic`)),v&&this.updateImageSpaceRasterInfo(d),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:n,fileOffset:r,posIFD:i}=e;return(i+8>=n.byteLength||i<0)&&(r=i+r,n=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:`array-buffer`,signal:t})).data,i=0),{fileChunk:n,fileOffset:r,posIFD:i}}async _readIFDs(e,n,r,i=4,a){if(!n.posIFD)return null;n=await this._validateOrFetchHeaderBuffer(n,a);let o=await this._readIFD(n,r,x,i,a);if(!o?.ifd)throw new t(`tiffraster:open`,`cannot parse tiff header. failed to open url `+this.url);if(e.push(o.ifd),!o.nextIFD)return null;n.posIFD=o.nextIFD-n.fileOffset,await this._readIFDs(e,n,r,i,a)}async _readIFD(e,n,r=x,i=4,a){let{fileChunk:o,posIFD:s,fileOffset:c}=e;if(!e.fileChunk)return null;let l=h(o,n,s,c,r,i);if(l.success){let{ifd:e}=l;if(!e)throw new t(`tiffraster:open`,`cannot parse tiff header. failed to open url `+this.url);if(!this.ioConfig.loadFullMetadata&&r===x&&(!e.has(`TILEWIDTH`)||!e.has(`TILELENGTH`)))throw new t(`tiffraster:open`,O);let i=[];if(e.forEach(e=>{e.values||i.push(e)}),i.length>0&&await this._fillOffsets(i,n,l.nextIFD,a),e.has(`GEOKEYDIRECTORY`)){let t=e.get(`GEOKEYDIRECTORY`),r=t?.values;if(r&&r.length>4){let e=r[0]+`.`+r[1]+`.`+r[2];s=t.valueOffset+6-c;let i=await this._validateOrFetchHeaderBuffer({fileChunk:o,posIFD:s,fileOffset:c},a);t.data=(await this._readIFD(i,n,S,2,a))?.ifd,t.data&&t.data.set(`GEOTIFFVersion`,{id:0,type:2,valueCount:1,valueOffset:null,values:[e]})}}return l}return l.requiredBufferSize?(o=(await this.request(this.url,{range:{from:c,to:c+s+l.requiredBufferSize+8},responseType:`array-buffer`,signal:a})).data,o.byteLength<s+l.requiredBufferSize?null:(e.fileChunk=o,e.fileOffset=c,this._readIFD(e,n,r,i,a))):null}async _fillOffsets(e,t,n,r){let i=e.filter(e=>e.offlineOffsetSize!=null);if(i.length===0)return;let a=i.map(e=>e.offlineOffsetSize),o=Math.min.apply(null,a.map(e=>e[0])),s=Math.max.apply(null,a.map(e=>e[0]+e[1])),c=a.length===1||s-o<=this._bufferSize;if(!c&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),c=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===s),c){let e=await this._fetchOffsets(o,Math.max(s,o+this._bufferSize),r);i.forEach(n=>g(e,t,n,o));return}let l=i.map(async e=>{let n=e.offlineOffsetSize,i=await this._fetchOffsets(n[0],n[1]+n[0],r);g(i,t,e,n[0])});await Promise.all(l)}async _fetchOffsets(e,t,n){let r=[],i=this._chunkSize,a=Math.ceil((t-e)/i),o=e;for(let e=0;e<a;e++)r.push(this.request(this.url,{range:{from:o,to:e===a-1?t:o+i-1},responseType:`array-buffer`,signal:n})),o+=i;let s=await Promise.all(r);if(a===1)return s[0].data;let c=new Uint8Array(t-e+1);for(let e=0;e<a;e++)c.set(new Uint8Array(s[e].data),e*i);return c.buffer}async _fetchRawTiffTile(e,t,n,r,i={}){let a=this._getTileLocation(e,t,n,r);if(!a)return null;let{ranges:o,actualTileWidth:s,actualTileHeight:c,ifd:l}=a,u=o.map(e=>this.request(this.url,{range:e,responseType:`array-buffer`,signal:i.signal})),d=await Promise.all(u),f=d.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=d.length===1?d[0].data:new ArrayBuffer(f),m=[0],h=[0];if(d.length>1){let e=new Uint8Array(p);for(let t=0,n=0;t<d.length;t++){let r=d[t].data;e.set(new Uint8Array(r),n),m[t]=n,n+=r.byteLength,h[t]=r.byteLength}}let{blockWidth:g,blockHeight:_}=this.getBlockWidthHeight(e),v=await this.decodePixelBlock(p,{format:`tiff`,customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:m,sizes:h},width:g,height:_,planes:null,pixelType:null});if(v==null)return null;if(s!==g||c!==_){let e=v.mask;if(e)for(let t=0;t<_;t++){let n=t*g;if(t<c)for(let t=s;t<g;t++)e[n+t]=0;else for(let t=0;t<g;t++)e[n+t]=0}else{e=new Uint8Array(g*_),v.mask=e;for(let t=0;t<c;t++){let n=t*g;for(let t=0;t<s;t++)e[n+t]=1}}}return v}_getTileLocation(e,t,n,r=!1){let{firstPyramidLevel:i,blockBoundary:a}=this.rasterInfo.storageInfo,o=e===0?0:e-(i-1),{_headerInfo:s}=this;if(!s)return null;let c=r?s.maskIFDs[o]:o===0?s.ifds[0]:s.pyramidIFDs[o-1];if(!c)return null;let l=_(c,s),u=v(c,`TILEOFFSETS`),d=v(c,`TILEBYTECOUNTS`);if(!u?.length||!d?.length)return null;let{minRow:f,minCol:p,maxRow:m,maxCol:h}=a[o];if(t>m||n>h||t<f||n<p)return null;let g=y(c,`IMAGEWIDTH`),b=y(c,`IMAGELENGTH`),x=y(c,`TILEWIDTH`),S=y(c,`TILELENGTH`),C=[];if(l){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(m+1)*(h+1)+t*(h+1)+n;C[r]={from:u[e],to:u[e]+d[e]-1}}}else{let e=t*(h+1)+n;C.push({from:u[e],to:u[e]+d[e]-1})}for(let e=0;e<C.length;e++)if(C[e].from==null||!C[e].to||C[e].to<0)return null;return{ranges:C,ifd:c,actualTileWidth:n===h&&g%x||x,actualTileHeight:t===m&&b%S||S}}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+`.aux.xml`,{responseType:`xml`,signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+`.vat.dbf`,{responseType:`array-buffer`,signal:e?.signal}),n=l(t);return n?.recordSet?D.fromJSON(n.recordSet):null}catch{return null}}};e([r()],k.prototype,`_files`,void 0),e([r()],k.prototype,`_headerInfo`,void 0),e([r()],k.prototype,`_bufferSize`,void 0),e([r()],k.prototype,`_chunkSize`,void 0),e([r({type:String,json:{write:!0}})],k.prototype,`datasetFormat`,void 0),k=e([i(`esri.layers.raster.datasets.TIFFRaster`)],k);function A(e){let t=b(e),{width:n,height:r,tileWidth:i,tileHeight:c,planes:l,pixelType:u,compression:f,firstPyramidLevel:p,maximumPyramidLevel:m,pyramidBlockWidth:h,pyramidBlockHeight:g,pyramidResolutions:_,tileBoundary:v,affine:y,metadata:x,colormap:S}=t,C=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid,D=d(C),O=!!t.isPseudoGeographic;D??=(O=!0,new s({wkid:3857}));let k=new a({...t.extent,spatialReference:D}),A=k?new o({x:k.xmin,y:k.ymax,spatialReference:D}):new o({x:0,y:0}),j=new E({blockWidth:i,blockHeight:c,pyramidBlockWidth:h,pyramidBlockHeight:g,compression:f,origin:A,firstPyramidLevel:p,maximumPyramidLevel:m,pyramidResolutions:_,blockBoundary:v}),M=new o({x:(k.xmax-k.xmin)/n,y:(k.ymax-k.ymin)/r,spatialReference:D}),N=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{},P=new T({width:n,height:r,bandCount:l,pixelType:u,pixelSize:M,storageInfo:j,spatialReference:D,isPseudoSpatialReference:O,keyProperties:N,extent:k,colormap:S,statistics:x?x.statistics:null});if(y?.length&&(P.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:n-.5,ymax:.5,spatialReference:D}),P.transform=new w({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),P.extent=P.transform.forwardTransform(P.nativeExtent),P.pixelSize=new o({x:(k.xmax-k.xmin)/n,y:(k.ymax-k.ymin)/r,spatialReference:D}),j.origin.x=-.5,j.origin.y=.5),_){let{x:e,y:t}=P.pixelSize;_.forEach(n=>{n.x*=e,n.y*=t})}return{imageInfo:t,rasterInfo:P}}function j(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&t.statistics==null&&(t.statistics=C(e.histograms)),e.transform&&t.transform==null){t.transform=e.transform,t.nativeExtent=t.extent;let n=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new o({x:(n.xmax-n.xmin)/t.width,y:(n.ymax-n.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=n}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}const M=k;export{M as default};
@@ -3,6 +3,7 @@ import type { Clonable } from "../../core/Clonable.js";
3
3
  import type { JSONSupportMixin } from "../../core/JSONSupport.js";
4
4
  import type { PortalItemProperties } from "../../portal/PortalItem.js";
5
5
 
6
+ /** @deprecated since 5.2. Use [PortalItemDataProperties](https://developers.arcgis.com/javascript/latest/references/core/layers/support/PortalItemData/#PortalItemDataProperties) instead. */
6
7
  export interface ParquetPortalItemDataProperties {
7
8
  /** The portal item containing the Parquet data. */
8
9
  portalItem?: PortalItemProperties;
@@ -12,6 +13,7 @@ export interface ParquetPortalItemDataProperties {
12
13
  * Sets an ArcGIS Online [portalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/) as the [data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data)
13
14
  * source for a [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/).
14
15
  *
16
+ * @deprecated since 5.2. Use [PortalItemData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/PortalItemData/) instead.
15
17
  * @example
16
18
  * // Create a parquet layer from arcgis online portal item
17
19
  * const layer = new ParquetLayer({
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../portal/PortalItem.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{writer as s}from"../../core/accessorSupport/decorators/writer.js";let c=class extends n(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new a({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};e([r({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],c.prototype,`type`,void 0),e([r({type:a,json:{write:{isRequired:!0}}})],c.prototype,`portalItem`,void 0),e([o(`portalItem`,[`itemId`])],c.prototype,`readPortalItem`,null),e([s(`portalItem`,{itemId:{type:String}})],c.prototype,`writePortalItem`,null),c=e([i(`esri.layers.support.ParquetPortalItemData`)],c);export{c as default};
2
+ import{__decorate as e}from"tslib";import{Clonable as t}from"../../core/Clonable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../portal/PortalItem.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{writer as s}from"../../core/accessorSupport/decorators/writer.js";let c=class extends n(t){constructor(e){super(e),this.type=`portal-item`}readPortalItem(e,t,n){if(t.itemId)return new a({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}};e([r({type:[`portal-item`],nonNullable:!0,readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],c.prototype,`type`,void 0),e([r({type:a,json:{write:{isRequired:!0}}})],c.prototype,`portalItem`,void 0),e([o(`portalItem`,[`itemId`])],c.prototype,`readPortalItem`,null),e([s(`portalItem`,{itemId:{type:String}})],c.prototype,`writePortalItem`,null),c=e([i(`esri.layers.support.ParquetPortalItemData`)],c);const l=c;export{l as default};
@@ -9,8 +9,29 @@ export interface PortalItemDataProperties {
9
9
  }
10
10
 
11
11
  /**
12
+ * Sets an ArcGIS Online [portalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/) as the [data](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#data)
13
+ * source for a [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/) or a [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/).
14
+ *
12
15
  * @since 5.2
13
16
  * @beta
17
+ * @example
18
+ * // Create a parquet layer from arcgis online portal item
19
+ * const layer = new ParquetLayer({
20
+ * data: new PortalItemData({
21
+ * portalItem: {
22
+ * id: "parquet-layer-item-id",
23
+ * },
24
+ * }),
25
+ * });
26
+ * @example
27
+ * // Create a geospatial PDF layer from an ArcGIS portal item
28
+ * const layer = new GeospatialPDFLayer({
29
+ * data: new PortalItemData({
30
+ * portalItem: {
31
+ * id: "geospatial-pdf-layer-item-id",
32
+ * },
33
+ * }),
34
+ * });
14
35
  */
15
36
  export default class PortalItemData extends PortalItemDataSuperclass {
16
37
  constructor(properties?: PortalItemDataProperties);
@@ -75,7 +75,7 @@ export interface ParquetLayerInfoOptions extends AbortOptions {
75
75
  * Throws an error if the parquet file is empty or if the information cannot be determined.
76
76
  *
77
77
  * @param data - The data source for the parquet layer. Pass a [ParquetFilesData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetFilesData/), a
78
- * [ParquetPortalItemData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ParquetPortalItemData/), or an array of URLs pointing to parquet files for backward compatibility.
78
+ * [PortalItemData](https://developers.arcgis.com/javascript/latest/references/core/layers/support/PortalItemData/), or an array of URLs pointing to parquet files for backward compatibility.
79
79
  * @param options - An object specifying additional options. See [ParquetLayerInfoOptions](https://developers.arcgis.com/javascript/latest/references/core/layers/support/parquetUtils/#ParquetLayerInfoOptions) for details.
80
80
  * @returns A promise that resolves to the parquet layer information.
81
81
  * @example