- URL:https://<imageservice-url>/measureFromImage
- Required Capability:Catalog, Mensuration
- Version Introduced:11.2
Description
The measureFromImage operation provides mensuration capabilities within one image space and returns the measurement result in a map space unit. When toGeometry is specified, this operation returns distance between the two geometries. When toGeometry is not specified, this operation returns length for a polyline geometry and area for a polygon geometry.
Request parameters
Parameter | Details |
---|---|
rasterId | Specifies the objectId of the raster item. The fromGeometry and toGeometry in this operation use the image coordinate system of the specified raster item. Example
|
fromGeometry | A geometry defines the from location of the measurement. If the spatial reference is missing, the coordinate is assumed to be in image space set through rasterId parameter. If the spatial reference exists, it will be used for the geometry's coordinates. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS Rest API. Example
Syntax: |
toGeometry | A geometry that defines the to location of the measurement. If spatialReference is missing, the coordinate is assumed to be in image space set through rasterId parameter. If spatialReference exists, it will be used for the geometry's coordinates. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS Rest API. Example
Syntax:
|
geometryType | The type of geometry specified by the fromGeometry and toGeometry parameters. The geometry type can be point, line, or polygon. The default geometry type is point. Values: esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | |
f | The response format. The default response format is html. Values: html | json | pjson |
Example usages
The following is a sample request for the measureFromImage operation that will return the area for a polygon on the raster item with a rasterID of 1:
https://machine.domain.com/webadaptor/rest/services/imageinspection/ImageServer/measureFromImage?fromGeometry={"rings":[[[407.19,-47.54],[4073.19,-478.54],[404.19,-477.54],[407.19,-47.54]]]}&toGeometry=&geometryType=esriGeometryPolygon&rasterId=1&f=html
The following is a sample request for the measureFromImage operation that will return the distance in the map space between two points on the raster item with a rasterID of 1:
https://machine.domain.com/webadaptor/rest/services/imageinspection/ImageServer/measureFromImage?fromGeometry={"x": 110, "y": -222, "z": 632.83443, "spatialReference": { "wkid": 32611, "latestWkid": 32611 }}&toGeometry={"x": 110, "y": -232, "z": 632.83443, "spatialReference": { "wkid": 32611, "latestWkid": 32611 }}&geometryType=esriGeometryPoint&rasterId=1&f=html
JSON Response syntax
Measure points
{
"Shape": {
"x": x,
"y": y,
"z": z,
"spatialReference": {
<spatialReference>
}
},
"To": {
"x": x,
"y": y,
"z": z,
"spatialReference": {
<spatialReference>
}
},
"Distance": <distance>
}
Measure polylines syntax
{
"Shape": {
"hasZ": <true|false>,
"paths": [
[
[<x11>, <y11>, <z11>, <m11>],
[<x1N>, <y1N>, <z1N>, <m1N>]
],
[
[<xk1>, <yk1>, <zk1>, <mk1>],
[<xkM>, <ykM>, <zkM>, <mkM>]
]
],
"spatialReference": {<spatialReference>}
},
"To": {
"hasZ": <true|false>,
"paths": [
[
[<x11>, <y11>, <z11>, <m11>],
[<x1N>, <y1N>, <z1N>, <m1N>]
],
[
[<xk1>, <yk1>, <zk1>, <mk1>],
[<xkM>, <ykM>, <zkM>, <mkM>]
]
],
"spatialReference": {<spatialReference>}
},
"Distance": <distance>
}
Measure polygons syntax
{
"Shape": {
"hasZ": <true | false>,
"rings": [
[
[<x11>, <y11>, <z11>, <m11>],
[<x1N>, <y1N>, <z1N>, <m1N>]
],
[
[<xk1>, <yk1>, <zk1>, <mk1>],
[<xkM>, <ykM>, <zkM>, <mkM>]
]
],
"spatialReference": {<spatialReference>}
},
"To": {
"hasZ": <true | false>,
"rings": [
[
[<x11>, <y11>, <z11>, <m11>],
[<x1N>, <y1N>, <z1N>, <m1N>]
],
[
[<xk1>, <yk1>, <zk1>, <mk1>],
[<xkM>, <ykM>, <zkM>, <mkM>]
]
],
"spatialReference": {<spatialReference>}
},
"Distance": <distance>
}
JSON Response examples
If no toGeometry is specified, the operation returns Area for polygon.
{
"Shape": {
"hasZ": true,
"rings": [
[
[
491379.1529131501,
3762876.9130988657,
632.83443
],
[
491401.72644230135,
3762975.667604944,
632.83443
],
[
491390.9020118707,
3762875.5665160273,
632.83443
],
[
491379.1529131501,
3762876.9130988657,
632.83443
]
]
],
"spatialReference": {
"wkid": 32611,
"latestWkid": 32611
}
},
"Length": 213.8122642642981,
"Center": {
"x": 491390.51673341653,
"y": 3762917.499733549
},
"Area": 595.3367839888944
}
Measure distance between two points specified in fromGeometry and toGeometry parameters:
{
"Shape": {
"x": 110,
"y": -222,
"z": 632.83443,
"spatialReference": {
"wkid": 32611,
"latestWkid": 32611
}
},
"To": {
"x": 110,
"y": -232,
"z": 632.83443,
"spatialReference": {
"wkid": 32611,
"latestWkid": 32611
}
},
"Distance": 10
}