require(["esri/layers/WCSLayer"], function(WCSLayer) { /* code goes here */ });
Description
(Added at v3.18)
The WCSLayer works with
OGC Web Coverage Services. It retrieves coverage (raster) data and renderers it on the client. It supports version 1.0.0, 1.1.x, and 2.0.1. For version 2.0.1, it supports servers that support
GEOTIFF coverage and implements the following extensions:
Scaling
,
Interpolation
,
Range Subsetting
,
CRS
, and
KVP/Get
.
To avoid cross-origin issues when using WCSLayer, enable CORS on your web server and push host
(server.domain.com:port)
to
esriConfig.defaults.io.corsEnabledServers
. ArcGIS Server (10.3.1+) image service based WCS has CORS enabled by default.
The layer makes
GetCoverage
requests in the map's spatial reference, this requires the server to support the map's spatial reference in the related CRS parameters. ArcGIS Server-based WCS services support any WKID-based spatial reference supported in the JS API.
Samples
Search for
samples that use this class.
Constructors
Constants
INTERPOLATION_BILINEAR | Resamples pixel by bilinear interpolation. Value = 1. |
INTERPOLATION_CUBICCONVOLUTION | Resamples pixel by cubic convolution. Value = 2. |
INTERPOLATION_NEARESTNEIGHBOR | Resamples pixel by nearest neighbor. Value = 0. |
Properties
Methods
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Events
error | {
error: <Error >
} | Fires when there is a problem retrieving a layer. |
load | {
layer: <Layer >
} | Fires after layer properties for the layer are successfully populated. |
opacity-change | {
opacity: <Number >
} | Fires when the layer opacity has been changed, and returns an object with the opacity value. |
refresh-interval-change | | This event is fired when the layer's refreshInterval is modified. |
resume | | Fires when a layer resumes drawing. |
scale-range-change | | Fires when a layer's minScale and/or maxScale is changed. |
scale-visibility-change | | Fires when a layer's scale visibility changes. |
suspend | | Fires when a layer suspends drawing. |
update-end | {
error: <Error >
} | Fires when a layer has finished updating its content. |
update-start | | Fires when a layer begins to update its content. |
visibility-change | {
visible: <Boolean >
} | Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. |
Constructor Details
Creates a new WCSLayer.
Parameters:
<String > url |
Required |
URL to a WCS Server endpoint. NOTE: It is also possible to pass optional parameters in the URL, for example:
var wcsLayer = new WCSLayer {url: "https://sampleserver6.arcgisonline.com/arcgis/services/ScientificData/SeaTemperature/ImageServer/WCSServer?foo=bar"};
|
<Object > options |
Optional |
Optional parameters. See options list below. |
options
properties:
<String > coverageId |
Optional |
The coverage identifier, defaults to the first coverage. |
<Boolean > drawMode |
Optional |
Sets the layer's draw mode. Set to false if using drawType: "webgl" since pixels are rendered by webgl shaders instead of this layer. |
<String > drawType |
Optional |
Sets the context of the Canvas. Known values: "2d" | "webgl" | "experimental-webgl" | "webgl2" | "experimental-webgl2" |
<Function > pixelFilter |
Optional |
A function that takes a pixelData object as input and processes it. |
<String > version |
Optional |
The version of WCSLayer, can be: - 1.0.0
- 1.1.0
- 1.1.1
- 1.1.2
- 2.0.1
|
<WCSConnection > wcsConnection |
Optional |
A WCS Connection object. Set this if you already created a WCSConnection to avoid extra overhead. |
Sample:
var wcsUrl = "//sampleserver6.arcgisonline.com/arcgis/services/ScientificData/MODIS_Landcover/ImageServer/WCSServer";
var wcsLayer = new WCSLayer(wcsUrl, {
version: "1.0.0",
pixelFilter: colorizer }
);
Property Details
Zero-based array of current band selections.
The coverage identifier, defaults to the first coverage.
The extent of the full coverage.
Raster format of the layer. Defaults to the "TIFF" format string based on the WCS server. This can be "JPG" or "PNG" if supported by the server.
Default value: TIFF
Current interpolation method. The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. See the constants table for a list of possible interpolation values.
When the layer is loaded, the value becomes "true", and layer properties can be accessed.
Known values: true | false
Multiple dimensional definitions are usually used to filter data.
Sample:
var wcs = new WCSLayer();
wcs.multidimensionalDefinition = [];
wcs.multidimensionalDefinition.push(new DimensionalDefinition({
variableName: "Salinity",
dimensionName: "StdTime",
values: [1259625600000]
}));
Opacity or transparency of layer. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency.
Known values: 0.0 - 1.0
Default value: 1
A function that takes a pixelData
object as input and processes it. The pixelData
object contains a pixelBlock property that gives you access to all of the pixels in the raster.
Inside the pixelFilter, you may loop through pixels through the pixelBlock property of the pixelData object and process them. See the RasterLayer sample for an example of how to apply a pixelFilter to a RasterLayer.
The pixel type of the image service. Pertains to the type of values stored in the raster, such as signed integer, unsigned integer, or floating point. Integers are whole numbers, whereas floating points have decimals.
Known values: C64 | C128 | F32 | F64 | S8 | S16 | S32 | U1 | U2 | U4 | U8 | U16 | U32 | UNKNOWN
The projected extent in the map's spatial reference. If the map is not in WGS84, Web Mercator, or the native spatial reference of the WCS Coverage, it will need to set.
When true, the layer is suspended. A layer is considered to be suspended when one of the following is true:
- The layer is hidden.
- The layer is not visible at the current map scale.
- The layer is explicitly suspended by calling the
Layer.suspend
method.
Known values: true | false
Temporal information for the layer, such as time extent. If this property is null or not specified, then the layer does not support time-related operations.
URL to a WCS Server endpoint.
NOTE: It is also possible to pass optional parameters in the URL, for example:
var wcsLayer = new WCSLayer {url: "https://sampleserver6.arcgisonline.com/arcgis/services/ScientificData/SeaTemperature/ImageServer/WCSServer?foo=bar"};
The version of WCSLayer, can be:
- 1.0.0
- 1.1.0
- 1.1.1
- 1.1.2
- 2.0.1
The visibility of the layer.
Known values: true | false
Default value: true
Method Details
Returns an array of graphics as a Promise. The returned graphic(s) uses the layer's full extent, and contain a special Raster.ServicePixelValue
attribute that represents a pixel value at the map point's native resolution.
Parameters:
<Point > mapPoint |
Required |
The map point location in which to identify. |
Sets the opacity of the layer.
Parameters:
<Number > opacity |
Required |
Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency. The default value is 1. |
Sets a pixelFilter on the layer. A pixel filter is a function that takes a pixelData
object as input and processes it. The pixelData
object contains a pixelBlock property that gives you access to all of the pixels in the raster.
Inside the pixelFilter, you may loop through pixels through the pixelBlock property of the pixelData object and process them.
Parameters:
<Function > pixelFilter |
Required |
The function defining the PixelFilter to set on the layer. It sets the value of the pixelFilter property. |
<Boolean > doNotRefresh |
Optional |
When true the layer will not refresh the map image. The default value is false. |
Determines if the layer will update its content based on the map's current time extent.
Parameters:
<Boolean > use |
Required |
Use true to update the layer's content based on the map's current time extent. |
Sets the visibility of the layer.
Parameters:
<Boolean > isVisible |
Required |
Indicate whether to set layer visibility. |
Event Details
[ On Style Events | Connect Style Event ]
Fires when there is a problem retrieving a layer.
Fires after layer properties for the layer are successfully populated. This event must be successful before the layer can be added to the map.
Event Object Properties:
<Layer > layer |
The loaded layer. |
Fires when the layer opacity has been changed, and returns an object with the opacity value.
Event Object Properties:
<Number > opacity |
Fires when the layer opacity (transparency) changes. A number property named opacity that indicates the new opacity. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency. |
This event is fired when the layer's refreshInterval is modified.
Fires when a layer resumes drawing.
Fires when a layer's minScale and/or maxScale is changed.
Fires when a layer's scale visibility changes. The scale visibility changes when a layer is initially visible and becomes invisible because the map scale does not intersect the layer's scale range or vice versa.
Fires when a layer suspends drawing
Fires when a layer has finished updating its content. It is the responsibility of the subclass to determine when this event is fired.
Event Object Properties:
<Error > error |
The error object is available when an error occurs during the update. |
Fires when a layer begins to update its content. It is the responsibility of the subclass to determine when this event is fired.
Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer.
Event Object Properties:
<Boolean > visible |
A boolean property named visible indicates whether or not the layer is visible after visibility changed. |