Opened 3 years ago

Last modified 2 years ago

#5133 closed defect

ST_IsValid gives false positives for some "nested shells" geometries — at Version 1

Reported by: pegautreau Owned by: pramsey
Priority: high Milestone: PostGIS 3.2.2
Component: postgis Version: 3.2.x
Keywords: st_isvalid Cc:

Description (last modified by pramsey)

SELECT ST_IsValid('MULTIPOLYGON(((3.1159647327776 45.8945466579793,3.11592656973335 45.8945439935178,3.1159138351383 45.8945878526115,3.11589617446883 45.894648677432,3.11600330801231 45.8946565084663,3.11603320098284 45.8946586935046,3.11603527270572 45.8946587702646,3.11609428533829 45.8946608396878,3.11610373994251 45.8946138820922,3.11611597473274 45.8945572172376,3.116021407765 45.8945506148806,3.1159647327776 45.8945466579793),(3.11598841113043 45.8945526196915,3.11598348641025 45.8945522352619,3.11597871955898 45.8945518631556,3.11598841113043 45.8945526196915),(3.11597871955898 45.8945518631556,3.11597826359897 45.8945518275627,3.11597770228232 45.8945517837456,3.11597871955898 45.8945518631556),(3.11597770228232 45.8945517837456,3.11597253456926 45.8945513803472,3.11596794047477 45.894551021726,3.11596362983417 45.8945506852314,3.11597770228232 45.8945517837456),(3.11596216348313 45.8945560394174,3.11601944954132 45.8945611821445,3.11604532510409 45.8945635050552,3.11603525837852 45.8945986795711,3.11602781011054 45.8945979166658,3.11595429350387 45.8945903865383,3.11596216348313 45.8945560394174)),((3.11600928183286 45.8945542488812,3.1160078379169 45.8945541361677,3.11600858297084 45.8945541943273,3.11600928183286 45.8945542488812)))');

The function returns true with postgis3 but returns false with postgis2. It seems that a lot of invalid geometries of type "nested shells" are no more recognized as it should be by postgis3.

Change History (1)

comment:1 by pramsey, 2 years ago

Description: modified (diff)

I cannot replicate this, and I'm testing on postgis 3.3 and geos 3.11, so the latest of everything.

=# SELECT ST_IsValid('MULTIPOLYGON(((3.1159647327776 45.8945466579793,3.11592656973335 45.8945439935178,3.1159138351383 45.8945878526115,3.11589617446883 45.894648677432,3.11600330801231 45.8946565084663,3.11603320098284 45.8946586935046,3.11603527270572 45.8946587702646,3.11609428533829 45.8946608396878,3.11610373994251 45.8946138820922,3.11611597473274 45.8945572172376,3.116021407765 45.8945506148806,3.1159647327776 45.8945466579793),(3.11598841113043 45.8945526196915,3.11598348641025 45.8945522352619,3.11597871955898 45.8945518631556,3.11598841113043 45.8945526196915),(3.11597871955898 45.8945518631556,3.11597826359897 45.8945518275627,3.11597770228232 45.8945517837456,3.11597871955898 45.8945518631556),(3.11597770228232 45.8945517837456,3.11597253456926 45.8945513803472,3.11596794047477 45.894551021726,3.11596362983417 45.8945506852314,3.11597770228232 45.8945517837456),(3.11596216348313 45.8945560394174,3.11601944954132 45.8945611821445,3.11604532510409 45.8945635050552,3.11603525837852 45.8945986795711,3.11602781011054 45.8945979166658,3.11595429350387 45.8945903865383,3.11596216348313 45.8945560394174)),((3.11600928183286 45.8945542488812,3.1160078379169 45.8945541361677,3.11600858297084 45.8945541943273,3.11600928183286 45.8945542488812)))');
NOTICE:  Nested shells at or near point 3.1160092818328602 45.894554248881199
 st_isvalid 
------------
 f
(1 row)

pramsey=# select postgis_full_version();
                                                                                                                postgis_full_version                                                                                                                 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.3.0dev 3.2.0-867-g216aca648" [EXTENSION] PGSQL="140" GEOS="3.11.0dev-CAPI-1.16.0" PROJ="9.1.0" LIBXML="2.9.4" LIBJSON="0.15" LIBPROTOBUF="1.4.0" WAGYU="0.5.0 (Internal)" 
Note: See TracTickets for help on using tickets.