[postgis-devel] Validity flag
Hugo Mercier
hugo.mercier at oslandia.com
Mon Mar 7 05:58:56 PST 2016
On 06/03/2016 22:46, Oliver Courtin wrote:
> Le 5 mars 2016 à 23:14, Daniel Baston a écrit :
>
>
> Hi Dan,
>
>> Here's an example where GEOS and SFCGAL report a different result for ST_IsValid:
>>
>> SELECT ST_IsValid('POLYGON ((0 0 0, 1 0 0, 1 0 0, 1 1 0, 0 1 0, 0 0 1))');
>>
>> This returns true with GEOS, but false with SFCGAL (on Hugo's branch, where ST_IsValid is implemented with SFCGAL). So, we wouldn't want a situation where the flag is set with a GEOS backend and read with a SFCGAL backend.
>
>
> Yeap that's a really good point !
>
>
>
> Indeed as GEOS is 2D only, it won't be able to handle TIN and PS validity check
> (not that a big deal as an unknown valid would 'only' impact performances but won't crash PG process),
TIN and PS can be in 2D as well if I am correct. GEOS raises an
exception to say it is not supported which is fine.
Returning "valid" on an invalid 3D geometry is more of a problem indeed.
> Few ideas about it:
>
> - Don't really like the idea to have validity several flags for each backend
> (idea is to allow new backend to be added later, for example and maybe one day: GGL)
>
> - Quick way to workaround would be to not allow GEOS to set validity flags on 3D geometries (HASZ), or on TIN/PS
+1
More information about the postgis-devel
mailing list