org.netxms.client
Class GeoLocation

java.lang.Object
  extended by org.netxms.client.GeoLocation

public class GeoLocation
extends java.lang.Object

Geolocation encoding


Field Summary
static int GPS
           
static int MANUAL
           
static int UNSET
           
 
Constructor Summary
GeoLocation(boolean isGPS)
          Create geolocation object of type UNSET or GPS
GeoLocation(double lat, double lon)
          Create geolocation object of type MANUAL
GeoLocation(NXCPMessage msg)
          Create geolocation object from NXCP message
 
Method Summary
 double getLatitude()
           
 java.lang.String getLatitudeAsString()
           
 double getLongitude()
           
 java.lang.String getLongitudeAsString()
           
 int getType()
           
static java.lang.String latitudeToString(double lat)
          Convert latitude from floating point to text representation
static java.lang.String longitudeToString(double lon)
          Convert longitude from floating point to text representation
static GeoLocation parseGeoLocation(java.lang.String lat, java.lang.String lon)
          Parse geolocation string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSET

public static final int UNSET
See Also:
Constant Field Values

MANUAL

public static final int MANUAL
See Also:
Constant Field Values

GPS

public static final int GPS
See Also:
Constant Field Values
Constructor Detail

GeoLocation

public GeoLocation(NXCPMessage msg)
Create geolocation object from NXCP message

Parameters:
msg - NXCP message

GeoLocation

public GeoLocation(boolean isGPS)
Create geolocation object of type UNSET or GPS


GeoLocation

public GeoLocation(double lat,
                   double lon)
Create geolocation object of type MANUAL

Parameters:
lat - Latitude
lon - Longitude
Method Detail

getType

public int getType()
Returns:
the type

getLatitude

public double getLatitude()
Returns:
the latitude

getLongitude

public double getLongitude()
Returns:
the longitude

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

latitudeToString

public static java.lang.String latitudeToString(double lat)
Convert latitude from floating point to text representation

Parameters:
lat - latitude
Returns:
text representation of given latitude

longitudeToString

public static java.lang.String longitudeToString(double lon)
Convert longitude from floating point to text representation

Parameters:
lon - longitude
Returns:
text representation of given longitude

getLatitudeAsString

public java.lang.String getLatitudeAsString()
Returns:
latitude as DMS string

getLongitudeAsString

public java.lang.String getLongitudeAsString()
Returns:
longitude as DMS string

parseGeoLocation

public static GeoLocation parseGeoLocation(java.lang.String lat,
                                           java.lang.String lon)
                                    throws GeoLocationFormatException
Parse geolocation string. Latitude and longitude must be given either as numeric values or in DMS form.

Parameters:
lat - latitude string
lon - longitude string
Returns:
geolocation object
Throws:
GeoLocationFormatException - if the strings does not contain a parsable geolocation


Copyright © 2012. All Rights Reserved.