Project

Description

The project operation is performed on a geometry service resource. This operation projects an array of input geometries from the input spatial reference to the output spatial reference.

At 10.1 and later, this operation calls simplify on the input geometries.

You can provide arguments to the project operation as query parameters defined in the following parameters table:

Request parameters

Parameter

Details

f

Description:  (Optional) The response format. The default response format is html.
Values:   html | json

geometries

Description: The array of geometries to be projected. The structure of each geometry in the array is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API.

JSON structures:

Syntax:

{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

NoteNote:

Support for the esriGeometryEnvelope geometry type was added at 9.3 SP1.

The geometries parameter is an array of input geometries. All geometries in this array should be of the type defined by geometryType.

Example:

{
  "geometryType" : "esriGeometryPolyline",
    "geometries" : 
  [
    {
      "paths" : 
      [
        [[-117,34],[-116,34],[-117,33]],
        [[-115,44],[-114,43],[-115,43]]
      ]
    },
    {
      "paths" : 
      [
        [[32,17],[31,17],[30,17],[30,16]]
      ]
    }
  ]
}

Simple Syntax for point geometries: 
When using points, in addition to the JSON structures, you can specify the geometries with a simpler comma-separated syntax. 
Syntax: geometries=x1, y1, x2, y2, ..., xn, yn
Example: geometries=-104.53, 34.74, -63.53, 10.23

URL based:  
For a large set of geometries, you can specify a URL to the input geometries stored in a JSON structure in a file on a public server. The expected format of the file’s contents will be exactly the same as that expected if the geometries were directly embedded in the request. 
Syntax: geometries={ "url" : "<URL to file>" }
Example: geometries={ "url" : "http://myserver/mygeometries/afile.txt" }

inSR

Description: The well-known ID of the spatial reference or a spatial reference JSON object for the input geometries. For a list of valid WKID values, see Projected coordinate systems and Geographic coordinate systems.

outSR

Description: The well-known ID of the spatial reference or a spatial reference JSON object for the returned geometries. For a list of valid WKID values, see Projected coordinate systems and Geographic coordinate systems.

transformation

NoteNote:
This option was added at 10.1.

Description: (Optional) The well-known ID or a JSON object specifying the datum transformation (also known as geographic transformation) to be applied to the projected geometries. Note that a transformation need only be specified if the output spatial reference contains a different geographic coordinate system than the input spatial reference.

A datum transformation may be specified as a JSON object. This form is especially useful if creating a custom transformation. If a transformation is specified using a JSON object, it should have the following format:

{"wkt" : <wkt> }
where <wkt> is the well-known text string representation of the datum transformation. See Example 2 below.

For a list of valid datum transformation ID values and well-known text strings, see Datum transformations.

If transformation is not specified, a search is made through a set of default datum transformations. Currently, the following default transformations are used when applicable:

  • esriSRGeoTransformation_NAD_1927_TO_NAD_1983_NADCON, forward and reverse, WKID=1241
  • esriSRGeoTransformation_NAD1983_To_WGS1984_1, forward and reverse, WKID=1188
  • esriSRGeoTransformation_NAD1927_To_WGS1984_4, forward and reverse, WKID=1173

transformFoward

NoteNote:
This option was added at 10.1.

Description: (Optional) A Boolean value indicating whether or not to transform forward. The forward or reverse direction of transformation is implied in the name of the transformation. If transformation is specified, a value for the transformForward parameter must also be specified. The default value is false.

Values: true | false

Example usage

Example1

This example projects two polygons from WGS 84 (4326) to Web Mercator (3857). A datum transformation is not specified since the Web Mercator projection has as its underlying geographic coordinate system WGS 84 which is the input coordinate system.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=4326&outSR=3857&geometries={"geometryType":"esriGeometryPolygon","geometries":[{"rings":[[[-117,34],[-116,34],[-117,33],[-117,34]],[[-115,44],[-114,43],[-115,43],[-115,44]]]},{"rings":[[[32,17],[31,17],[30,17],[30,16],[32,17]]]}]}

Example2

This example projects the same two polygons as in Example 1 from WGS 84 (4326) to North American Equidistant Conic (102010). The output spatial reference has as its underlying geographic coordinate system NAD 83 (4269) so a datum transformation is specified. The well-known text representation of the transformation is used.

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=4326&outSR=102010&geometries={"geometryType":"esriGeometryPolygon","geometries":[{"rings":[[[-117,34],[-116,34],[-117,33],[-117,34]],[[-115,44],[-114,43],[-115,43],[-115,44]]]},{"rings":[[[32,17],[31,17],[30,17],[30,16],[32,17]]]}]}&transformation={"wkt":"GEOGTRAN[\"WGS_1984_(ITRF00)_To_NAD_1983_CORS96\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],GEOGCS[\"GCS_NAD_1983_CORS96\",DATUM[\"D_NAD_1983_CORS96\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],METHOD[\"Coordinate_Frame\"],PARAMETER[\"X_Axis_Translation\",0.9956],PARAMETER[\"Y_Axis_Translation\",-1.9013],PARAMETER[\"Z_Axis_Translation\",-0.5215],PARAMETER[\"X_Axis_Rotation\",0.025915],PARAMETER[\"Y_Axis_Rotation\",0.009426],PARAMETER[\"Z_Axis_Rotation\",0.011599],PARAMETER[\"Scale_Difference\",0.00062]]"}&transformForward=true&f=html

JSON response syntax

{
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

JSON response example

{
 "geometries": [
  {
   "rings": [
    [
     [
      -12913060.932019727,
      4028802.0261344141
     ],
     [
      -13024380.422813002,
      3895303.9633939015
     ],
     [
      -13024380.422813002,
      4028802.0261344141
     ],
     [
      -12913060.932019727,
      4028802.0261344141
     ]
    ],
    [
     [
      -12690421.95043318,
      5311971.8469454823
     ],
     [
      -12801741.441226454,
      5311971.8469454823
     ],
     [
      -12801741.441226454,
      5465442.1833227612
     ],
     [
      -12690421.95043318,
      5311971.8469454823
     ]
    ]
   ]
  },
  {
   "rings": [
    [
     [
      3562223.7053847606,
      1920825.040377473
     ],
     [
      3339584.7237982131,
      1804722.7662572993
     ],
     [
      3339584.7237982131,
      1920825.040377473
     ],
     [
      3450904.2145914868,
      1920825.040377473
     ],
     [
      3562223.7053847606,
      1920825.040377473
     ]
    ]
   ]
  }
 ]
}