GetMergedArea()
Summary
Creates an area by merging a set of features.
Syntax
merged_area = GetMergedArea(string layer_set, array options)
| Argument | Contents |
|---|---|
| layer_set | Name of the input layer or selection set |
| Option | Type | Contents |
|---|---|---|
| Progress Message | String | A progress message to display |
Returns
An array of three elements:
| Element | Type | Contents |
|---|---|---|
| n_polygons | Integer | Number of polygons in the merged area |
| n_points_array | Array | Array of integers containing the number of points in each polygon |
| coords | Array | The complete array of coordinates that define the area. The coordinates appear polygon by polygon, and the first coordinate of each polygon is repeated at the end of the polygon |
Notes
-
GetMergedArea() returns coordinates for a new area that removes common boundaries between adjacent areas.
-
GetMergedArea() does not make any changes to the input layer.
-
If the input layer or selection set consists of line features, GetMergedArea() produces the largest area defined by those features.
-
The input layer or selection set must contain line or area features.
Example
// Before running the example, create a map by opening nesouth.cdf
// in the Tutorial folder.
merged_area = GetMergedArea("County", {{"Progress Message", "Building area"}})
ShowArray(merged_area)
Error Codes
| Error Type | Meaning |
|---|---|
| Error | The set or layer name is invalid, or the set or layer does not contain geographic features |
| NotFound | The input set or layer does not exist or the set is empty |
See Also
| Function | Summary |
|---|---|
| MergeByValue() | Creates districts by merging areas from a geographic file, based on the value of a field |