FRAMES | NO FRAMES Description | Parameters | Examples | Response
Measure - Image Service (Operation)
URL http://<imageservice-url>/measure
Parent Resource Image Service
Required Capability Mensuration

Description

This operation is supported from 10.1 onwards.

The measure operation is performed on an image service resource. It lets a user measure distance, direction, area, perimeter and height from an image service. The result of this operation includes the name of the raster dataset being used, sensor name and measured values.

The measure operation can be supported by image service from raster datasets and mosaic datasets. Spatial reference is required to perform basic measurement (distance, area, etc). Sensor metadata (geodata transformation) needs to be present in the data source used by image service to enable height measurement (e.g. imagery with RPCs). Mosaic dataset or service needs to include DEM to perform 3D measure.

Users can provide arguments to the measure operation as query parameters. The parameter details are provided in the parameters table below.

For more information about making measurements from imagery, please refer to the help topic.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
fromGeometry Required

Description: A geometry that defines the "from" location of the measurement. The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for points, you can specify the geometry with a simpler comma-separated syntax.

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

Syntax:
  • JSON structures: fromGeometry={geometry}
  • Point simple syntax: fromGeometry=<x>,<y>
Examples:
  • fromGeometry={x: -104, y: 35.6}
  • fromGeometry=-104,35.6
toGeometry Description: A geometry that defines the "to" location of the measurement. The type of the geometry must be the same as "fromGeometry". The structure of the geometry is the same as the structure of the json geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for points, you can specify the geometry with a simpler comma-separated syntax.

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

Syntax:
  • JSON structures:toGeometry={geometry}
  • Point simple syntax: toGeometry=<x>,<y>
Examples:
  • toGeometry={x: -104, y: 35.6}
  • toGeometry=-104,35.6
geometryType Description: The type of geometry specified by the fromGeometry and toGeometry parameters. The geometry type can be a point, polygon or envelope. The default geometry type is a point.

Values: esriGeometryPoint | esriGeometryPolygon | esriGeometryEnvelope
measureOperation Required

Specifies the type of measure being performed

Values: esriMensurationPoint | esriMensurationDistanceAndAngle | esriMensurationAreaAndPerimeter | esriMensurationHeightFromBaseAndTop | esriMensurationHeightFromBaseAndTopShadow | esriMensurationHeightFromTopAndTopShadow | esriMensurationCentroid | esriMensurationPoint3D | esriMensurationDistanceAndAngle3D | esriMensurationAreaAndPerimeter3D | esriMensurationCentroid3D

Different measureOperation type requires different from/to geometries:

esriMensurationPoint,esriMensurationPoint3D: requires only fromGeometry, type: {Point}

esriMensurationDistanceAndAngle,esriMensurationDistanceAndAngle3D,esriMensurationHeightFromBaseAndTop,esriMensurationHeightFromBaseAndTopShadow,esriMensurationHeightFromTopAndTopShadow: requires both fromGeometry and toGeometry, type: {Point}

esriMensurationAreaAndPerimeter,esriMensurationAreaAndPerimeter3D,esriMensurationCentroid,esriMensurationCentroid3D: requires only fromGeometry, type: {Polygon}, {Envelope}

pixelSize Description: The pixel level (resolution) being measured. If pixel size is not specified, then pixelSize will default to the base resolution of the image service. The raster at the specified pixel size in the mosaic dataset will be used for measurement.

The structure of the pixelSize parameter is the same as the structure of the point object returned by the ArcGIS REST API. In addition to the JSON structure, you can specify the pixel size with a simpler comma-separated syntax.

Syntax:
  • JSON structure: pixelSize={point}
  • Point simple syntax: pixelSize=<x>,<y>
Examples:
  • pixelSize={x: 0.18, y: 0.18}
  • pixelSize=0.18,0.18
mosaicRule Description: Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. When mosaic rule is not specified, mosaic rule will default to esriMosaicNone. The first visible image is used by measure.

Syntax:
{
  "mosaicMethod" : "<esriMosaicNone | esriMosaicCenter | esriMosaicNadir | esriMosaicViewpoint | 
                     esriMosaicAttribute | esriMosaicLockRaster | esriMosaicNorthwest | esriMosaicSeamline>",
  "where" : "<where>",
  "sortField" : "<sortFieldName>",
  "sortValue" : <sortValue>,
  "ascending" : <true | false>,
  "lockRasterIds" : [<rasterId1>, <rasterId2>],
  "viewpoint" : <point>,
  "fids" : [<fid1>, <fid2>],
  "mosaicOperation" : "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND>"
}
Example:
{
  "mosaicMethod" : "esriMosaicLockRaster",
  "lockRasterIds" : [32, 454, 14]
}
linearUnit Description: The linear unit in which height, length, or perimeters will be calculated. It can be any of the following esriUnits constant. If unit is not specified, the default is esriMeters. The list of valid esriUnits constants include:

esriInches | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriDecimeters | esriMeters | esriKilometers

For the description of each unit, see esriUnits constants.

angularUnit Description: The angular unit in which directions of line segments will be calculated. It can be one of the following esriDirectionUnits constant:

esriDURadians | esriDUDecimalDegrees

If unit is not specified, the default is esriDUDecimalDegrees. For the description of each unit, see esriDirectionUnits constants.

areaUnit Description: The area unit in which areas of polygons will be calculated. It can be any esriAreaUnits constant. If unit is not specified, the default is esriSquareMeters. The list of valid esriAreaUnits constants include:

esriSquareInches | esriSquareFeet | esriSquareYards | esriAcres | esriSquareMiles | esriSquareMillimeters | esriSquareCentimeters | esriSquareDecimeters | esriSquareMeters | esriAres | esriHectares | esriSquareKilometers

For the description of each unit, see esriAreaUnits constants.

Example Usage Usage

Example 1: Height measurement of the CN Tower from an IKONOS image.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"x":-8837407.939287,"y":5410409.73274808,"spatialReference":{"wkid":3857}}&toGeometry={"x":-8837535.26373312,"y":5410565.45010205,"spatialReference":{"wkid":3857}}&geometryType=esriGeometryPoint&measureOperation=esriMensurationHeightFromTopAndTopShadow&f=json

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"x":-8837319.21144998,"y":5410286.40105462,"spatialReference":{"wkid":3857}}&toGeometry={"x":-8837536.59465068,"y":5410565.89374123,"spatialReference":{"wkid":3857}}&geometryType=esriGeometryPoint&measureOperation=esriMensurationHeightFromBaseAndTopShadow&f=json

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"x":-8837319.21144998,"y":5410286.40105462,"spatialReference":{"wkid":3857}}&toGeometry={"x":-8837407.939287,"y":5410409.73274808,"spatialReference":{"wkid":3857}}&geometryType=esriGeometryPoint&measureOperation=esriMensurationHeightFromBaseAndTop&f=json

Example 2: Distance measurement.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"x":-8837509.89131768,"y":5410514.60951823,"spatialReference":{"wkid":102100}}&toGeometry={"x":-8837097.67317758,"y":5410634.79300867,"spatialReference":{"wkid":102100}}&geometryType=esriGeometryPoint&measureOperation=esriMensurationDistanceAndAngle&f=json

Example 3: Area and perimeter measurement.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"spatialReference":{"wkid":102100},"rings":[[[-8837789.57065524,5410425.87591314],[-8837513.26094825,5410505.62383671],[-8837466.08612023,5410357.36009149],[-8837748.01187818,5410283.22821889],[-8837789.57065524,5410425.87591314]]]}&geometryType=esriGeometryPolygon&measureOperation=esriMensurationAreaAndPerimeter&f=json

Example 4: Point measurement.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer/measure?fromGeometry={"x":-8837506.52168711,"y":5410512.36309785,"spatialReference":{"wkid":3857}}&toGeometry=&geometryType=esriGeometryPoint&measureOperation=esriMensurationPoint&mosaicRule=&pixelSize=&f=json

Example 5: Centroid measurement

http://myserver:port/arcgis/rest/services/myservice/ImageServer/ImageServer/measure?fromGeometry={"xmin":-117.19944857,"ymin":34.05586888,"xmax":-117.19940048,"ymax":34.05589815,"spatialReference":{"wkid":4326}}&geometryType=esriGeometryEnvelope&measureOperation=esriMensurationCentroid&mosaicRule=&f=pjson

JSON Response Syntax

{
  "name" : "<name>",
  "sensorName" : "<sensorName>",
  "height" : <height>, //only for the following measureOpetion: esriMensurationHeightFromBaseAndTop,esriMensurationHeightFromBaseAndTopShadow,esriMensurationHeightFromTopAndTopShadow
  "area" : <area> //only for esriMensurationAreaAndPerimeter,esriMensurationAreaAndPerimeter3D
  "perimeter" : <perimeter> //only for esriMensurationAreaAndPerimeter,esriMensurationAreaAndPerimeter3D
  "distance" : <distance> //only for esriMensurationDistanceAndAngle,esriMensurationDistanceAndAngle3D
  "azimuthAngle":<azimuthAngle> //only for esriMensurationDistanceAndAngle,esriMensurationDistanceAndAngle3D
  "elevationAngle":<elevationAngle> //only for esriMensurationDistanceAndAngle3D  
  "point" : <pointmeasurement> //only for esriMensurationCentroid,esriMensurationPoint,esriMensurationPoint3D,esriMensurationCentroid3D  
}
Height/area/perimeter/distance/azimuthangle/elevationangle objects:
{
    "<value>" : <value>,//raw double values computed, used together with uncertainty
    "<uncertainty>" : <Uncertainty>//uncertainty of the measurement, used together with measured value. Please note for most commercial imagery, it represents only click uncertainty.
    "<displayValue>" : <DisplayValue>//measured value represented in significant figures in string format
    "<unit>" : "<Unit>"//unit representing LinearUnit, AreaUnit, and AngularUnit as defined in the request
}
Point measurement object JSON Syntax:
{
    "<value>" : <point> 
}

JSON Response Example 1(for the following measureOperation: esriMensurationHeightFromBaseAndTop, esriMensurationHeightFromBaseAndTopShadow, esriMensurationHeightFromTopAndTopShadow)

{
 "name": "08MAY18184148-P1BS-005765570010_02_P002",
 "sensorName": "RPC",
 "height": {
  "value": 15273.76266854526,
  "displayValue": "1.5e+04",
  "uncertainty": 1838.5614213195531,
  "unit": "esriMillimeters"
 }
}

JSON Response Example 2(for the following measureOperation: esriMensurationDistanceAndAngle)

{
 "name": "08MAY18184148-P1BS-005765570010_02_P002",
 "sensorName": "RPC",
 "distance": {
  "value": 5500.337504324923,
  "displayValue": "5.5e+03",
  "uncertainty": 645.3512557047002,
  "unit": "esriMillimeters"
 },
 "azimuthAngle": {
  "value": 58.673197026401894,
  "displayValue": "58.67319702640189",
  "uncertainty": -1,
  "unit": "esriDUDecimalDegrees"
 }
}

JSON Response Example 3(for the following measureOperation: esriMensurationAreaAndPerimeter, esriMensurationAreaAndPerimeter3D)

{
 "name": "RedlandsWGS84",
 "sensorName": "Unknown",
 "area": {
  "value": 226.28020776466562,
  "displayValue": "226.2802077646656",
  "uncertainty": -3.8610215855E-7,
  "unit": "esriSquareMiles"
 },
 "perimeter": {
  "value": 61.21851284354401,
  "displayValue": "61.21851284354401",
  "uncertainty": -6.2137119224E-4,
  "unit": "esriMiles"
 }
}

JSON Response Example 4 (for the following measureOperation: esriMensurationCentroid, esriMensurationPoint, esriMensurationPoint3D, esriMensurationCentroid3D)

{
"name": "08MAY18184148-P1BS-005765570010_02_P002",
"sensorName": "RPC",
"point": {"value": {
  "x": -117.19944857,
  "y": 34.05586888,
  "spatialReference": {
   "wkid": 4326,
   "latestWkid": 4326
  }
}}
}

JSON Response Example 5 (for the following measureOperation: esriDistanceAndAngle3D)

{
 "name": "08MAY18184148-P1BS-005765570010_02_P002.NTF:0",
 "sensorName": "RPC",
 "distance": {
  "value": 0,
  "displayValue": "0",
  "uncertainty": 0,
  "unit": "esriDecimalDegrees"
 },
 "azimuthAngle": {
  "value": 359.45477179661953,
  "displayValue": "359.4547717966195",
  "uncertainty": -1,
  "unit": "esriDUDecimalDegrees"
 },
 "elevationAngle": {
  "value": 1.832464078203601,
  "displayValue": "1.832464078203601",
  "uncertainty": -1,
  "unit": "esriDUDecimalDegrees"
 }
}