Measure
- URL:http://<imageservice-url>/measure
- Required Capability:Mensuration
- Version Introduced:10.1
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 an 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, see the help topic.
Request 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:
Examples:
|
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:
Examples:
|
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 types require different from/to geometries: esriMensurationPoint, esriMensurationPoint3D: require only fromGeometry, type: {Point} esriMensurationDistanceAndAngle, esriMensurationDistanceAndAngle3D, esriMensurationHeightFromBaseAndTop, esriMensurationHeightFromBaseAndTopShadow, and esriMensurationHeightFromTopAndTopShadow: require both fromGeometry and toGeometry, type: {Point} esriMensurationAreaAndPerimeter, esriMensurationAreaAndPerimeter3D, esriMensurationCentroid, and esriMensurationCentroid3D: require only fromGeometry, type: {Polygon}, {Envelope} Supported menause operations can be derived from the mensurationCapabilities in the image service root resource. Basic capability supports esriMensurationPoint,esriMensurationDistanceAndAngle,esriMensurationAreaAndPerimeter,esriMensurationCentroid Basic, 3D capabilities support: esriMensurationPoint3D,esriMensurationDistanceAndAngle3D,esriMensurationAreaAndPerimeter3D, esriMensurationCentroid3D Base-Top Height capability supports esriMensurationHeightFromBaseAndTop Top-Top Shadow Height capability supports esriMensurationHeightFromTopAndTopShadow Base-Top Shadow Height capability supports esriMensurationHeightFromBaseAndTopShadow |
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:
Examples:
|
mosaicRule | Description: Specifies the mosaic rule when defining how individual images should be mosaicked. When a mosaic rule is not specified, the default mosaic rule of the image service will be used (as advertised in the root resource: defaultMosaicMethod, mosaicOperator, sortField, sortValue). The first visible image is used by measure. Refer to the mosaic rule json objects for the syntax and examples. |
linearUnit | Description: The linear unit in which height, length, or perimeters will be calculated. It can be any of the following esriUnits constant. If the 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
Example 1: Height measurement of the CN Tower from an IKONOS image.
Example 2: Distance measurement.
Example 3: Area and perimeter measurement.
Example 4: Point measurement.
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: esriMensurationDistanceAndAngle3D)
{
"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"
}
}