inv_project {gdalraster} | R Documentation |
Inverse project geospatial x/y coordinates to longitude/latitude
Description
inv_project()
transforms geospatial x/y coordinates to
longitude/latitude in the same geographic coordinate system used by the
given projected spatial reference system. The output long/lat can
optionally be set to a specific geographic coordinate system by specifying
a well known name (see Details).
Usage
inv_project(pts, srs, well_known_gcs = "")
Arguments
pts |
A two-column data frame or numeric matrix containing geospatial x/y coordinates. |
srs |
Character string in OGC WKT format specifying the projected
spatial reference system for |
well_known_gcs |
Optional character string containing a supported well known name of a geographic coordinate system (see Details for supported values). |
Details
By default, the geographic coordinate system of the projection specified
by srs
will be used. If a specific geographic coordinate system is
desired, then well_known_gcs
can be set to one of the values below:
EPSG:n | where n is the code of a geographic coordinate system |
WGS84 | same as EPSG:4326 |
WGS72 | same as EPSG:4322 |
NAD83 | same as EPSG:4269 |
NAD27 | same as EPSG:4267 |
CRS84 | same as WGS84 |
CRS72 | same as WGS72 |
CRS27 | same as NAD27 |
The returned array will always be in longitude, latitude order (traditional GIS order) regardless of the axis order defined for the names above.
Value
Numeric array of longitude, latitude. An error is raised if the transformation cannot be performed.
See Also
Examples
pt_file <- system.file("extdata/storml_pts.csv", package="gdalraster")
## id, x, y in NAD83 / UTM zone 12N
pts <- read.csv(pt_file)
print(pts)
inv_project(pts[,-1], epsg_to_wkt(26912))
inv_project(pts[,-1], epsg_to_wkt(26912), "NAD27")