[R-sig-Geo] gUnion: no outgoing dirEdge found

Brian J. Stults bstults at fsu.edu
Fri Jun 17 20:56:41 CEST 2011


Hello,

I am trying to create a union and intersection between two shapefiles.
They consist of census tracts in the state of Delaware - one file for
1990 and the other for 2000.  They are available here:

http://www2.criminology.fsu.edu/~stults/misc/delaware_tracts.zip

I would like to generate a shapefile that includes all identical
polygons between the two layers as well as all portions that intersect
(i.e. "union" in Qgis).  I believe gUnion is the function I need to use.

Here is my code:

library(maptools)
library(rgeos)

de1990 <- readShapePoly("shapefiles/subset_1990_de.shp")
de2000 <- readShapePoly("shapefiles/subset_2000_de.shp")

union <- gUnion(de1990, de2000)


I receive the following error (full output attached):

> union <- gUnion(de1990, de2000)
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, "rgeos_union") :
  TopologyException: no outgoing dirEdge found at -77.0822 38.9222
Calls: gUnion -> RGEOSBinTopoFunc -> .Call
Execution halted

I confirmed that the polygons are valid using gIsValid, but maybe that's
not what this error is indicating.

I am able to successfully do the union in Qgis.  However, I eventually
need to do this for the entire U.S. for several decades, and just one
union of the full U.S. takes several days to complete on my desktop.  I
would rather run it in R on my university's supercomputer, which would
significantly reduce the run-time.

I am hoping that this does not require editing the shapefile, since I
could not possibly do that for all tracts in the U.S.

Thanks for any suggestions,
Brian


-- 
Brian J. Stults
Assistant Professor
College of Criminology and Criminal Justice
Florida State University
phone: 850-645-7376   fax: 850-644-9614
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: union_intersect.rlog
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110617/9e5f007a/attachment.pl>


More information about the R-sig-Geo mailing list