[R-sig-Geo] spTransform error: Error in CRS(
Ken
katakagi at bu.edu
Thu Jan 1 20:55:54 CET 2015
Ken <katakagi <at> bu.edu> writes:
>
> Hi,
> I'm trying to use the CRS() function with spTransform() in the "sp" and
> "rgdal" package to reproject some spatial data using Rstudio in Ubuntu
> 14.10:
>
> library(sp)
> library(rgdal)
> somePolygons <- readOGR(file.path(fp), "someShapefile")
> somePolygons_reproj <- spTransform(somePolygons, CRS("+init=EPSG:26920"))
>
> the function readOGR() works fine, but I get the following error when I
> try and run spTransform():
> Error in spTransform(WBDHU12, CRS("+init=EPSG:4269")) :
> error in evaluating the argument 'CRSobj' in selecting a method for
> function 'spTransform': Error in CRS("+init=EPSG:4269") : no system
> list, errno: 2
>
Just realized that capitalizing "EPSG" was the reason that I was getting
the error:
somePolygons_reproj <- spTransform(somePolygons, CRS("+init=epsg:26920"))
works fine.
More information about the R-sig-Geo
mailing list