[Qgis-developer] [geos-devel] Bug with avoid intersection - willing to fund fix

Sandro Santilli strk at keybit.net
Fri Nov 8 03:15:57 PST 2013


On Fri, Nov 08, 2013 at 09:05:26AM -0200, George Silva wrote:
> Hello Sandro.
> 
> I dont think this is a GEOS bug. I was following the various discussions on
> this bug/unexpected behavior.
> 
> On one of them, in discussion with Marco, you said that it might be a
> problem with GEOSDifference. And after that theres our chat in IRC, which
> seems to fit the problem.
> 
> We can easily test this inserting the geometries directly in Postgis, I
> mean, the result of an ST_Difference.

What's known about GEOS is that constructive operations (like ST_Difference)
can return geometries which don't necessarely match anymore with the inputs.

This is due to:

 - Introduction of intersection points, slightly changing slope of the
   2 new segments created from the slope of the original segment.

 - Vertex coordinates shift, due to heuristic attempts at working around
   robustness errors thrown while using floating point precision.

> Im not sure where the bug resides, but I would like to come up with
> alternatives, or at least a very clear method of constructing these
> polygons in Qgis that will not result in errors.

As I just commented on the second ticket you reported, I think QGIS is
making wrong assumptions about the results from overlay operations in GEOS.

> It seems to me that if the new polygon only intersects another one, works,
> but that is not always the case when doing land use maps.
> 
> The plain simple test that Qgis MUST pass is that polygons created with
> avoid intersections options, should have NO topological errors.

My suggested solution is polygonizing the linework resulting from the
editing (after noding).
The result from polygonizer is always topologically correct (assuming
input is correctly noded).

--strk;

 ()  ASCII ribbon campaign        - against html e-mail
 /\  http://www.asciiribbon.org   - against proprietary attachments


More information about the Qgis-developer mailing list