class DecimalDegrees extends java.lang.Object
A DecimalDegrees class that can parse and format DD, DMS, and DDM.
def dd = new DecimalDegrees(-122.525619, 47.212023) println dd.dms.longitude.degress -122 println dd.dms.longitude.minutes 31 println dd.dms.longitude.seconds 32.22839
Constructor and description |
---|
DecimalDegrees
(double longitude, double latitude) Create a new DecimalDegrees from a longitude and latitude |
DecimalDegrees
(java.awt.Point point) Create a new DecimalDegrees from a Point (which should be in EPSG:4326) |
DecimalDegrees
(java.lang.String longitude, java.lang.String latitude) Create a new DecimalDegrees from separate longitude and latitude strings |
DecimalDegrees
(java.lang.String str) Create a new DecimalDegrees from a string |
Type Params | Return Type | Name and description |
---|---|---|
|
Map |
getDdm() Get the DecimalDegrees longitude and latitude in decimal degree minutes (DDM). |
|
Map |
getDms() Get the DecimalDegrees longitude and latitude in degrees, minutes, seconds (DMS). |
|
java.awt.Point |
getPoint() Get the DecimalDegrees as a Point |
|
java.lang.String |
toDdm(boolean useGlyphs) Convert the DecimalDegrees to a DDM string |
|
java.lang.String |
toDms(boolean useGlyphs) Convert the DecimalDegrees to a DMS string |
|
java.lang.String |
toString() The string representation |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a new DecimalDegrees from a longitude and latitude
longitude
- The longitudelatitude
- The latitudeCreate a new DecimalDegrees from a Point (which should be in EPSG:4326)
point
- The PointCreate a new DecimalDegrees from separate longitude and latitude strings
longitude
- The longitude stringlatitude
- The latitude stringCreate a new DecimalDegrees from a string
str
- The stringGet the DecimalDegrees longitude and latitude in decimal degree minutes (DDM).
Get the DecimalDegrees longitude and latitude in degrees, minutes, seconds (DMS).
Get the DecimalDegrees as a Point
Convert the DecimalDegrees to a DDM string
useGlyphs
- Whether to use glyphs (true, default) or characters (false)Convert the DecimalDegrees to a DMS string
useGlyphs
- Whether to use glyphs (true, default) or characters (false)The string representation
Groovy Documentation