[gdal-dev] OGR Polygon Intersection

Darafei "Komяpa" Praliaskouski me at komzpa.net
Sat Feb 27 10:11:45 PST 2021


Please use GEOSNormalize / ST_Normalize or other equivalents before
comparing geometries between library versions. The starting point in the
ring can change because of different optimizations, and GEOS 3.9 was a
complete rewrite of the geometry overlay subsystem.

On Sat, Feb 27, 2021 at 9:02 PM Kai Mühlbauer <kai.muehlbauer at uni-bonn.de>
wrote:

> Hi,
>
> this might be a silly problem or no problem at all, but I currently
> can't wrap my head around it.
>
> I'm using python bindings of GDAL OGR with GEOS support for layer
> intersection since several years now. Now suddenly my testsuit which
> checks intersection of two boxes breaks since the intersecting box
> starts now with a different starting point (all four points of the box
> fit with the earlier tests).
>
> The change took place between versions GDAL 3.2.0 -> 3.2.1, GEOS 3.8.1
> -> 3.9.1 and PROJ 7.1.1 -> 7.2.0. I've tried to find anything what might
> have changed in the release notes of GDAL and GEOS, but couldn't.
>
> So if anyone has a clue what's going on or what has changed and can
> point me to the relevant resources, I would greatly appreciate it.
>
> Below you find the geometries I uses as JSON strings and the differing
> intersection.
>
> src
> '{ "type": "Polygon", "coordinates": [ [ [ 1.0, 1.0, 0.0 ], [ 1.0, 2.0,
> 0.0 ], [ 2.0, 2.0, 0.0 ], [ 2.0, 1.0, 0.0 ], [ 1.0, 1.0, 0.0 ] ] ] }'
>
> trg
> '{ "type": "Polygon", "coordinates": [ [ [ 0.5, 0.5, 0.0 ], [ 0.5, 1.5,
> 0.0 ], [ 1.5, 1.5, 0.0 ], [ 1.5, 0.5, 0.0 ], [ 0.5, 0.5, 0.0 ] ] ] }'
>
> trg.Intersection(src) (GDAL 3.2.0, GEOS 3.8.1, PROJ 7.1.1)
> '{ "type": "Polygon", "coordinates": [ [ [ 1.0, 1.5, 0.0 ], [ 1.5, 1.5,
> 0.0 ], [ 1.5, 1.0, 0.0 ], [ 1.0, 1.0, 0.0 ], [ 1.0, 1.5, 0.0 ] ] ] }'
>
> trg.Intersection(src) (GDAL 3.2.1, GEOS 3.9.1, PROJ 7.2.0)
> '{ "type": "Polygon", "coordinates": [ [ [ 1.5, 1.5, 0.0 ], [ 1.5, 1.0,
> 0.0 ], [ 1.0, 1.0, 0.0 ], [ 1.0, 1.5, 0.0 ], [ 1.5, 1.5, 0.0 ] ] ] }'
>
> Thanks in advance!
>
> Cheers,
> Kai
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210227/07e90533/attachment.html>


More information about the gdal-dev mailing list