UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4.14 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import a from"./RasterBandInfo.js";import{pixelTypeKebabDict as p}from"./rasterEnums.js";import l from"./RasterSensorInfo.js";import h from"./RasterStorageInfo.js";var u;let m=u=class extends e{constructor(t){super(t),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const t=this.keyProperties.BandProperties,{bandCount:e}=this;if(!t?.length||t.length<e){const t=[];for(let o=1;o<=e;o++)t.push(new a({name:"band_"+o}));return t}const o=t.map((t=>a.fromJSON(t)));for(let i=0;i<o.length;i++)o[i].name=o[i].name||"band_"+(i+1);return o}get dataType(){const t=this.keyProperties?.DataType?.toLowerCase()??"generic";return"stdtime"===t?"standard-time":t}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(t){t&&this._set("nativeExtent",t)}get nativePixelSize(){if(null==this.transform||!this.transform.affectsPixelSize)return this.pixelSize;const t=this.nativeExtent;return{x:t.width/this.width,y:t.height/this.height}}get hasMultidimensionalTranspose(){return!!this.storageInfo?.transposeInfo}get sensorInfo(){if(this.keyProperties?.SensorName)return l.fromJSON(this.keyProperties)}clone(){return new u({attributeTable:o(this.attributeTable),bandCount:this.bandCount,colormap:o(this.colormap),extent:o(this.extent),format:this.format,height:this.height,width:this.width,histograms:o(this.histograms),keyProperties:o(this.keyProperties),multidimensionalInfo:o(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:o(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:o(this.spatialReference),statistics:o(this.statistics),storageInfo:o(this.storageInfo),transform:o(this.transform)})}};t([i({json:{write:!0}})],m.prototype,"attributeTable",void 0),t([i({json:{write:!0}})],m.prototype,"bandCount",void 0),t([i({readOnly:!0})],m.prototype,"bandInfos",null),t([i({json:{write:!0}})],m.prototype,"colormap",void 0),t([i({type:String,readOnly:!0})],m.prototype,"dataType",null),t([i({type:r,json:{write:!0}})],m.prototype,"extent",void 0),t([i({type:r,json:{write:!0}})],m.prototype,"nativeExtent",null),t([i({json:{write:!0}})],m.prototype,"nativePixelSize",null),t([i({json:{write:!0}})],m.prototype,"format",void 0),t([i({json:{write:!0}})],m.prototype,"height",void 0),t([i({json:{write:!0}})],m.prototype,"width",void 0),t([i({json:{write:!0}})],m.prototype,"hasMultidimensionalTranspose",null),t([i({json:{write:!0}})],m.prototype,"histograms",void 0),t([i({json:{write:!0}})],m.prototype,"keyProperties",void 0),t([i({json:{write:!0}})],m.prototype,"multidimensionalInfo",void 0),t([i({json:{write:!0}})],m.prototype,"noDataValue",void 0),t([i({json:{write:!0}})],m.prototype,"pixelSize",void 0),t([i({type:p.apiValues,json:{write:!0}})],m.prototype,"pixelType",void 0),t([i()],m.prototype,"isPseudoSpatialReference",void 0),t([i({readOnly:!0})],m.prototype,"sensorInfo",null),t([i({type:n,json:{write:!0}})],m.prototype,"spatialReference",void 0),t([i({json:{write:!0}})],m.prototype,"statistics",void 0),t([i({type:h,json:{write:!0}})],m.prototype,"storageInfo",void 0),t([i({json:{write:!0}})],m.prototype,"transform",void 0),m=u=t([s("esri.layers.support.RasterInfo")],m);export{m as default};