[postgis-users] Contradiction between ST_IsValid() and ST_IsValidReason() ?

Andreas Neumann andreas at qgis.org
Wed Dec 23 08:38:23 PST 2020


Hm, seems like it is still not good in master.

As soon as I add "ST_MakeValid()" in the same SQL query, it goes back to
"weird" mode.

So while this command is fine and consistent

SELECT t_id, ST_AsText(geometrie), ST_IsValidReason(geometrie),
  FROM arp_npl.erschlssngsplnung_erschliessung_linienobjekt eel
  WHERE ST_IsValid(geometrie) = FALSE

as soon as I do something with ST_MakeValid() in the same command, it goes
back to inconsistent mode.

SELECT t_id, ST_AsText(geometrie), ST_AsText(ST_MakeValid(geometrie)),
ST_IsValidReason(geometrie), ST_IsValidReason(ST_MakeValid(geometrie))
  FROM arp_npl.erschlssngsplnung_erschliessung_linienobjekt eel
  WHERE ST_IsValid(geometrie) = FALSE

If I shut down the database and start it again, the first command seems
somehow ok, but then it gets weird again.

Andreas


On Wed, 23 Dec 2020 at 17:26, Andreas Neumann <andreas at qgis.org> wrote:

> Hi strk,
>
> I just compiled Postgis master and the issue is gone.
>
> It now works consistently between ST_IsValid() and ST_IsValidReason() and
> doesn't change over time.
>
> So if these memory issue fixes you made in master could go back into the
> production release, it would be great.
>
> Thanks,
> Andreas
>
> On Wed, 23 Dec 2020 at 16:56, Sandro Santilli <strk at kbt.io> wrote:
>
>> On Wed, Dec 23, 2020 at 04:51:07PM +0100, Andreas Neumann wrote:
>> > Hi Strk and Nicolas,
>> >
>> > Thanks for your replies.
>> >
>> > I'm using GEOS 3.9, PostgreSQL 13.1 and Postgis 3.1 (self-compiled).
>> >
>> > The situation is really weird: if I run the same SQL query a second
>> > time, the contradiction is gone and all geometries are labeled as
>> > invalid by ST_IsValidReason(). If I run it many times, the results
>> > change even more, suddenly, the invalid geometries are not even detected
>> > correctly by ST_IsValid().
>> >
>> > @strk: these invalid geometries contain "NaN" coordinates.
>> >
>> > I will open an issue and submit the geometries.
>>
>> Can you first try to rebuild PostGIS from current master branch ?
>> I've fixed a memory issue somewhat related to "NaN" coordinates
>>
>> --strk;
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
>
>
> --
>
> --
> Andreas Neumann
> QGIS.ORG board member (treasurer)
>


-- 

--
Andreas Neumann
QGIS.ORG board member (treasurer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20201223/38ffe3ef/attachment.html>


More information about the postgis-users mailing list