Compute Pixel Location

URL:
https://<imageservice-url>/computePixelLocation
Methods:
GET
Required Capability:
Image, Catalog
Version Introduced:
10.7

Description

The computePixelLocation operation is performed on an image service resource that uses ArcObjects11 or ArcObjectsRasterRendering 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 icsToPixel 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 computePixelLocation operation as query parameters defined in the parameters table below.

Request parameters

ParameterDetails

Geometries

(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 geometryType .

rasterId

(Optional)

Specifies the objectId of the image service’s raster catalog. This integer rasterId number will determine which raster’s image coordinate system will be used during the calculation, and which raster the column and row results represent.

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.

spatialReference

(Optional)

A JSON object that specifies the spatial reference of the Geometries parameter. This is an optional parameter, since a spatial reference can also be specified directly in each geometry object in the geometries array.

f

The response format. The default response format is html .

Values: html | json

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.

Use dark colors for code blocksCopy
1
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

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "geometries": [
    {<geometry 1>},
    {<geometry n>}
  ]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "geometries": [
    {
      "x": -45.5617949605311878,
      "y": -31.7513701334796679,
      "z": 634.186505622650088
    },
    {
      "x": 5510.59714930129667,
      "y": 3674.28411545968675,
      "z": 633.867370170692766
    }
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.