[postgis-devel] Bye bye -1

Sandro Santilli strk at keybit.net
Thu Sep 29 01:56:20 PDT 2011


On Wed, Sep 28, 2011 at 03:36:15PM -0700, Paul Ramsey wrote:
> OK, so we never did actually swap over the SRID=0, so there's a mix of
> behavior in places, the 0-based behavior in typmod is because it
> inherits from geography, which was build with 0 as the unknown.
> So swapping over, a conundrum... what to do with -1 once we've swapped?
> One temptation is to map it to 0. But then we get this:
> 
> postgis20=# select st_srid('SRID=-1;POINT(0 0)');
>  st_srid
> ---------
>        0
> (1 row)
> 
> Some folks might not like that.

There's no way -1 means anything other than UNKNOWN and the same can
be said for 0. Unless anyone stored "-1" or "0" in spatial_ref_sys.
Is that allowed ? We should forbid it.

So, my vote is for automatically convert to zero. Best if we can also
raise a warning in doing it, to remind people that their inputs needs
be fixed (why on earth should the input have an explicit SRID=-1 prefix 
in EWKT when UNKNOWN is what you get by omitting the SRID prefix?)

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list