HERE iOS SDK Developer's Guide

NMAGeoCoordinates

Class Summary

class NMAGeoCoordinates

Derived from: NSObject, <NSCoding>

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:( NMAGeoCoordinates *) coordinates

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

-(double) headingTo:( NMAGeoCoordinates *) coordinates

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

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

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

-(id) initWithLatitude:(double) latitude longitude:(double) longitude altitude:(float) altitude

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

-(BOOL) isEqualToGeoCoordinates:( NMAGeoCoordinates *) coordinates

Determines whether this NMAGeoCoordinates is equal to another

Class Method Summary

Table 3. Class Methods
Class Methods

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

Constructs a NMAGeoCoordinates with the specified latitude and longitude

+(id) 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. Map objects with these coordinates will be displayed accordingly.

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).

Note:

NMAGeoCoordinatesUnknownAltitudeValue if altitude is unknown.

[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:( NMAGeoCoordinates *) coordinates

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 NMAGeoCoordinatesInvalidValue if the coordinates parameter is nil

-(double) headingTo:( NMAGeoCoordinates *) coordinates

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, NMAGeoCoordinatesInvalidValue will be returned to indicate an error.

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

Initializes a NMAGeoCoordinates instance with specified latitude and longitude values and NMAGeoCoordinatesUnknownAltitudeValue 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

-(id) initWithLatitude:(double) latitude longitude:(double) longitude altitude:(float) 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:( NMAGeoCoordinates *) coordinates

Determines whether this NMAGeoCoordinates is equal to another.

Returns:

YES if the coordinates are equal, NO otherwise

Class Method Details

+(id) 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

+(id) 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

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.