MapTrip SDK Android Manual 9.9.7
Position Class Reference

Class to wrap x and y coordinates to positions. Independent of coordinate systems. First/x value is always the easting. Second/y value is always the northing. implements serializable and can be passed via intents.

+ Inheritance diagram for Position:

Public Member Functions

boolean equals (Object position)
 
double getLatitude ()
 
double getLongitude ()
 
double getXCoord ()
 
double getYCoord ()
 
int hashCode ()
 
boolean isValid ()
 
 Position ()
 
 Position (double x, double y)
 
void setXCoord (double x)
 
void setYCoord (double y)
 
double sphericalDistanceTo (final Position position)
 
String toString ()
 

Static Public Member Functions

static Position createWGS84Position (double latitude, double longitude)
 
static Position createWGS84Position (Location loc)
 

Constructor & Destructor Documentation

◆ Position() [1/2]

Position ( double  x,
double  y 
)

Creates a new position object. If you need to create a WGS84 position rather use

See also
createWGS84Position. It takes the position values in lat/long order.
Parameters
xeasting.
ynorthing.

◆ Position() [2/2]

Position ( )

Member Function Documentation

◆ createWGS84Position() [1/2]

static Position createWGS84Position ( double  latitude,
double  longitude 
)
static

The same as creating an object by the constructor but the naming helps to set the x and y valus as Latitude / Longitude correctly

Parameters
latitudeto create position with
longitudeto create position with
Returns
the wgs84 position

◆ createWGS84Position() [2/2]

static Position createWGS84Position ( Location  loc)
static

◆ equals()

boolean equals ( Object  position)

◆ getLatitude()

double getLatitude ( )

◆ getLongitude()

double getLongitude ( )

◆ getXCoord()

double getXCoord ( )

◆ getYCoord()

double getYCoord ( )

◆ hashCode()

int hashCode ( )

◆ isValid()

boolean isValid ( )

check if position is valid

◆ setXCoord()

void setXCoord ( double  x)

◆ setYCoord()

void setYCoord ( double  y)

◆ sphericalDistanceTo()

double sphericalDistanceTo ( final Position  position)

calculates the spherical position between this Position and an other Position in meters

Parameters
positionthe Position to calculate the distance to
Returns
the distance in meters

◆ toString()

String toString ( )

The documentation for this class was generated from the following file: