[postgis-devel] Validity flag

Sandro Santilli strk at keybit.net
Mon Feb 29 02:49:34 PST 2016


On Mon, Feb 29, 2016 at 10:36:54AM +0100, Hugo Mercier wrote:
> Hi all,
> 
> Following the Paris code sprint, I've proposed a pull request that
> allows to manipulate a validity flag in geometries and use it in SFCGAL:
> 
> https://github.com/postgis/postgis/pull/99
> 
> First about the flag: it seems we now have the whole flag byte
> populated. It then means there is no room for future flags ? Could we
> keep a spare flag for an "extended" flag byte if needed someday ?

Sorry, are you saying we're using all 8 bits in current trunk (r14719) ?
We _do_ want to keep one flag to extend the flagset, no dubt here.

> Then about the pull request, here are the main changes which I would
> like to have your feelings on:
> 
> - There is a new ST_HasValidityFlag() function that allows to ... well
> read the validity flag.
> 
> - Modifying the flag is only possible through ST_Validate which tests
> for validity and returns the input geometry with the flag set (only on
> SFCGAL side for now)
> 
> - If we want to benefit from the validity flag, functions that output
> new geometries should flag them valid if they are. This has been done
> for some functions in the upcoming SFCGAL release. If not, functions
> that need valid geometries in input should, as usual, verify validity
> before processing.

I like the approach of the validity flag, as long as we have
space for it. The ST_MakeValid could probably also set it,
for example.

--strk;



More information about the postgis-devel mailing list