UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 2.8 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{sqlAnd as e}from"../../../core/sql.js";import{searchImages as r}from"../../../layers/orientedImagery/queries.js";import{createCoveragePolygon as t}from"../../../layers/orientedImagery/core/coverageUtils.js";async function n(e,n,o,i){const s=t(n.attributes).polygon.centroid;s.z=void 0;const c=w(e.definitionExpression,o);let a,u;try{a=await r({layerInstanceOrURL:e,point:s,queryParams:{where:c}},i)}catch(y){u=y}return new d(s,a,u)}async function o(e,t,n,o){const i=e.sequenceOrderField??"SequenceOrder",s=w(e.definitionExpression,n,`${i} IS NOT NULL`);let c,a;try{c=await r({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:[`${i}`],returnGeometry:!0,outFields:["*"]}},o)}catch(u){a=u}return new d(t,c,a)}function i(e,r,t){const n=e.sequenceOrderField,o=w(e.definitionExpression,r,`${n} IS NOT NULL`);return e.queryFeatureCount({where:o},t)}async function s(r,t,n,o="ASC",i,s){const c=r.sequenceOrderField??"SequenceOrder";let a=w(r.definitionExpression,i,`${c} IS NOT NULL`);const d="number"==typeof t?t-1:void 0;"string"===t&&(a=e(a,`${c} = ${t}`));try{const e=await r.queryFeatures({where:a,returnGeometry:!0,orderByFields:[`${c} ${o}`],outFields:["*"],start:d,num:n},s);return await f(e,r),new u(e)}catch(y){return new u(void 0,y)}}async function c(e,r,t=0,n=1,o,i){const s=e.sequenceOrderField??"SequenceOrder",c=l(s,t),a=w(e.definitionExpression,o,y(t,r,s));try{const r=await e.queryFeatures({where:a,orderByFields:c,num:n,outFields:["*"],returnGeometry:!0},i);return await f(r,e),new u(r)}catch(d){return new u(void 0,d)}}async function a(e,r,t,n){const o=Array.isArray(r)?r:[r],i=w(e.definitionExpression,t,`${e.objectIdField} IN (${o.join(",")})`);try{const r=await e.queryFeatures({where:i,outFields:["*"],returnGeometry:!0},n);return await f(r,e),new u(r)}catch(s){return new u(void 0,s)}}class u{constructor(e,r){this.response=e,this.error=r}}class d{constructor(e,r,t){this.nextLocation=e,this.response=r,this.error=t}}function y(e,r,t){return e>0?`${t} IS NOT NULL AND ${t} > ${r}`:`${t} IS NOT NULL AND ${t} < ${r}`}function l(e,r){return r>0?[`${e}`]:[`${e} DESC`]}async function f(e,r){const t=await import("../../../layers/orientedImagery/core/ExposurePoint.js").then((e=>e.default));e.features.forEach((e=>{const n=t.fromJSON({...e.toJSON(),layer:r});n&&(e.attributes=n)}))}function w(...r){let t="1=1";return r.forEach((r=>{t=e(t,r)})),t}export{d as QueryNextLocationFeaturesResponse,u as QueryOrientedImageryFeaturesResponse,c as queryAfterSequenceField,a as queryFeatureByObjectIds,n as queryNextLocationFeatures,s as queryOffsetSequenceFeatures,i as querySequenceCount,o as querySequenceFeaturesAroundPoint};