Map To Image

URL:
https://<imageservice-url>/mapToImage
Methods:
GET
Required Capability:
Catalog
Version Introduced:
11.2

Description

The mapToImage operation converts the geometry on a map space to an image space.

Request parameters

ParameterDetails

rasterId

Specifies the objectId of the raster item. The output geometry parameter will use the image coordinate system of the specified raster item.

geometry

The input geometry. 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 envelopes and points, you can specify the geometry with a comma-separated syntax.

Syntax

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

//Point simple syntax
geometryType=esriGeometryPoint&geometry=<x>,<y>

Examples

Use dark colors for code blocksCopy
1
2
//Point example
geometryType=esriGeometryPoint&geometry=-104,35.6

geometryType

The type of geometry specified by the geometry parameter. The geometry type can be point, multipoint, line, or polygon.

Values: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon |

options

(optional)

Supports a VisibleOnly key. VisibleOnly when true, the operation will return an empty geometry if the input geometry is not visible. The default value is false.

Syntax

Use dark colors for code blocksCopy
1
options={"VisibleOnly": <true | false>}

f

The response format. The default response format is html .

Values: html | json | pjson

Example usage

The following is a sample request URL for the mapToImage operation that will convert a multipoint in the map space to the image space with a rasterID of 3:

Use dark colors for code blocksCopy
1
https://myserver/ArcGIS/rest/services/BrewertonTank_cloud/ImageServer/mapToImage?geometry={"points":[[407323.19,4787427.54],[407323.19,4787478.54]]}&geometryType=esriGeometryMultipoint&inSR=&rasterId=3&f=html

The following is a sample request URL for the mapToImage operation that will convert a polygon in the map space to the image space with a rasterID of 2:

Use dark colors for code blocksCopy
1
https://myserver/ArcGIS/rest/services/BrewertonTank_cloud/ImageServer/mapToImage?geometry={"rings":[[[407323.19,4787427.54],[407323.19,4787478.54],[407324.19,4787427.54],[407323.19,4787478.54]]]}&geometryType=esriGeometryPolygon&inSR=&rasterId=2&f=html

JSON Response syntax

Point syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "x": <x>,
  "y": <y>,
  "z": <z>,
  "spatialReference": {
    <spatialReference>
  }
}

Multipoint 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
{
  "hasZ": <true|false>,
  "points": [
    [
      <x1>,
      <y1>,
      <z1>
    ],
    [
      <x2>,
      <y2>,
      <z2>
    ]
  ],
  "spatialReference": {
    <spatialReference>
  }
}

Polyline syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "hasZ": <true|false>,
  "paths": [
    [
      [<x11>, <y11>, <z11>],
      [<x1N>, <y1N>, <z1N>]
    ],
    [
      [<xk1>, <yk1>, <zk1>],
      [<xkM>, <ykM>, <zkM>]
    ]
  ],
  "spatialReference": {<spatialReference>}
}

Polygon syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "hasZ": <true | false>,
  "rings": [
    [
      [<x11>, <y11>, <z11>],
      [<x1N>, <y1N>, <z1N>]
    ],
    [
      [<xk1>, <yk1>, <zk1>],
      [<xkM>, <ykM>, <zkM>]
    ]
  ],
  "spatialReference": {<spatialReference>}
}

JSON Response example

Example one

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
{
  "hasZ": true,
  "rings": [
    [
      [
        2023.646434180443,
        -1857.2131409192998,
        88.08833
      ],
      [
        1754.46942976375,
        -1295.9305158252814,
        88.08833
      ],
      [
        2055.4897163412415,
        -1850.3282377299251,
        88.08833
      ],
      [
        1754.46942976375,
        -1295.9305158252814,
        88.08833
      ],
      [
        2023.646434180443,
        -1857.2131409192998,
        88.08833
      ]
    ]
  ]
}

Example two

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "hasZ": true,
  "points": [
    [
      2023.646434180443,
      -1857.2131409192998,
      88.08833
    ],
    [
      1754.46942976375,
      -1295.9305158252814,
      88.08833
    ]
  ]
}

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