FRAMES | NO FRAMES Description | Parameters | Examples | Response
Generalize (Operation)
URL http://<geometryservice-url>/generalize
Parent Resource Geometry Service

Description

The generalize operation is performed on a geometry service resource. It returns generalized (Douglas-Poiker) versions of the input geometries.

You can provide arguments to the generalize 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 generalized. The spatial reference of the geometries is specified by sr. 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 the geometryType property.

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 geometries. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.
maxDeviation Description : Specifies the maximum deviation for constructing a generalized geometry based on the input geometries.
deviationUnit (optional) Description : A unit for maximum deviation. If unit is not specified, the units are derived from sr. For a list of valid units, see esriSRUnitType Constants and esriSRUnit2TypeConstants.

Example Usage

Example 1: In this example, a polygon is generalized.

http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer/generalize?
sr=4326
&geometries={"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":4326},"geometries":[{"rings":[[[-87.099342820011174,40.228084543758385],[-87.100223146960218,40.381421968321966],[-87.101720814594017,40.480793699969276],[-87.100295810761097,40.57694817663144],[-86.777024960686575,40.576769365423601],[-86.700217232694484,40.574640906530412],[-86.700551416568786,40.443071019286172],[-86.704228938064603,40.225843915639118],[-87.099342820011174,40.228084543758385]]]}]}
&maxDeviation=0.01
&deviationUnit=
&f=html

JSON Response Syntax

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

JSON Response Example

{
  "geometryType" : "esriGeometryPolygon", 
  
  "geometries" : 
  [
    {
      "rings" : 
      [
        [
          [-87.0993428200112, 40.2280845437584], 
          [-87.1002958107611, 40.5769481766314], 
          [-86.7002172326945, 40.5746409065304], 
          [-86.7042289380646, 40.2258439156391], 
          [-87.0993428200112, 40.2280845437584]
        ]
      ]
    }
  ]
}