HERE iOS SDK Developer's Guide

NMAGeoCoordinates

Class Summary

class NMAGeoCoordinates

Derived from: NSObject

Represents WGS84 coordinates with double precision.

Include: NMAKit.framework/headers/NMAGeoCoordinates.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAGeoCoordinates

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] float  altitude

The altitude of the NMAGeoCoordinates measured in meters above sea-level.

[readable, writable, assign] double  latitude

The latitude, as measured in degrees, representing north-south coordinate (y-axis on a map)

[readable, writable, assign] double  longitude

The longitude, as measured in degrees, representing east-west coordinate (x-axis on a map)

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(double) distanceTo:(to:distance)

Calculates (using the Haversine formula) the distance in meters between this NMAGeoCoordinates instance and the specified NMAGeoCoordinates

-(double) headingTo:(to:heading)

Calculates the heading in degrees from this NMAGeoCoordinates instance to the specified NMAGeoCoordinates instance

-(instancetype) initWithLatitude:(double) latitude longitude:(double) longitude

Initializes a NMAGeoCoordinates instance with specified latitude and longitude values and zero altitude

-(instancetype) initWithLatitude:(double) latitude longitude:(double) longitude altitude:(double) altitude

Initializes a NMAGeoCoordinates instance with specified values for the initial latitude, longitude and altitude

-(BOOL) isEqualToGeoCoordinates:(_:equals)

Determines whether this NMAGeoCoordinates is equal to another

Class Method Summary

Table 3. Class Methods
Class Methods

+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:(double) longitude

Constructs a NMAGeoCoordinates with the specified latitude and longitude

+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:(double) longitude altitude:(double) altitude

Constructs a NMAGeoCoordinates with the specified latitude, longitude, and altitude

Class Details

Represents WGS84 coordinates with double precision. A NMAGeoCoordinates encapsulates a latitude and longitude value, plus an optional altitude value.

Note:

Although NMAGeoCoordinates are accepted and handled with double precision (about 15 significant digits), the real precision of rendering operations such as NMAMapView::setCenterAt might be lower due to internal conversions. Overall precision of NMAGeoCoordinates can be assured for only six digits following the decimal point.

Public Property Details

[readable, writable, assign] float altitude

The altitude of the NMAGeoCoordinates measured in meters above sea-level.

By default, the plane of the map is at 0 meters. Thus, geocoordinates with positive altitudes represent points above the plane of the map, while negative altitudes are below the plane of the map.

Note:

Valid values are in the range [-10000.0, 10000.0]. If an invalid value is specified, it will be adjusted to the closest possible valid value (e.g. a specified value of -10200.0 will be set to -10000.0).

[readable, writable, assign] double latitude

The latitude, as measured in degrees, representing north-south coordinate (y-axis on a map).

Note:

The latitude must be in the range [-90, 90]. Values outside this range will be clamped.

[readable, writable, assign] double longitude

The longitude, as measured in degrees, representing east-west coordinate (x-axis on a map).

Note:

The longitude must be in the range [-180, 180]. Values outside this range will be wrapped. For example, a value of 200 degrees will be wrapped to -160.

Instance Method Details

-(double) distanceTo:(to:distance)

Calculates (using the Haversine formula) the distance in meters between this NMAGeoCoordinates instance and the specified NMAGeoCoordinates.

Parameters:

  • coordinates

    A second NMAGeoCoordinates some distance away

Returns:

The distance between the NMAGeoCoordinates, or -DBL_MAX if the coordinates parameter is nil

-(double) headingTo:(to:heading)

Calculates the heading in degrees from this NMAGeoCoordinates instance to the specified NMAGeoCoordinates instance.

Parameters:

Returns:

Heading from this coordinate to the given coordinate, in degrees. 0 = north, increasing clockwise. If coordinates is nil or invalid a negative result will be returned to indicate an error.

-(instancetype) initWithLatitude:(double) latitude longitude:(double) longitude

Initializes a NMAGeoCoordinates instance with specified latitude and longitude values and zero altitude.

Parameters:

  • latitude

    An initial latitude value. Values outside of [-90, 90] will be clamped to that range (100 becomes 90).

  • longitude

    An initial longitude value. Values outside of [-180, 180] will be wrapped to that range (200 becomes -160).

Returns:

The NMAGeoCoordinates instance, or nil if initialization failed

-(instancetype) initWithLatitude:(double) latitude longitude:(double) longitude altitude:(double) altitude

Initializes a NMAGeoCoordinates instance with specified values for the initial latitude, longitude and altitude.

Parameters:

  • latitude

    An initial latitude value

  • longitude

    An initial longitude value

  • altitude

    An initial altitude value

Returns:

The NMAGeoCoordinates instance, or nil if initialization failed

-(BOOL) isEqualToGeoCoordinates:(_:equals)

Determines whether this NMAGeoCoordinates is equal to another.

Returns:

YES if the coordinates are equal, NO otherwise

Class Method Details

+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:(double) longitude

Constructs a NMAGeoCoordinates with the specified latitude and longitude.

Parameters:

  • latitude

    An initial latitude value

  • longitude

    An initial longitude value

+(instancetype) geoCoordinatesWithLatitude:(double) latitude longitude:(double) longitude altitude:(double) altitude

Constructs a NMAGeoCoordinates with the specified latitude, longitude, and altitude.

Parameters:

  • latitude

    An initial latitude value

  • longitude

    An initial longitude value

  • altitude

    An initial altitude value