- URL:
- https://<imageservice-url>/computePixelLocation
- Methods:
GET
- Required Capability:
- Image, Catalog
- Version Introduced:
- 10.7
Description
The compute
operation is performed on an image service resource that uses Arc
or Arc
as the service provider. With given input geometries, it calculates the corresponding pixel location in columns and rows for an image based on input geometry. A prerequisite is that the raster catalog item has a valid ics
resource. The result of this operation includes x- and y-values for the column and row of each input geometry. It can also include a z-value for the height at the given location if elevation information is associated with the catalog raster item.
At 10.8.1 and later, Catalog is no longer a required capability for this operation. Image services of georeferenced single raster datasets also support this operation. You can provide arguments to the compute
operation as query parameters defined in the parameters table below.
Request parameters
Parameter | Details |
---|---|
(Required) | The array of geometries for computing pixel locations. The structure of each geometry in the array is the same as the structure of the JSON geometry objects. All geometries in this array should be of the type defined by |
(Optional) | Specifies the This parameter is only required if the image service is based on the raster catalog, and it must be left empty if it is not based on the raster catalog. |
(Optional) | A JSON object that specifies the spatial reference of the |
|
The response format. The default response format is Values: |
Example usage
Below is a sample request URL that demonstrates how to compute the pixel location for the first raster catalog item of the image service for two points.
https://machine.domain.com:6443/webadaptor/rest/services/myAO11imageservice/ImageServer/ computePixelLocation?geometries={"geometries": [{ "x": 491374.849829215906,"y": 3762865.05682404758,"spatialReference": {"wkid": 32611} }, {"x": 491483.5473642843,"y": 3763001.33978307154,"spatialReference": {"wkid": 32611}}],"geometryType":"esriGeometryPoint"}&rasterId=1&spatialReference=&f=pjson
JSON Response syntax
{
"geometries": [
{<geometry 1>},
{<geometry n>}
]
}
JSON Response example
{
"geometries": [
{
"x": -45.5617949605311878,
"y": -31.7513701334796679,
"z": 634.186505622650088
},
{
"x": 5510.59714930129667,
"y": 3674.28411545968675,
"z": 633.867370170692766
}
]
}