[R-sig-Geo] Error using unionSpatialPolygons

Karl Ove Hufthammer karl at huftis.org
Mon Sep 3 19:21:29 CEST 2012


Ariel Ortiz-Bobea skreiv:

> I was recycling some code I used a few months ago that involved using the
> unionSpatialPolygons() of the maptools package. Back then I didn't have a
> problem, now I get the following error:
> 
>>usa_counties <- unionSpatialPolygons(usa_counties, data$fips)
> Loading required package: rgeos
> Loading required package: stringr
> rgeos: (SVN revision 330)
> GEOS runtime version: 3.3.3-CAPI-1.7.4
> Polygon checking: TRUE
> WARNING! if you turn polygon checking off, and polygons are
> not valid in GEOS, you risk losing data as your R session may crash!
> 
> Error: TopologyException: found non-noded intersection between LINESTRING
> (-76.0029 36.5547, -75.9398 36.5547) and LINESTRING (-75.9742 36.5261,
> -75.9857 36.5547) at -75.985664369999995 36.55470657

The data in the ‘maps’ package are probably buggy. Use the vector data from
http://www.naturalearthdata.com/ instead. They are of great quality and 
completely free (public domain).

-- 
Karl Ove Hufthammer
E-mail: karl at huftis.org
Jabber: huftis at jabber.no



More information about the R-sig-Geo mailing list