Skip to content

gUnion error -> TopologyException: side location conflict at...

2 messages · Marc Marí Dell'Olmo, Michael Sumner

#
Dear all,

I would like to join the polygons of two maps (with
SpatialPolygonsDataFrame format). I was trying to use gUnion funcition
(rgeos library) but I obtained the following error:
[1] TRUE
[1] TRUE
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td,
"rgeos_union") :
  TopologyException: side location conflict at 425106.60792063997
4583876.4374835696

I can't understand what's happening, glsValid is true for both shp
files. Moreover, I've made a zoom to this point and I can see anything
wrong.

Thank you for your help,

Marc
#
I've found you can get around this error from some rgeos functions
(like gIntersection) by using the byid = TRUE argument, and in the
extreme you can iterate over one or both sets individually and collate
the results. I haven't been able to construct a clear example to
isolate the cause of the problem.

Since it's a union perhaps you can gUnaryUnion each object together
first. But is that the goal? One big union object, or a per-ID union
matching objects from the two sets? (I think I understand this, but
again I'd like to build a set of examples that make it clear).

Cheers, Mike.

On Wed, Oct 29, 2014 at 1:12 AM, Marc Mar? Dell'Olmo
<marceivissa at gmail.com> wrote: