|
ArcGIS Runtime SDK for iOS
100.9
|
A multipart shape used to represent an area.
Polygon geometries represent the shape and location of areas, for example, a country, island, or a lake. They can be used as the geometry of features and graphics, or as input or output of tasks or geoprocessing operations, such as the output of a drive-time analysis or an AGSGeometryEngine::bufferWithGeometry:distance: operation.
Each part of a multipart polygon is a series of connected segments forming a closed ring. Each part must not cross any other part but may lie completely inside or outside another part. For example, a polygon representing the state of Hawaii would comprise eight disjoint parts, one representing each island. A polygon representing the country of South Africa, which completely surrounds the enclave of Lesotho, would comprise two parts, one contained inside the other.
AGSPolygon is similar to AGSPolyline in that they are both composed of a series of connected segments. Like AGSPolyline, the AGSPolygon class is an AGSMultipart, which provides members for iterating the segments and points of each part in an AGSPolyline. Unlike parts in an AGSPolyline, however, each part of a polygon defines a closed area, so the end point of the last segment in the part is always in the same location as the start point of the first segment, forming a closed boundary.
When defining a polygon part, there is no need to explicitly close it by repeating the start point as the last point. Polygons parts are always interpreted as enclosed areas by ArcGIS Runtime. However, you may need to simplify a polygon created with Runtime before storing it in a geodatabase or using it in geometry operations that rely on topological consistency.
To build a polygon one point at a time, or modify an existing polygon, use an AGSPolygonBuilder.
toBuilder (AGSPolygon): to get a polygon builder using a copy of this geometry as a starting off point. The builder can then be modified to produce a new geometry.AGSPolygonBuilder to construct or modify polygons programmatically. AGSSketchEditor to construct or modify geometries interactively by sketching on a map. AGSGeometryEngine to perform operations on geometries.
Instance Methods | |
| (BOOL) | - isEqualToGeometry: |
| (BOOL) | - isEqualToGeometry: |
| (BOOL) | - isEqualToGeometry:tolerance: |
| (AGSPolygonBuilder *) | - toBuilder |
| (nullable id) | - toJSON: |
| (AGSPolyline *) | - toPolyline |
Class Methods | |
| (nullable id< AGSJSONSerializable >) | + fromJSON:error: |
| (instancetype) | + polygonWithPoints: |
Properties | |
| AGSGeometryDimension | dimension |
| BOOL | empty |
| AGSEnvelope * | extent |
| AGSGeometryType | geometryType |
| BOOL | hasCurves |
| BOOL | hasM |
| BOOL | hasZ |
| AGSPartCollection * | parts |
| AGSSpatialReference * | spatialReference |
| NSDictionary< NSString *, id > * | unknownJSON |
| NSDictionary< NSString *, id > * | unsupportedJSON |
|
staticrequiredinherited |
Initializes and returns an object from its JSON representation.
| JSONObject | NSDictionary or NSArray containing the JSON. |
| error | encountered during the operation, if any. |
| - (BOOL) isEqualToGeometry: | (AGSPolygon *) | other |
Compares whether two polygon geometries are equal.
| other | polygon to compare this polygon to |
| - (BOOL) isEqualToGeometry: | (AGSGeometry *) | other |
Compares whether two geometries are equal.
| other | geometry to compare this geometry to |
| - (BOOL) isEqualToGeometry: | (AGSGeometry *) | other | |
| tolerance: | (double) | tolerance | |
| + (instancetype) polygonWithPoints: | (NSArray< AGSPoint * > *) | points |
Initializes a polygon.
| points | for the geometry to be constructed |
| - (AGSPolygonBuilder*) toBuilder |
Returns a builder using a copy of this geometry as a starting off point. The builder can then be modified to produce a new geometry.
Implements AGSGeometry.
|
requiredinherited |
Returns JSON representation for this object.
| error | encountered during the operation, if any. |
NSDictionary or NSArray containing the JSON. Reimplemented in AGSPortalItem.
| - (AGSPolyline*) toPolyline |
|
readnonatomicassigninherited |
|
readnonatomicassigninherited |
Indicates whether this geometry has any vertices.
|
readnonatomicstronginherited |
Smallest, rectangular bounding-box that covers the geometry.
|
readnonatomicassigninherited |
The type of this geometry.
|
readnonatomicassigninherited |
Indicates whether this geometry has curves.
|
readnonatomicassigninherited |
Indicates whether this geometry contains m (measure) values.
|
readnonatomicassigninherited |
Indicates whether this geometry contains z coordinate values. Only 3D geometries contain z values.
|
readnonatomicstronginherited |
The parts of this geometry.
Can be iterated through a for-in loop.
|
readnonatomicstronginherited |
The spatial reference associated with the gometry. It specifies the coordinate system for the geometry's x, y, and z coordinate values.
|
readrequirednonatomiccopyinherited |
A dictionary of values that was in the source JSON but was unparsed by API.
NSDictionary containing the unknown JSON.
|
readnonatomiccopyinherited |
A dictionary of values that are supported by the REST API, but not exposed through the SDK API.
NSDictionary containing the unsupported JSON.