[postgis-devel] Possible bug in intersection of polygons

Juan Pedro Pérez Alcántara jp.perez.alcantara at gmail.com
Fri Nov 4 06:29:03 PDT 2022


Fortunately I didn't give too many details about this to bother you too
much...

This is quite embarrassing as in the end I was missing the postprocessation
of GEOMETRYCOLLECTION. Everything works very much as expected, very sorry
for the false positive. The missing linestring was there. Thanks to
st_collectionextract and friends this is easier than ever. I have warned my
students at the university countless times against leaving out unprocessed
GEOMETRYCOLLECTION and see what happened!

Thank you for answering! For topology clean-up I use to rely on GRASS most
of the time. I piped the features through it too.

Very sorry and thank you all,

---

Juan Pedro Pérez Alcántara

jp.perez.alcantara at gmail.com


On Thu, 3 Nov 2022 at 18:18, Martin Davis <mtnclimb at gmail.com> wrote:

> That certainly seems odd.  We'll need some data to investigate this
> further.
>
>
> On Wed, Nov 2, 2022 at 4:37 AM Juan Pedro Pérez Alcántara <
> jp.perez.alcantara at gmail.com> wrote:
>
>>
>> Hi, I may have found a bug in polygon intersection. I've carefully
>> checked everything I could think of and updated all libraries to the latest
>> version, to rule out the possibility of a GEOS error or something, but the
>> error still persists.
>>
>> postgis_full_version() is:
>>
>> POSTGIS="3.3.1 3786b21" [EXTENSION] PGSQL="150" GEOS="3.11.0-CAPI-1.17.0"
>> PROJ="9.1.0" LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3"
>> WAGYU="0.5.0 (Internal)"
>>
>> The system is Linux.
>>
>> Here is a brief summary of the problem:
>>
>> [image: Screenshot from 2022-11-02 12-19-38.png]
>>
>> As you can see in the screenshot, I have several polygons with a clean
>> topology. A st_intersection of them, isolating only LINESTRING and
>> MULTILINESTRING solutions, returns the green lines. As you can see, the
>> clean topology produces clean results: all frontiers are correctly
>> identified but the segment in black. I've thoroughly analyzed this segment,
>> studying the as_ewkt() representation of both polygons and identifying the
>> common primitive, they are identical coordinate by coordinate, but I'm at a
>> loss at why st_intersection is unable to compute this exactly common
>> primitive.
>>
>> I've all assets available to reproduce this issue if developers think it
>> is of interest, but I'm not going to dump them all here for brevity. Please
>> ask me for further details if you think this is of any interest.
>>
>> Thanks for your attention and your time,
>>
>> ---
>>
>> Juan Pedro Pérez Alcántara
>>
>> jp.perez.alcantara at gmail.com
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20221104/700eed2c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2022-11-02 12-19-38.png
Type: image/png
Size: 42337 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20221104/700eed2c/attachment-0001.png>


More information about the postgis-devel mailing list