Kenneth Takagi
2010-Jun-05 23:28 UTC
[R-sig-Debian] Issues with unionSpatialPolygons on Ubuntu
Hi, I've cross posted with r-sig-debian since they may be an issue for linux (never had this problem on my windows machine...) I recently made the switch to Ubuntu 10.04 (lucid), and found that unionSpatialPolygons() gives me the following error when trying to combine polygons within a shapefile: # Read in shapefile and merge polygons foo <- readShapePoly("foo.shp", proj4string = CRS("+init=epsg:2272")) IDs <- as.character(foo$ID) SP_out <- unionSpatialPolygons(foo, IDs) Error: isTRUE(gpclibPermitStatus()) is not TRUE I've seen some posts about a package "rgeos" which may have something to do with this error, and I downloaded the source from: http://r-forge.r-project.org/R/?group_id=602 But when I've tried to install by source using R CMD INSTALL (or using install.packages()) I get the following error message: ...lines of output not shown... rgeos_misc.c: In function ?rgeos_hausdorffdistance?: rgeos_misc.c:62: error: ?GEOSHausdorffDistance_r? undeclared (first use in this function) rgeos_misc.c:62: error: (Each undeclared identifier is reported only once rgeos_misc.c:62: error: for each function it appears in.) make: *** [rgeos_misc.o] Error 1 ERROR: compilation failed for package ?rgeos? I'm using R version 2.11.1 (2010-05-31), in ubuntu 10.04 LTS Thanks for any help you can offer on getting unionSpatialPolygon up and running! Ken
Michael Rutter
2010-Jun-06 23:55 UTC
[R-sig-Debian] Issues with unionSpatialPolygons on Ubuntu
On 06/05/2010 07:28 PM, Kenneth Takagi wrote:> Hi, > > I've cross posted with r-sig-debian since they may be an issue for linux > (never had this problem on my windows machine...) > I recently made the switch to Ubuntu 10.04 (lucid), and found that > unionSpatialPolygons() gives me the following error when trying to > combine polygons within a shapefile: > > # Read in shapefile and merge polygons > foo <- readShapePoly("foo.shp", proj4string = CRS("+init=epsg:2272")) > IDs <- as.character(foo$ID) > SP_out <- unionSpatialPolygons(foo, IDs) > Error: isTRUE(gpclibPermitStatus()) is not TRUE > > I've seen some posts about a package "rgeos" which may have something to > do with this error, and I downloaded the source from: > http://r-forge.r-project.org/R/?group_id=602 > > But when I've tried to install by source using R CMD INSTALL (or using > install.packages()) I get the following error message: > > ...lines of output not shown... > rgeos_misc.c: In function ?rgeos_hausdorffdistance?: > rgeos_misc.c:62: error: ?GEOSHausdorffDistance_r? undeclared (first use > in this function) > rgeos_misc.c:62: error: (Each undeclared identifier is reported only once > rgeos_misc.c:62: error: for each function it appears in.) > make: *** [rgeos_misc.o] Error 1 > ERROR: compilation failed for package ?rgeos? > > I'm using R version 2.11.1 (2010-05-31), in ubuntu 10.04 LTS > > Thanks for any help you can offer on getting unionSpatialPolygon up and > running! > > KenKen, Without a "foo.shp" file to use as an example, I can't recreate your original R error. Can you redo the example given on page 57 of the maptools pdf manual? However, I can recreate the error when trying to install rgeos. That error needs to be addressed with the rgeos developers, as it appears that is an error in their code, not something that is missing in R or in Ubuntu. Hope this helps, Michael -- Dr. Michael A. Rutter School of Science Penn State Erie, The Behrend College Station Road Erie, PA 16563 http://math.bd.psu.edu/faculty/rutter