[postgis-devel] ST_IsValid/ST_IsSimple ISO compatibility

Darafei "Komяpa" Praliaskouski me at komzpa.net
Sun Nov 10 03:25:27 PST 2019


Hi James,

We already have at least three validities in PostGIS:

 - SFCGAL validity (not exposed in any way, but there),
 - OGC validity (ST_IsValid),
 - "ESRI" validity (ST_IsValid(geom, 1)).

I see you want a third option, ISO validity, as it was the one provided by
your library previously.

The simplest option I see is to shift your open software to follow the OGC,
not ISO, standard: that means we all can read the spec, and the only things
you have to change are three letters in documentation (ISO->OGC) and
underlying library. It's not like we don't follow a standard, just not the
one you chose.
Link I see the definition on is https://www.opengeospatial.org/standards/sfa
.

The biggest practical problem of following the ISO spec in open source
software is that we don't have it. Even if I go and buy it with personal
funds, I can't attach it to PostGIS docs so poor people trying to implement
a writer for valid geometries can't know what do we want from them.

If you want this fixed universally, you have to convince OGC and ISO to
sync up their definitions of validity.

The practical use of validity is that it's expected that any shipped
algorithm will not misbehave on a geometry that's proclaimed Valid by the
library. I'm not aware of any PostGIS-shipped algorithm (and any other one)
that's not robust to repeated points. If you know of such algorithm (even
outside PostGIS) please let us know.

Other thing, it would be cool to get the ISO spec for SQL/Spatial for
PostGIS use. Last time we spend some time trying to find it in the open
during the Code Sprint in Minneapolis, and only thing we found was couple
year old draft. It had some awful things inside, like almost free form text
for fixed elements in headers for binary representation of TIN, I can only
hope they got fixed in release version.


On Sat, Nov 9, 2019 at 11:26 PM James A. Gill <jamesagill at gmail.com> wrote:

> Hi all.
>
> I'm the maintainer for Presto <https://prestodb.io/>'s geospatial
> functions
> <https://prestodb.github.io/docs/current/functions/geospatial.html>. I've
> chatted with Darafei before (congrats, Darafei!), but for the rest you:
> hello!
>
> Something I would like is to make, as much as possible, Presto's functions
> compatible with PostGIS.  That would allow people to run the same or
> similar queries in the OLTP realm as well as the warehouse/analytics
> realm.  Presto is also very keen on adhering to the ISO SQL standards in
> general, and in particular the SQL3 geospatial standard.  Sometimes,
> however, these are in conflict!  See:
>
> 1. https://github.com/locationtech/jts/issues/486 and
> 2. https://trac.osgeo.org/postgis/ticket/3425
>
> I'd like to open up a conversation about making JTS and GEOS compliant
> with ISO, which would make PostGIS more compliant.  In particular, I'd love
> to have a standardized test suite (language agnostic) for the spec,
> starting with ST_IsValid and ST_IsSimple.  This spec could then be
> implemented in JTS and GEOS (and any other library, like JSTS or Esri
> or...).  However, this will cause at least one backwards-incompatible
> change (listed above), and there may be more.  This is always sensitive,
> but particularly with databases.  So I'd really value your collective input
> as to whether this is a bad idea, or a good idea that's impractical, or a
> good idea that can be done with work and diligence.
>
> Thoughts?
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel



-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20191110/e2b7c6d3/attachment.html>


More information about the postgis-devel mailing list