Convert WKT coordinate reference system to PROJ4
Use the rgdal
package and showP4
:
Your string:
> ps
[1] "COMPD_CS[\"Projected\", PROJCS[\"UTM_10N\", GEOGCS [ \"WGS84\", DATUM [ \"WGS84\", SPHEROID [\"WGS 84\", 6378137.000, 298.257223563 ], TOWGS84 [ 0.000, 0.000, 0.000, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000 ] ], PRIMEM [ \"Greenwich\", 0.000000 ], UNIT [ \"metres\", 1.00000000] ], PROJECTION[\"Transverse_Mercator\"], PARAMETER[\"Latitude_of_Origin\",0.0000000000], PARAMETER[\"Central_Meridian\",-123.0000000000], PARAMETER[\"Scale_Factor\",0.9996000000], PARAMETER[\"False_Easting\",500000.000], PARAMETER[\"False_Northing\",0.000], UNIT [ \"metres\", 1.00000000]] ], VERT_CS[\"NAVD88 (Geoid03) ContUS\", VERT_DATUM[\"./Resources/CoordSysData/navd88_geo03_contus.bin\", 1 ], UNIT [ \"metres\", 1.00000000] ] ]"
Your string as a Proj4 string:
> showP4(ps)
[1] "+proj=tmerc +lat_0=0 +lon_0=-7047.380880109124 +k=0.9996 +x_0=500000 +y_0=0 +ellps=WGS84 +towgs84=0.000,0.000,0.000,0.0000000000,0.0000000000,0.0000000000,0.0000000000 +units=m +no_defs "
Or using the sf
package with st_crs
and the wkt=
parameter:
> st_crs(wkt=ps)
Coordinate Reference System:
No EPSG code
proj4string: "+proj=tmerc +lat_0=0 +lon_0=-7047.380880109124 +k=0.9996 +x_0=500000 +y_0=0 +ellps=WGS84 +towgs84=0.000,0.000,0.000,0.0000000000,0.0000000000,0.0000000000,0.0000000000 +units=m +no_defs"
Note I'm not convinced every parameter is always handled or converted properly... Caveat emptor.