Skip To Content

Compute Angles

  • URL:https://<imageservice-url>/computeAngles
  • Required Capability:Image, Catalog
  • Version Introduced:10.9.1

Description

The computeAngles operation is performed on an image service resource. This operation computes the rotation angle of a raster for a user-specified angle direction, and optionally, a user-specified rotation point and user-specified spatial reference. The available angle directions are as follows:

  • North—The computed angle after rotating the map so the top of the image is always oriented toward north
  • Up—The computed angle after rotating the map so the top of the image is always oriented to the direction of the sensor when it acquired the image

For more information about changing the orientation of a raster, see Changing the orientation of a raster.

You can provide arguments to the computeAngles operation as query parameters. The parameter details are provided in the request parameters table below.

This operation is supported at 10.9.1 and later.

License:

This operation requires an ArcGIS Image Server license.

Request parameters

ParameterDescription
rasterId

(Required)

Specifies the objectId of the image service’s raster catalog. The rasterId value identifies which raster to use in a mosaic dataset and which raster’s image coordinate system will be used as part of the calculation.

point

(Optional)

A point geometry that defines the reference point of rotation to compute the angle direction. The structure of the geometry is the same as the structure of the JSON geometry objects.

Default: Use the centroid of the image as the point of rotation.

By default, the point geometry is assumed to be in the spatial reference of the image service. You can specify a different spatial reference using the JSON structure syntax for geometries.

Examples


point={"x":-71.6,"y":-32.875}

point={"x":-71.6,"y":-32.875,"spatialReference":{"wkid":4326}}

point={"x":500,"y"+-500,"spatialReference":{"icsid":1}}
angleName

(Optional)

A string that specifies the name or names of the rotation angle to be computed. Options are “up” or “north”. You can specify multiple angle names by separating the names with a comma.

Default: Compute the angles for all directions.

Examples


angleName=up

angleName=north

angleName= north,up
spatialReference

(Optional)

A JSON object that specifies the spatial reference to be used by the image.

Default: Use the spatial reference of the image.

Examples


//Image coordinate space (ICS)
spatialReference={"icsid":1}

//Geographic (map) coordinate space (GCS)
spatialReference={"wkid":4326}
f

The response format. The default response format is html.

Values: html | json

Example usage

The following are sample URL requests that demonstrate how to specify query parameters:

Example: Specify usage of all default parameters.

https://machine.domain.com/webadaptor/rest/services/My.Mosaics/ImageServer/computeAngles?rasterId=1&f=pjson

Example: Specify a custom (not center of image) rotation point.

https://machine.domain.com/webadaptor/rest/services/My.Mosaics/ImageServer/computeAngles?rasterId=1&point=%7B"x":-71.6,"y":-32.875,"spatialReference":%7B"wkid":4326%7D%7D&f=pjson

Example: Specify the “up” angle direction.

https://machine.domain.com/webadaptor/rest/services/My.Mosaics/ImageServer/computeAngles?rasterId=1&angleName=up&f=pjson

Example: Specify the ICS spatial reference.

https://machine.domain.com/webadaptor/rest/services/My.Mosaics/ImageServer/computeAngles?rasterId=1&spatialReference=%7B"icsid":1%7D&f=pjson

Example: Specify the GCS spatial reference with a custom point.

https://machine.domain.com/webadaptor/rest/services/<ImageServiceName>/ImageServer/computeAngles?rasterId=22&point=%7B%22x%22%3A71.350452%2C%22y%22%3A35.031646%7D&spatialReference=%7B%22wkid%22%3A4326%7D&angleName=&f=html

Example: Specify the ICS spatial reference with a custom point.

https://machine.domain.com/webadaptor/rest/services/<ImageServiceName>/ImageServer/computeAngles?rasterId=22&point=%7B%22x%22%3A17911%2C%22y%22%3A-6046%7D&spatialReference=%7B%22icsid%22%3A22%7D&angleName=&f=html

JSON Response syntax


{
  "north": <computed north angle>,
  "up": <computed up angle>,
  "spatialReference": {
    <serialized attributes of spatial reference>
  }
}

JSON Response example


{
  "north": 0,
  "up": 64.977751,
  "spatialReference": {
    "wkid": 4326,
    "latestWkid": 4326,
    "vcsWkid": 115700,
    "latestVcsWkid": 115700
  }
}