Package org.opensextant.data
Class GeoBase
java.lang.Object
org.opensextant.data.GeoBase
- All Implemented Interfaces:
LatLon
- Direct Known Subclasses:
Place
An intermediary between the simple LatLon and other conceptual classes:
Place, Country, etc.
- Author:
- Marc C. Ubaldino, MITRE, ubaldino at mitre dot org
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()
double
double
getName()
boolean
Convenience method for checking if lat/lon was set to other than 0,0 (default)void
setGeohash
(String gh) Set and get Geohash -- this is delegated to caller as core processing need not have a geohash generated when lat/lon is set.void
legacy nomenclature.void
setLatitude
(double lat) void
Convenience methodvoid
setLongitude
(double lon) final void
toString()
Generic label -- anything more sophisticated needs attention E.g.
-
Field Details
-
key
identifier ID -
name
any name associated with this place -
latitude
protected double latitude -
longitude
protected double longitude
-
-
Constructor Details
-
GeoBase
public GeoBase()Creates an empty GeoBase location object -
GeoBase
Creates a new instance of GeoBase- Parameters:
placeId
- place Idnm
- place name
-
GeoBase
public GeoBase(double lat, double lon)
-
-
Method Details
-
getKey
- Returns:
- place id
-
setKey
legacy nomenclature. Place ID is better.- Parameters:
k
- place Id
-
setName
- Parameters:
nm
- name for this location
-
getName
- Returns:
- name of location
-
getNamenorm
-
toString
Generic label -- anything more sophisticated needs attention E.g. to use Key + Name or just Key for a label would be very specific -
getLatitude
public double getLatitude()- Specified by:
getLatitude
in interfaceLatLon
- Returns:
- lat in degrees
-
setLatitude
public void setLatitude(double lat) - Specified by:
setLatitude
in interfaceLatLon
- Parameters:
lat
- in degrees
-
getLongitude
public double getLongitude()- Specified by:
getLongitude
in interfaceLatLon
- Returns:
- longitude in degrees
-
setLongitude
public void setLongitude(double lon) - Specified by:
setLongitude
in interfaceLatLon
- Parameters:
lon
- in degrees
-
setGeohash
Set and get Geohash -- this is delegated to caller as core processing need not have a geohash generated when lat/lon is set.- Parameters:
gh
- geohash
-
getGeohash
- Returns:
- geohash
-
setLatLon
Convenience method- Parameters:
geo
- lat/lon pair
-
hasCoordinate
public boolean hasCoordinate()Convenience method for checking if lat/lon was set to other than 0,0 (default)- Returns:
- true if instance has non-zero coordinates.
-