GPS2UTM {utilitiesR} | R Documentation |
converts GPS coordinates to UTM coordinates
GPS2UTM(gps, using = c("proj", "rgdal"), inverse = FALSE, zone = 56, hemisphere = c("south", "north"))
gps |
a nx2 matrix with LON then LAT |
using |
one of 'proj' or 'rgdal': use proj executable (must be in $PATH) or rgdal package |
inverse |
whether to invert (ie UTM2GPS), default FALSE (i.e. GPS -> UTM) |
zone |
the zone for conversion. If doing GPS to UTM conversion, this will be calculated using the mean longitude. |
hemisphere |
hemisphere for conversion. If doing GPS to UTM conversion, this will be calculated using the latitude. |
You need either package 'rgdal' [need libgdal1-dev in ubuntu and libproj-dev] OR 'proj' in your path [proj-bin in ubuntu].
If doing conversion from UTM to GPS, it is *very important* to know the zone and the hemisphere, as an easting/northing pair can be valid in both hemispheres, and/or multiple zones.
If doing conversion from GPS to UTM, it's not as improtant to know the zone/hemisphere, as the hemisphere can be told from the latitude.
The zone can be calculated as (wikipedia):
The UTM system divides the surface of the Earth ... into 60 zones, each of 6 degrees of longitude in width. Zone 1 covers longitude 180 to 174 degrees W; zone numbering increases eastward to zone 60 that covers longitude 174 to 180 E.
a nx2 matrix with utm EASTING then utm NORTHING (x,y)
Other coordinates: formatGPS
,
UTM2GPS