HERE Android SDK Developer's Guide

GeoCoordinate

The class GeoCoordinate is a member of com.here.android.mpa.common .

Class Summary

public final class GeoCoordinate

extends java.lang.Object

Represents a WGS84 coordinate with double precision.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in GeoCoordinate
Constructors

GeoCoordinate (double latitude, double longitude)

Creates a GeoCoordinate with specified latitude and longitude values.

GeoCoordinate (double latitude, double longitude, double altitude)

Creates a GeoCoordinate with specified latitude, longitude and altitude values.

GeoCoordinate (GeoCoordinate coordinate)

Creates a copy of an existing GeoCoordinate object.

Field Summary

Table 2. Fields in GeoCoordinate
Fields

public static final int UNKNOWN_ALTITUDE

Definition of an unknown altitude.

Method Summary

Table 3. Methods in GeoCoordinate
Methods

public double distanceTo (GeoCoordinate coord)

Calculates the distance (using the Haversine formula), as measured in meters, between this GeoCoordinate and the specified GeoCoordinate .

public boolean equals (Object other)

For documentation, see java.lang.Object

public double getAltitude ()

Gets the current altitude, as measured in meters above sea level, of the GeoCoordinate (z-axis on a map).

public double getHeading (GeoCoordinate coord)

Returns heading from this point to the given coordinate in degrees.

public double getLatitude ()

Gets the current latitude, as measured in degrees, of the GeoCoordinate .

public double getLongitude ()

Gets the current longitude, as measured in degrees, of the GeoCoordinate .

public int hashCode ()

public String toString ()

For documentation, see java.lang.Object

Class Details

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

Constructor Details

GeoCoordinate (double latitude, double longitude)

Creates a GeoCoordinate with specified latitude and longitude values.

Parameters:

  • latitude

    Initial latitude value, in degrees, between -90.0 and 90.0 inclusive.

  • longitude

    Initial longitude value, in degrees, greater than or equal to -180.0 and less than 180.0.

See also:

GeoCoordinate(double, double, double)

GeoCoordinate (double latitude, double longitude, double altitude)

Creates a GeoCoordinate with specified latitude, longitude and altitude values.

Parameters:

  • latitude

    Initial latitude value, in degrees, between -90.0 and 90.0 inclusive.

  • longitude

    Initial longitude value, in degrees, greater than or equal to -180.0 and less than 180.0.

  • altitude

    Initial altitude value, in meters, between -10000.0 and 10000.0 inclusive.

Throws:

  • IllegalArgumentException

    If the arguments constructs an invalid GeoCoordinate.

See also:

GeoCoordinate(double, double)

GeoCoordinate(GeoCoordinate)

GeoCoordinate (GeoCoordinate coordinate)

Creates a copy of an existing GeoCoordinate object.

Parameters:

  • coordinate

    A GeoCoordinate object used to initialize the new GeoCoordinate

See also:

GeoCoordinate(double, double, double)

GeoCoordinate(double, double)

Field Details

public static final int UNKNOWN_ALTITUDE

Definition of an unknown altitude.

Method Details

public double distanceTo (GeoCoordinate coord)

Calculates the distance (using the Haversine formula), as measured in meters, between this GeoCoordinate and the specified GeoCoordinate .

Parameters:

  • coord

    A second GeoCoordinate some distance away

Returns:

The distance between the coordinates

public boolean equals (Object other)

For documentation, see java.lang.Object

Parameters:

  • other

public double getAltitude ()

Gets the current altitude, as measured in meters above sea level, of the GeoCoordinate (z-axis on a map).

Returns:

The current altitude (returns 0.0 if the altitude is unavailable)

public double getHeading (GeoCoordinate coord)

Returns heading from this point to the given coordinate in degrees.

Parameters:

  • coord

    A second GeoCoordinate to which the heading is calculated

Returns:

Heading from this coordinate to the given coordinate, in degrees, from north increasing clockwise.

public double getLatitude ()

Gets the current latitude, as measured in degrees, of the GeoCoordinate . Latitude represents the north-south coordinate, or the y-axis on a map.

Returns:

The current latitude

public double getLongitude ()

Gets the current longitude, as measured in degrees, of the GeoCoordinate . Longitude represents the east-west coordinate, or the x-axis on a map.

Returns:

The current longitude

public int hashCode ()

public String toString ()

For documentation, see java.lang.Object

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.