Opened 15 years ago
Last modified 15 years ago
#253 closed defect
Unexpected "Self-intersection at or near point" — at Version 1
Reported by: | wvereeck | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 3.1.1 |
Component: | Core | Version: | 3.1.0 |
Severity: | Unassigned | Keywords: | self-intersection |
Cc: |
Description (last modified by )
Hi All,
I'm very new to GEOS (< 1 day), but I'm puzzled by what I think is a strange bug.
Being particularly interested in the GEOSUnionCascaded() function to merge large sets (>50,000) of overlapping polygons, altering my dataset manually to avoid this bug(?) is not an option.
I have narrowed down the problem to the following multipolygon, which represents a rectangle inside an octagon (see http://homes.esat.kuleuven.be/~wvereeck/rect_inside_oct.png)
MULTIPOLYGON(((12.26 18.46, 11.76 18.46, 11.54 18.24, 11.54 17.34, 11.76 17.12, 12.26 17.12, 12.48 17.34, 12.48 18.24, 12.26 18.46)),((12.37 18.35, 11.65 18.35, 11.65 17.23, 12.37 17.23, 12.37 18.35)))
I am using the c-interface. Running the GEOSisValid() test on this polygon set results in:
NOTICE: Self-intersection at or near point 12.37 18.35
Also, GEOSUnionCascaded() accordingly fails with:
ERROR: TopologyException: found non-noded intersection between 11.65
etc.
However, when I slightly offset the x-position (+1e-8) of the two top vertices of the rectangle, everything works like a charm (i.e. GEOSisValid returns 'true' and GEOSUnionCascaded produces the correct output polygon):
MULTIPOLYGON(((12.26 18.46, 11.76 18.46, 11.54 18.24, 11.54 17.34, 11.76 17.12, 12.26 17.12, 12.48 17.34, 12.48 18.24, 12.26 18.46)), ((12.37000001 18.35, 11.65000001 18.35, 11.65 17.23, 12.37 17.23, 12.37000001 18.35)))
I apologize if I'm too much in a hurry here and should start to learn more about geos before submitting a complaint :) At least I hope this is the right place for this problem.
Kind Regards, Wim Vereecken
FWIW, I'm using geos-3.1.0.tar.bz2 (2009/03/17), libgeos-3.1.0 and Ubuntu 8.04.2 (x86-64) with a 2.6.24-23-generic kernel.