public class GeoLocation extends Object
Modifier and Type | Field and Description |
---|---|
static int |
GPS |
static int |
MANUAL |
static int |
NETWORK |
static int |
UNSET |
Constructor and Description |
---|
GeoLocation(boolean isGPS)
Create geolocation object of type UNSET or GPS
|
GeoLocation(double lat,
double lon)
Create geolocation object of type MANUAL
|
GeoLocation(double lat,
double lon,
int type,
int accuracy,
Date timestamp)
Create geolocation object of given type, accuracy, and timestamp
|
GeoLocation(NXCPMessage msg)
Create geolocation object from NXCP message
|
Modifier and Type | Method and Description |
---|---|
int |
getAccuracy() |
double |
getLatitude() |
String |
getLatitudeAsString() |
double |
getLongitude() |
String |
getLongitudeAsString() |
Date |
getTimestamp()
Get location's time stamp.
|
int |
getType() |
static String |
latitudeToString(double lat)
Convert latitude from floating point to text representation
|
static String |
longitudeToString(double lon)
Convert longitude from floating point to text representation
|
static GeoLocation |
parseGeoLocation(String lat,
String lon)
Parse geolocation string.
|
String |
toString() |
public static final int UNSET
public static final int MANUAL
public static final int GPS
public static final int NETWORK
public GeoLocation(NXCPMessage msg)
msg
- NXCP messagepublic GeoLocation(boolean isGPS)
public GeoLocation(double lat, double lon)
lat
- Latitudelon
- Longitudepublic GeoLocation(double lat, double lon, int type, int accuracy, Date timestamp)
lat
- Latitudelon
- Longitudepublic int getType()
public double getLatitude()
public double getLongitude()
public int getAccuracy()
public final Date getTimestamp()
public static String latitudeToString(double lat)
lat
- latitudepublic static String longitudeToString(double lon)
lon
- longitudepublic String getLatitudeAsString()
public String getLongitudeAsString()
public static GeoLocation parseGeoLocation(String lat, String lon) throws GeoLocationFormatException
lat
- latitude stringlon
- longitude stringGeoLocationFormatException
- if the strings does not contain a parsable geolocationCopyright © 2014. All rights reserved.