Skip To Content
ArcGIS Developer
Dashboard

Map To Image

  • URL:https://<imageservice-url>/mapToImage
  • 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


//JSON structures
geometryType=<geometryType>&geometry={geometry}

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

Examples


//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 |

inSR

(optional)

The spatial reference of the input geometry. The spatial reference can be specified as either a well-known ID or as a spatial reference JSON object. If inSR is not specified, the geometry is assumed to be in the spatial reference of the service.

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

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:

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:

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


{
  "x": <x>,
  "y": <y>,
  "z": <z>, 
  "spatialReference": {
    <spatialReference>
  }
}

Multipoint syntax


{  
  "hasZ": <true|false>,
  "points": [
    [
      <x1>,
      <y1>,
      <z1>
    ],
    [
      <x2>,
      <y2>,
      <z2>
    ]
  ], 
  "spatialReference": {
    <spatialReference>
  }
}

Polyline syntax


{
  "hasZ": <true|false>,
  "paths": [
    [
      [<x11>, <y11>, <z11>],
      [<x1N>, <y1N>, <z1N>]
    ],
    [
      [<xk1>, <yk1>, <zk1>],
      [<xkM>, <ykM>, <zkM>]
    ]
  ],
  "spatialReference": {<spatialReference>}
}

Polygon syntax


{
  "hasZ": <true | false>,
  "rings": [
    [
      [<x11>, <y11>, <z11>],
      [<x1N>, <y1N>, <z1N>]
    ],
    [
      [<xk1>, <yk1>, <zk1>],
      [<xkM>, <ykM>, <zkM>]
    ]
  ],
  "spatialReference": {<spatialReference>}
}

JSON Response example

Example one


{
  "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


{
  "hasZ": true,
  "points": [
    [
      2023.646434180443,
      -1857.2131409192998,
      88.08833
    ],
    [
      1754.46942976375,
      -1295.9305158252814,
      88.08833
    ]
  ]
}