Measure From Image

URL:
https://<imageservice-url>/measureFromImage
Methods:
GET
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

ParameterDetails

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

Use dark colors for code blocksCopy
1
rasterId=1

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

Use dark colors for code blocksCopy
1
2
3
4
5
//Point with spatial reference
fromGeometry={"x": 110, "y": -222, "z": 632.83443, "spatialReference": { "wkid": 32611,  "latestWkid": 32611 }}

//Point with no spatial reference
fromGeometry={"x":222,"y":-322}

Syntax:

Use dark colors for code blocksCopy
1
2
//JSON structures
geometryType=<geometryType>&geometry={geometry}

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

Use dark colors for code blocksCopy
1
toGeometry={"x": 110, "y": -232, "z": 632.83443, "spatialReference": {  "wkid": 32611,  "latestWkid": 32611 }}

Syntax:

Use dark colors for code blocksCopy
1
2
//JSON structures
geometryType=<geometryType>&geometry={geometry}

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:

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

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "Shape": {
    "x": x,
    "y": y,
    "z": z,
    "spatialReference": {
      <spatialReference>
    }
  },
  "To": {
    "x": x,
    "y": y,
    "z": z,
    "spatialReference": {
      <spatialReference>
    }
  },
  "Distance": <distance>
}

Measure polylines syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  "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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  "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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  "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:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "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
}

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