10.2.5: AGSPolygon Class Reference
10.2.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
AGSPolygon Class Reference

Description

Instances of this class represent a polygon object. A polygon is defined by a collection of rings and an optional spatial reference. Each ring is a bounded area represented by a collection of points. The first and last points of a ring must coincide so that the ring is closed. Each point constitutes a vertex of the polygon.

AGSPolygon represents an immutable polygon, it cannot be altered after being created. Use AGSMutablePolygon for a mutable polygon. You can get a mutable version from AGSPolygon by passing the mutableCopy message to an instance of AGSPolygon.

Defined in:
AGSPolygon.h ( ArcGIS library)

Since
1.0
Inheritance diagram for AGSPolygon:
AGSGeometry <AGSCoding> AGSMutablePolygon

Instance Methods

(BOOL) - containsPoint:
 
(void) - decodeWithJSON:
 
(NSDictionary *) - encodeToJSON
 
(id) - initWithJSON:
 
(id) - initWithJSON:spatialReference:
 
(id) - initWithSpatialReference:
 
(BOOL) - intersectsWithEnvelope:
 
(BOOL) - isEmpty
 
(BOOL) - isEqualToPolygon:
 
(BOOL) - isValid
 
(NSInteger) - numPoints
 
(NSInteger) - numPointsInRing:
 
(AGSPoint *) - pointOnRing:atIndex:
 

Class Methods

(id) + polygonWithJSON:
 

Properties

AGSEnvelopeenvelope
 
NSInteger numRings
 
AGSSpatialReferencespatialReference
 

Method Documentation

- (BOOL) containsPoint: (AGSPoint *)  point

Checks whether point is contained in the polygon. The point and the polygon must have the same spatial reference.

Parameters
pointThe point to test containment.
Returns
YES if point is contained within the polygon.
Since
1.0
- (void) decodeWithJSON: (NSDictionary *)  json
optionalinherited

Decode object from JSON representation.

Parameters
jsonThe JSON representation of the object to be decoded.
Since
1.0
- (NSDictionary *) encodeToJSON
optionalinherited

Encode and return JSON representation for object.

Returns
JSON representation of object.
Since
1.0
- (id) initWithJSON: (NSDictionary *)  json
optionalinherited

Initialize and return object from JSON representation.

Parameters
jsonThe JSON representation of the object to be created.
Returns
Object decoded from JSON representation.
Since
1.0

Reimplemented in AGSWebMapFeatureCollection.

- (id) initWithJSON: (NSDictionary *)  json
spatialReference: (AGSSpatialReference *)  sr 

Initialize geometry object with json and a spatial reference.

Parameters
jsonThe JSON to initialize an AGSGeometry with.
srThe spatial reference of geometry represented in json.
Returns
A new geometry object.
Since
1.0
- (id) initWithSpatialReference: (AGSSpatialReference *)  spatialReference

Initialize geometry object with spatial reference.

Parameters
spatialReferenceThe spatial referenc of geometry.
Returns
A new geometry object.
Since
1.0
- (BOOL) intersectsWithEnvelope: (AGSEnvelope *)  envelope

Returns true if envelope intersects this geometry.

Parameters
envelopeThe envelope to test intersection relation.
Returns
True if envelopes intersects.
Since
1.0

Implemented in AGSEnvelope.

- (BOOL) isEmpty

Returns whether or not the geometry is empty.

Since
1.8

Implemented in AGSEnvelope.

- (BOOL) isEqualToPolygon: (AGSPolygon *)  other

Returns a value whether another polygon is equal to this polygon.

Parameters
otherThe other polygon to compare to.
Returns
Whether or not the other polygon is equal to this polygon.
Since
1.8
- (BOOL) isValid

Returns whether or not the geometry is valid.

Since
1.8
- (NSInteger) numPoints

Returns the total number of points in the polygon.

Since
10.1.1
- (NSInteger) numPointsInRing: (NSInteger)  ring

Get number of points in the specified ring.

Parameters
ringThe index of desired ring in the polygon.
Returns
Number of points in ring.
Since
1.0
- (AGSPoint *) pointOnRing: (NSInteger)  ring
atIndex: (NSInteger)  index 

Get point from ring.

Parameters
ringThe index of desired ring.
indexThe index of the desired point.
Returns
Point in ring at index.
Since
1.0
+ (id) polygonWithJSON: (NSDictionary *)  json

Initialize a new autoreleased polygon geometry.

Parameters
jsonThe JSON representation for polygon. See REST API documentation for JSON syntax.
Returns
A new, autoreleased, polygon geometry object.
Since
1.0

Property Documentation

- (AGSEnvelope*) envelope
readnonatomiccopyinherited

Smallest, rectangular bounding-box that covers the geometry.

Since
1.0
- (NSInteger) numRings
readnonatomicassign

Number of rings in polygon.

Since
1.0
- (AGSSpatialReference*) spatialReference
readnonatomicstronginherited

Geometry's spatial reference.

Since
1.0