Densify

URL:
https://<root>/Utilities/Geometry/GeometryServer/densify
Methods:
GET
Version Introduced:
10.0

Description

The densify operation is performed on a geometry service resource. This operation densifies geometries by plotting points between existing vertices. At 10.1 and later, this operation calls simplify on the input geometries values when geodesic=true . You can provide arguments to the densify operation as query parameters defined in the following parameters table.

Request parameters

ParameterDetails

geometries

Specifies the array of geometries to densify. The structure of each geometry in the array is the same as the structure of the JSON geometry objects returned by ArcGIS REST API.

Syntax

Use dark colors for code blocksCopy
1
{"geometryType": "<esriGeometryPolyline | esriGeometryPolygon>","geometries": [<geometry1>, <geometry2>]}

Example

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

Specifies the well-known ID (WKID) or a spatial reference JSON object for the input polylines values. For a list of valid WKID values, see Using spatial references.

maxSegmentLength

Specifies that all segments longer than maxSegmentLength are replaced with sequences of lines no longer than maxSegmentLength .

geodesic

(Optional)

If geodesic is set to true , geodesic distance is used to calculate maxSegmentLength . Geodesic distance is the shortest path between two points along the ellipsoid of the earth. If geodesic is set to false , 2D Euclidean distance is used to calculate maxSegmentLength . The default is false .

Values: true | false

lengthUnit

(Optional)

Specifies the length unit of maxSegmentLength . If geodesic is set to false , the units are derived from sr , and lengthUnit is ignored. If geodesic is set to true , lengthUnit must be a linear unit. If lengthUnit is not specified and sr is a projected coordinate system, the units are derived from sr . If lengthUnit is not specified and sr is a geographic coordinate system, the units are meters. For a list of valid units, see esriSRUnitType Constants and esriSRUnit2Type Constants.

f

The response format. The default response format is html .

Values: html | json | pjson

Example usage

The following is a sample request URL for densify that demonstrates densifying a polyline such that the geodesic length of every segment is less than or equal to 1,000 miles:

Use dark colors for code blocksCopy
1
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/densify?sr=3395&geometries={"geometryType":"esriGeometryPolyline","geometries":[{"paths":[[[-17313284,2209625],[-14501308,7392483],[-13773503,6003036]]]}]}&maxSegmentLength=1000&geodesic=true&lengthUnit=9035&f=pjson

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

JSON Response example

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
{
  "geometryType": "esriGeometryPolyline",
  "geometries": [
    {
      "paths": [
        [
          [
            -17313284,
            2209624.9999999986
          ],
          [
            -16655062.049837345,
            3744690.7461717259
          ],
          [
            -15791586.920996182,
            5449830.3807660341
          ],
          [
            -14501308,
            7392482.9999999981
          ],
          [
            -13773503.000000002,
            6003036
          ]
        ]
      ]
    }
  ]
}

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