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

Description

Instances of this class represent a point. The point is defined by a pair of x and y coordinates, and an optional spatial reference.

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

Defined in:
AGSPoint.h ( ArcGIS library)

Since
1.0
See also
AGSMutablePoint for a mutable version.
Inheritance diagram for AGSPoint:
AGSGeometry <AGSCoding> AGSMutablePoint

Instance Methods

(NSString *) - decimalDegreesStringWithNumDigits:
 
(void) - decodeWithJSON:
 
(NSString *) - degreesDecimalMinutesStringWithNumDigits:
 
(NSString *) - degreesMinutesSecondsStringWithNumDigits:
 
(double) - distanceToPoint:
 
(NSDictionary *) - encodeToJSON
 
(NSString *) - GARSString
 
(NSString *) - GEOREFStringWithNumDigits:rounding:
 
(id) - initWithJSON:
 
(id) - initWithJSON:spatialReference:
 
(id) - initWithSpatialReference:
 
(id) - initWithX:y:spatialReference:
 
(BOOL) - intersectsWithEnvelope:
 
(BOOL) - isEmpty
 
(BOOL) - isEqualToPoint:
 
(BOOL) - isValid
 
(NSString *) - MGRSStringWithNumDigits:rounding:addSpaces:
 
(NSString *) - USNGStringWithNumDigits:rounding:addSpaces:
 
(NSString *) - UTMStringWithConversionMode:addSpaces:
 

Class Methods

(AGSPoint *) + pointFromDecimalDegreesString:withSpatialReference:
 
(AGSPoint *) + pointFromDegreesDecimalMinutesString:withSpatialReference:
 
(AGSPoint *) + pointFromDegreesMinutesSecondsString:withSpatialReference:
 
(AGSPoint *) + pointFromGARSString:withSpatialReference:conversionMode:
 
(AGSPoint *) + pointFromGEOREFString:withSpatialReference:
 
(AGSPoint *) + pointFromMGRSString:withSpatialReference:
 
(AGSPoint *) + pointFromUSNGString:withSpatialReference:
 
(AGSPoint *) + pointFromUTMString:withSpatialReference:conversionMode:
 
(instancetype) + pointWithLocation:
 
(instancetype) + pointWithX:y:spatialReference:
 

Properties

AGSEnvelopeenvelope
 
AGSSpatialReferencespatialReference
 
double x
 
double y
 

Method Documentation

- (NSString*) decimalDegreesStringWithNumDigits: (NSInteger)  numDigits

Returns a string with Decimal Degrees (DD) format for the current point.

Parameters
numDigitsThe number of digits to be included in the output string
Returns
The DD string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (void) decodeWithJSON: (NSDictionary *)  json
optionalinherited

Decode object from JSON representation.

Parameters
jsonThe JSON representation of the object to be decoded.
Since
1.0
- (NSString*) degreesDecimalMinutesStringWithNumDigits: (NSInteger)  numDigits

Returns a string with degrees decimal minute (DDM) format for the current point.

Parameters
numDigitsThe number of digits to be included in the output string
Returns
The DDM string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (NSString*) degreesMinutesSecondsStringWithNumDigits: (NSInteger)  numDigits

Returns a string with degrees minutes seconds (DMS) for the current point.

Parameters
numDigitsThe number of digits to be included in the output string
Returns
The DMS string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (double) distanceToPoint: (AGSPoint *)  other

Calculates the distance between this point and another point.

Parameters
otherThe other point to get the distance to.
Returns
The distance between the points, in the units of the spatial reference of the points.
- (NSDictionary *) encodeToJSON
optionalinherited

Encode and return JSON representation for object.

Returns
JSON representation of object.
Since
1.0
- (NSString*) GARSString

Returns a string with Global Area Reference System (GARS) format for the current point.

Returns
The GARS string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (NSString*) GEOREFStringWithNumDigits: (NSInteger)  numDigits
rounding: (BOOL)  rounding 

Returns a string with World Geographic Reference system (GEOREF) format for the current point.

Parameters
numDigitsThe number of digits to be included in the output string
roundingWhether the numeric value should be rounded
Returns
The GEOREF string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (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
- (id) initWithX: (double)  x
y: (double)  y
spatialReference: (AGSSpatialReference *)  spatialReference 

Initialize a new point geometry.

Parameters
xThe x coordinate in map units.
yThe y coordinate in map units.
spatialReferenceThe coordinates' spatial reference.
Returns
A new point 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) isEqualToPoint: (AGSPoint *)  other

Returns whether or not the other point is equal to this point.

Parameters
otherThe other point to compare.
Returns
Whether or not the two points are equal.
Since
1.8
- (BOOL) isValid

Returns whether or not the geometry is valid.

Since
1.8
- (NSString*) MGRSStringWithNumDigits: (NSInteger)  numDigits
rounding: (BOOL)  rounding
addSpaces: (BOOL)  addSpaces 

Returns a Military Grid Reference System (MGRS) coordinate for the current point. For example : 4Q 612341 2356781

Parameters
numDigitsThe number of digits to be included in the MGRS coordinate
roundingWhether the numeric value should be rounded
addSpacesWhether the MGRS coordinate string should include spaces
Returns
The MGRS coordinate string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromDecimalDegreesString: (NSString *)  decimalDegrees
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given a coordinate notation string in the Decimal Degrees (DD) format, for eg "34.0547 N, 117.1825 W".

Parameters
decimalDegressThe coordinate string.
outputSRThe spatial reference of the point to be returned.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromDegreesDecimalMinutesString: (NSString *)  ddm
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given coordinate notation string in the Degrees Decimal Minutes (DDM) format, for eg "7 5.123 N 94 17.765 E".

Parameters
ddmThe coordinate string.
outputSRThe spatial reference of the point to be returned.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromDegreesMinutesSecondsString: (NSString *)  degreesMinutesSeconds
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given coordinate notation string in the Degrees Minutes Seconds (DMS) format, for eg "34 2 2.8 N, 117 53 24.66 E"

Parameters
degreesMinutesSecondsThe coordinate string.
outputSRThe spatial reference of the point to be returned.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromGARSString: (NSString *)  gars
withSpatialReference: (AGSSpatialReference *)  outputSR
conversionMode: (AGSGARSConversionMode conversionMode 

Returns a point for a given coordinate notation string in the Global Area Reference System (GARS) format, for eg "421LA37".

Parameters
garsThe coordinate string.
outputSRThe spatial reference of the point to be returned.
conversionModeA value determining whether the returned map point will represent the lower left or center of the cell, quadrant or area.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromGEOREFString: (NSString *)  georef
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given coordinate notation string in the Geographic Reference system (GEOREF) format, for eg "QJAA0000000000".

Parameters
georefThe coordinate string.
outputSRThe spatial reference of the point to be returned.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromMGRSString: (NSString *)  mgrs
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given MGRS coordinate string, for eg "36RTJ1059034722575904" or "4Q 612341 2356781"

Parameters
mgrsThe coordinate string. Can contain spaces.
outputSRThe spatial reference of the point to be returned.
Returns
A point from the MGRS coordinate
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromUSNGString: (NSString *)  usng
withSpatialReference: (AGSSpatialReference *)  outputSR 

Returns a point for a given coordinate notation string in the United States National Grid (USNG) format, for eg "32Q PH 04609324 11793556".

Parameters
usngThe coordinate string.
outputSRThe spatial reference of the point to be returned.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (AGSPoint*) pointFromUTMString: (NSString *)  utm
withSpatialReference: (AGSSpatialReference *)  outputSR
conversionMode: (AGSUTMConversionMode conversionMode 

Returns a point for a given coordinate notation string in the Universal Transverse Mercator (UTM) format, for eg "31N1660210000000".

Parameters
utmThe coordinate string.
outputSRThe spatial reference of the point to be returned.
conversionModeA value indicating whether the coordinate string contains North or South Hemisphere indicators.
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

+ (instancetype) pointWithLocation: (CLLocation *)  location

Initialize a new autoreleased point geometry.

Parameters
locationThe CLLocation to create a point from.
Returns
A new, autoreleased, point geometry object.
Since
10.2
+ (instancetype) pointWithX: (double)  x
y: (double)  y
spatialReference: (AGSSpatialReference *)  spatialReference 

Initialize a new autoreleased point geometry.

Parameters
xThe x coordinate in map units.
yThe y coordinate in map units.
spatialReferenceThe coordinates' spatial reference.
Returns
A new, autoreleased, point geometry object.
Since
1.0
- (NSString*) USNGStringWithNumDigits: (NSInteger)  numDigits
rounding: (BOOL)  rounding
addSpaces: (BOOL)  addSpaces 

Returns a string with United States National Grid (USNG) format for the current point.

Parameters
numDigitsThe number of digits to be included in the output string
roundingWhether the numeric value should be rounded
addSpacesWhether the coordinate string should include spaces
Returns
The USNG string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

- (NSString*) UTMStringWithConversionMode: (AGSUTMConversionMode conversionMode
addSpaces: (BOOL)  addSpaces 

Returns a string with Universal Transverse Mercator (UTM) format for the current point.

Parameters
conversionModeThe mode to use during conversion
addSpacesWhether the coordinate string should include spaces
Returns
the UTM string
Since
10.2

Provided by category AGSPoint(CoordinateConversion).

Property Documentation

- (AGSEnvelope*) envelope
readnonatomiccopyinherited

Smallest, rectangular bounding-box that covers the geometry.

Since
1.0
- (AGSSpatialReference*) spatialReference
readnonatomicstronginherited

Geometry's spatial reference.

Since
1.0
- (double) x
readnonatomicassign

X coordinate for point in map units.

Since
1.0
- (double) y
readnonatomicassign

Y coordinate for point in map units.

Since
1.0