[R-sig-Geo] spTransform error: Error in CRS("+init=EPSG:26920") : no system list, errno: 2

Ken katakagi at bu.edu
Thu Jan 1 19:25:40 CET 2015


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

It may be that rgdal can't locate the epsg file (in usr/share/proj?)  
I've removed and re-installed rgdal, which seems to install fine.  here 
is the output:

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.9-1
checking for /usr/bin/svnversion... no
configure: svn revision: 518
configure: gdal-config: gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.10.1
checking GDAL version >= 1.6.3... yes
checking GDAL version < 2... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/1.10/pcs.csv readable... yes
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
checking for pj_init_plus in -lproj... yes
configure: PROJ.4 version: 4.8.0
checking PROJ.4: epsg found and readable... yes
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags:  -I/usr/include/gdal
configure: Package LIBS:  -L/usr/lib -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c OGR_write.cpp -o 
OGR_write.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c gdal-bindings.cpp -o 
gdal-bindings.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c local_stubs.c -o 
local_stubs.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ogr_geom.cpp -o 
ogr_geom.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ogr_polygons.c -o 
ogr_polygons.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ogr_proj.cpp -o 
ogr_proj.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ogrdrivers.cpp -o 
ogrdrivers.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ogrsource.cpp -o 
ogrsource.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal 
-I"/home/ken/R/x86_64-pc-linux-gnu-library/3.1/sp/include"   -fpic -g 
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c projectit.cpp -o 
projectit.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o 
rgdal.so OGR_write.o gdal-bindings.o init.o local_stubs.o ogr_geom.o 
ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o 
-L/usr/lib -lgdal -lproj -L/usr/lib/R/lib -lR


Based on this output, rgdal seems to find the epsg ("checking PROJ.4: 
epsg found and readable... yes") so I'm not sure what might be causing 
this error.  Any help?  Thanks!



More information about the R-sig-Geo mailing list