[R-sig-Geo] Error message in rgeos

Leonardo Monasterio leonardo.monasterio at gmail.com
Fri Apr 8 13:33:37 CEST 2011

Dear Colin,

Thank you very much. I've uploaded shapefile to:


On Thu, Apr 7, 2011 at 6:39 PM, Colin Rundel <rundel at gmail.com> wrote:
>> I am getting the following error message when I try:
>>> lineborder<-gBoundary(map1)
>> Erro em TopologyFunc(spgeom, id, byid, "rgeos_boundary") :
>>  IllegalArgumentException: Operation not supported by GeometryCollection
>> map1 is a polygon created from a shape file.
>> Also I get:
>>> gIsSimple(map1)
>> Erro em RGEOSUnaryPredFunc(spgeom, byid, "rgeos_issimple") :
>>  IllegalArgumentException: This method does not support
>> GeometryCollection arguments
>>> gIsValid(map_outer_ring)
>> [1] TRUE
> For some reason when Rgeos is attempting to convert your sp object it is using a GeometryCollection type instead of a Polygon or Multipolygon type. Currently the GEOS library does not support GeometryCollection types with either gBoundary or gIsSimple and some of the other functions as well.
> You can try both functions with byid=TRUE which will then run the GEOS function on each sub element of your sp object and will either return a single sp object or list of sp objects depending on the compatibility of the returned values.
> If you can host the shapefile you are using somewhere and provide a link, I can look into why Rgeos is treating it as a GeometryCollection.
> -Colin

More information about the R-sig-Geo mailing list