require(["esri/rest/imageService"], (imageService) => { /* code goes here */ });
import * as imageService from "@arcgis/core/rest/imageService.js";
esri/rest/imageService
Performs various operations on an image service resource:
Identify the content of an image service for the input location and mosaic rule. Compute histograms based on the provided ImageHistogramParameters. Compute statistics and histograms for the provided ImageHistogramParameters.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<ImageAngleResult> | Computes the rotation angle of a ImageryLayer at a given location. more details | imageService | |
Promise<object> | Computes histograms based on the provided ImageHistogramParameters. more details | imageService | |
Promise<ImagePixelLocationResult> | Computes the corresponding pixel location in columns and rows for an ImageryLayer based on input geometry. more details | imageService | |
Promise<object> | Computes statistics and histograms for the provided ImageHistogramParameters. more details | imageService | |
Promise<ImageSampleResult> | Returns sample point locations, pixel values and corresponding resolutions of the source data for a given geometry. more details | imageService | |
Promise<ImageIdentifyResult> | Sends a request to the ArcGIS REST image service resource to identify content based on the ImageIdentifyParameters specified in the | imageService | |
Promise<ImageAreaResult> | Calculates the area and perimeter of a given geometry on an image service. more details | imageService | |
Promise<ImageDistanceResult> | Calculates the distance and angle between two points on an image service. more details | imageService | |
Promise<ImageHeightResult> | Calculates the height of an object between two points on an image service. more details | imageService | |
Promise<ImagePointResult> | Returns the location for a given point or centroid of a given area on an image service. more details | imageService |
Method Details
-
computeAngles(url, parameters, requestOptions){Promise<ImageAngleResult>}Since: ArcGIS Maps SDK for JavaScript 4.22
-
Computes the rotation angle of a ImageryLayer at a given location. This operation is supported at 10.9.1 and later.
Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
Autocasts from ObjectSpecifies parameters for computing angles.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageAngleResult> When resolved, returns an instance of ImageAngleResult containing computed north and up angles. - See also
-
Computes histograms based on the provided ImageHistogramParameters. If a raster function and a mosaic rule are not specified, the current settings on the layer will be used. This operation is supported by an image service published with a mosaic dataset or a raster dataset at ArcGIS Server 10.4 and later. The result of this operation contains histograms computed for the given extent.
Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
Autocasts from ObjectSpecifies parameters for computing histograms.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<object> Resolves to an object containing histogram results. See the object specification table below for details. Property Type Description histograms[] RasterHistogram Result containing raster histograms.
-
computePixelSpaceLocations(url, parameters, requestOptions){Promise<ImagePixelLocationResult>}Since: ArcGIS Maps SDK for JavaScript 4.22
-
Computes the corresponding pixel location in columns and rows for an ImageryLayer based on input geometry. Requires that the raster catalog item has a valid
icsToPixel
resource.Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
parameters ImagePixelLocationParametersSpecifies parameters for computing image space pixel location.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImagePixelLocationResult> When resolved, returns an instance of ImagePixelLocationResult containing x and y values for the column and row of each input geometry.
-
Computes statistics and histograms for the provided ImageHistogramParameters. If a raster function and a mosaic rule are not specified, the current settings on the layer will be used. This operation is supported by an image service published with a mosaic dataset or a raster dataset at ArcGIS Server 10.4 and later. The result of this operation contains both statistics and histograms computed for the given extent.
Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
Autocasts from ObjectSpecifies parameters for computing statistics and histograms.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<object> Resolves to an object containing histogram and statistics results. See the object specification table below for details. Property Type Description histograms[] RasterHistogram Result containing raster histograms. bandStatistics[] RasterBandStatistics Raster band statistics.
-
getSamples(url, parameters, requestOptions){Promise<ImageSampleResult>}Since: ArcGIS Maps SDK for JavaScript 4.23
-
Returns sample point locations, pixel values and corresponding resolutions of the source data for a given geometry. When the input geometry is a polyline, extent, or polygon, the sampling is based on sampleCount or sampleDistance parameters. When the geometry is a point or multipoint, the point or points are used directly.
The number of sample locations in the response is based on the
sampleDistance
orsampleCount
parameter and cannot exceed the limit imposed by the image service. The sample points are located at the intersection of the provided geometry and the raster item's footprints. They are also filtered by the mosaicRule and pixelSize parameters.Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
Autocasts from ObjectThe parameters used in the getSamples operation.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageSampleResult> When resolved, ImageSampleResult is returned containing an array of ImageSamples. Example// get all sample points along a polyline // at the specified sample distance and pixel size const param = { geometry: polyline returnFirstValueOnly: false, // resolution - unit of the view's spatial reference pixelSize: { x:12, y:12, spatialReference: view.spatialReference }, interpolation: "nearest", // unit of the geometry's spatial reference is used sampleDistance: 30, outFields: ["*"] }; imageService.getSamples(url, param).then((results) => { // use the getSamples results as needed. console.log(results); }) .catch(function(error){ console.log(error) })
-
identify(url, params, requestOptions){Promise<ImageIdentifyResult>}
-
Sends a request to the ArcGIS REST image service resource to identify content based on the ImageIdentifyParameters specified in the
params
argument.Parametersurl StringURL to the ArcGIS Server REST resource that represents an image service.
params ImageIdentifyParametersSpecifies the criteria used to identify the features.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageIdentifyResult> When resolved, returns an instance of ImageIdentifyResult.
-
measureAreaAndPerimeter(url, parameters, requestOptions){Promise<ImageAreaResult>}Since: ArcGIS Maps SDK for JavaScript 4.26
-
Calculates the area and perimeter of a given geometry on an image service. The result of this operation includes the name of the raster dataset being used, the sensor name, and measured values.
Parametersurl StringThe url of the image service to perform the area and perimeter measurement on.
Autocasts from ObjectSpecifies parameters for measuring the area and perimeter of a given geometry on an image service.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageAreaResult> When resolved, returns an instance of ImageAreaResult containing the name of the raster dataset being used, the sensor name, and measured values.
-
measureDistanceAndAngle(url, parameters, requestOptions){Promise<ImageDistanceResult>}Since: ArcGIS Maps SDK for JavaScript 4.26
-
Calculates the distance and angle between two points on an image service. The result of this operation includes the name of the raster dataset being used, the sensor name, and measured values.
Parametersurl StringThe url of the image service to perform the distance and angle measurement on.
Autocasts from ObjectSpecifies parameters for measuring a distance and an angle on an image between two points.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageDistanceResult> When resolved, returns an instance of ImageDistanceResult containing the name of the raster dataset being used, the sensor name, and measured values.
-
measureHeight(url, parameters, requestOptions){Promise<ImageHeightResult>}Since: ArcGIS Maps SDK for JavaScript 4.26
-
Calculates the height of an object between two points on an image service. The result of this operation includes the name of the raster dataset being used, the sensor name, and measured values. See the ImageHeightParameters.operationType documentation for types of height measurements.
Parametersurl StringThe url of the image service to perform the height measurement on.
Autocasts from ObjectSpecifies the parameters for measuring the height of an object between two points on an image service.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImageHeightResult> When resolved, returns an instance of ImageHeightResult containing the name of the raster dataset being used, the sensor name, and measured values.
-
measurePointOrCentroid(parameters, requestOptions){Promise<ImagePointResult>}Since: ArcGIS Maps SDK for JavaScript 4.26
-
Returns the location for a given point or centroid of a given area on an image service.
ParametersAutocasts from ObjectSpecifies parameters for determining a point location or a centroid of a given area on the image service.
requestOptions ObjectoptionalAdditional options to be used for the data request.
ReturnsType Description Promise<ImagePointResult> When resolved, returns an instance of ImagePointResult containing the name of the raster dataset being used, the sensor name, and measured values.