Utility class to convert GPS coordinates into a local coordinate frame and vice-versa.
The local coordinate frame uses metric coordinates (in meters) with x-axis pointing eastward, and y-axis pointing northward, from a specified GPS origin location.
GPS coordinates may be specified as decimal degrees, degrees and decimal minutes, or degrees, minutes and decimal seconds. When providing double[] to specify GPS coordinates, length 2 arrays are assumed to be latitude, longitude in decimal degrees, length 4 arrays are assumed to be latitude, longitude in degrees and decimal minutes, and length 6 arrays are assumed to be latitude, longitude in degrees, minutes and decimal seconds.
The local coordinate system positions are represented as double[] of length 2 with x, y coordinates (in meters) in that order.
Constructor and description |
---|
GpsLocalFrame
(double[] latlong0) Creates a local coordinate frame with specified GPS coordinates. |
GpsLocalFrame
(double lat0, double long0) Creates a local coordinate frame with specified GPS coordinates. |
GpsLocalFrame
(double lat0d, double lat0m, double long0d, double long0m) Creates a local coordinate frame with specified GPS coordinates. |
GpsLocalFrame
(double lat0d, double lat0m, double lat0s, double long0d, double long0m, double long0s) Creates a local coordinate frame with specified GPS coordinates. |
Type Params | Return Type | Name and description |
---|---|---|
|
double[] |
toGps(double[] xy) Converts from local coordinates to GPS (decimal degrees). |
|
double[] |
toGps(double x, double y) Converts from local coordinates to GPS (decimal degrees). |
|
double[] |
toGpsDM(double[] xy) Converts from local coordinates to GPS (degrees, minutes). |
|
double[] |
toGpsDM(double x, double y) Converts from local coordinates to GPS (degrees, minutes). |
|
double[] |
toGpsDMS(double[] xy) Converts from local coordinates to GPS (degrees, minutes, seconds). |
|
double[] |
toGpsDMS(double x, double y) Converts from local coordinates to GPS (degrees, minutes, seconds). |
|
double[] |
toLocal(double[] latlong) Converts from GPS to local coordinates. |
|
double[] |
toLocal(double latd, double longd) Converts from GPS to local coordinates. |
|
double[] |
toLocal(double latd, double latm, double longd, double longm) Converts from GPS to local coordinates. |
|
double[] |
toLocal(double latd, double latm, double lats, double longd, double longm, double longs) Converts from GPS to local coordinates. |
Creates a local coordinate frame with specified GPS coordinates.
latlong0
- GPS coordinates of originCreates a local coordinate frame with specified GPS coordinates.
lat0
- GPS latitude of originlong0
- GPS longitude of originCreates a local coordinate frame with specified GPS coordinates.
lat0d
- GPS latitude of origin (degrees)lat0m
- GPS latitude of origin (minutes)long0d
- GPS longitude of origin (degrees)long0m
- GPS longitude of origin (minutes)Creates a local coordinate frame with specified GPS coordinates.
lat0d
- GPS latitude of origin (degrees)lat0m
- GPS latitude of origin (minutes)lat0s
- GPS latitude of origin (seconds)long0d
- GPS longitude of origin (degrees)long0m
- GPS longitude of origin (minutes)long0s
- GPS longitude of origin (seconds)Converts from local coordinates to GPS (decimal degrees).
xy
- x,y in local coordinatesConverts from local coordinates to GPS (decimal degrees).
x
- local x coordinatey
- local y coordinateConverts from local coordinates to GPS (degrees, minutes).
xy
- x,y in local coordinatesConverts from local coordinates to GPS (degrees, minutes).
x
- local x coordinatey
- local y coordinateConverts from local coordinates to GPS (degrees, minutes, seconds).
xy
- x,y in local coordinatesConverts from local coordinates to GPS (degrees, minutes, seconds).
x
- local x coordinatey
- local y coordinateConverts from GPS to local coordinates.
latlong
- GPS coordinatesConverts from GPS to local coordinates.
latd
- GPS latitude (decimal degrees)longd
- GPS longitude (decimal degrees)Converts from GPS to local coordinates.
latd
- GPS latitude (degrees)latm
- GPS latitude (minutes)longd
- GPS longitude (degrees)longm
- GPS longitude (minutes)Converts from GPS to local coordinates.
latd
- GPS latitude (degrees)latm
- GPS latitude (minutes)lats
- GPS latitude (seconds)longd
- GPS longitude (degrees)longm
- GPS longitude (minutes)longs
- GPS longitude (seconds)Copyright 2013-21, Acoustic Research Laboratory, National University of Singapore, and Subnero Pte Ltd