FRAMES | NO FRAMES Description | Parameters | Examples | Response
Densify (Operation)

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

URL http://<geometryservice-url>/densify
Parent Resource Geometry Service

Description

The densify operation is performed on a geometry service resource. This operation densifies geometries by plotting points between existing vertices.

You can provide arguments to the densify operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
geometries Description: The array of geometries to be densified. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:
{
"geometryType" : "<esriGeometryPolyline | esriGeometryPolygon>"
"geometries" : [ <geometry1>, <geometry2> ]
}

The "geometries" property 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.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86]]
 ]
}
]
}
    
sr Description: The well-known ID or a spatial reference json object for the input polylines. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.
maxSegmentLength Description: All segments longer than maxSegmentLength are replaced with sequences of lines no longer than maxSegmentLength.
geodesic Description: A flag that can be set to true if GCS spatial references are used or densify geodesic is to be performed.
lengthUnit (optional) Description: The length unit of maxSegmentLength, can be any esriUnits constant. In case not specified, if the SR is PCS, the unit is determined by unit of the SR, otherwise, it is meter. For a list of valid units, see esriSRUnitType Constants and esriSRUnit2TypeConstants.

Example Usage

Example 1: In this example, a polyline is densified.

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/densify?
sr=3395
&geometries={%0D%0A"geometryType"+%3A+"esriGeometryPolyline"%2C%0D%0A"geometries"+%3A+[%0D%0A{"paths"+%3A+[[[-17313284.793%2C2209625.866]%2C[-17312808.186926104%2C+2210504.3164105085]%2C[-17308518.732261017%2C2218410.3701050845]%2C%0D%0A[-17260185.82890302%2C2310809.9320710143]%2C%0D%0A[-17307752.671522036%2C2223194.8742101695]%2C%0D%0A[-14501308.957%2C7392483.288]%2C[-13773503.446%2C6003036.405+]]]}]}
&maxSegmentLength=10000
&useDeviationDensification=false
&densificationParameter=0
&geodesic=false
&lengthUnit=
&f=html

JSON Response Syntax

{
"geometryType" : "<esriGeometryType>",
"geometries" : [<geometry1>, <geometry2>]
}

JSON Response Example

{
"geometryType" : "esriGeometryPolyline",
"geometries" : [
 {
   "paths" : [
    [[-117,34],[-116,34],[-117,33]],
    [[-115,44],[-114,43],[-115,43]]
   ]
 },
{
  "paths" : [
  [[32.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86]]
 ]
}
]
}