UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 3.75 kB
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../TimeExtent.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{isSome as i}from"../../core/maybe.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/Point.js";import{getJsonType as p}from"../../geometry/support/jsonUtils.js";import m from"../../layers/support/MosaicRule.js";import a from"../../layers/support/RasterFunction.js";var y;let c=y=class extends r{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,r){null!=e&&(t.geometryType=p(e),t[r]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=m.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=a.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[r]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,r){null!=e&&(t[r]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,r){null!=e&&(t[r]=JSON.stringify(e))}writeTimeExtent(e,t,r){if(null!=e){const o=i(e.start)?e.start.getTime():null,s=i(e.end)?e.end.getTime():null;t[r]=null!=o?null!=s?`${o},${s}`:`${o}`:null}}clone(){return new y(o({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};e([s({json:{write:!0}})],c.prototype,"geometry",void 0),e([l("geometry")],c.prototype,"writeGeometry",null),e([s({type:m,json:{write:!0}})],c.prototype,"mosaicRule",null),e([l("mosaicRule")],c.prototype,"writeMosaicRule",null),e([s({type:a,json:{write:!0}})],c.prototype,"renderingRule",null),e([l("renderingRule")],c.prototype,"writeRenderingRule",null),e([s({type:[a],json:{write:!0}})],c.prototype,"renderingRules",void 0),e([l("renderingRules")],c.prototype,"writeRenderingRules",null),e([s({type:u,json:{write:!0}})],c.prototype,"pixelSize",void 0),e([l("pixelSize")],c.prototype,"writePixelSize",null),e([s({type:Boolean,json:{write:!0}})],c.prototype,"returnGeometry",void 0),e([s({type:Boolean,json:{write:!0}})],c.prototype,"returnCatalogItems",void 0),e([s({type:Boolean,json:{write:!0}})],c.prototype,"returnPixelValues",void 0),e([s({type:Number,json:{write:!0}})],c.prototype,"maxItemCount",void 0),e([s({type:t,json:{write:{target:"time"}}})],c.prototype,"timeExtent",void 0),e([l("timeExtent")],c.prototype,"writeTimeExtent",null),e([s({json:{write:!0}})],c.prototype,"raster",void 0),e([s({json:{write:!0}})],c.prototype,"viewId",void 0),e([s({type:Boolean,json:{write:!0}})],c.prototype,"processAsMultidimensional",void 0),c=y=e([n("esri.rest.support.ImageIdentifyParameters")],c);const d=c;export{d as default};