[geos-devel] Strange intersection results in Windows

Martin Davis mtnclimb at gmail.com
Thu Sep 9 09:39:43 PDT 2021

Thanks for the bug report.  I have replied on the original sf ticket:

Quoted here for the benefit of this list:

There is a bug in GEOS 3.9.0 which causes overlay to essentially drop
straight lines if they are axis-parallel. It very much sounds like this is
what you are seeing. The bug was fixed
GEOS 3.9.1.

If it's not possible to upgrade, two workarounds are:

   - rotate the lines a very small amount
   - use intersects to detect if a line is wholly inside a polygon, and if
   so just include it in the result directly

On Thu, Sep 9, 2021 at 3:21 AM Laura Marshall <lhm at st-andrews.ac.uk> wrote:

> Dear list,
> I use GEOS 3.9.0 via an R library (sf). I have been trying to find the
> intersection between groups of lines and a polygon / multipolygon.
> I have realised that updating the packages on my machine has resulted in
> some strange intersection results on Windows machines (and only Windows -
> works on mac and ubuntu). The sf update which introduced the issue was also
> associated with a change in GEOS versions, upgrading from 3.8.0 to 3.9.0
> and the suspicion is that it is something in GEOS rather than the sf R
> library.
> I have searched the tickets but could not see any issues which seem to
> match what I am seeing.
> I attach an image below of the results I am getting with the intersection
> between the lines and the polygon on my Windows machine. Red lines are the
> lines which were not considered part of the intersection and the thicker
> green lines are what was identified as the intersection between the grid of
> line segments and the polygon. It seems all lines that intersect the
> polygon boundary are correctly identified but only some lines that are
> entirely within the polygon boundary are included in the intersection.
> I had initially reported this as an issue in sf and there are more
> examples there: https://github.com/r-spatial/sf/issues/1781
> Question 1: Is this a known issue with 3.9.0?
> Question 2: Is there an easy way to directly install 3.9.1 on to a Windows
> machine to test the behaviour with the latest version?
> Many thanks for your help,
> Laura
> Dr. L Marshall
> Centre for Research into Ecological & Environmental Modelling
> University of St. Andrews
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geos-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20210909/644ed5bd/attachment.html>

More information about the geos-devel mailing list