[postgis-devel] Bye bye -1

Paul Ramsey pramsey at opengeo.org
Thu Sep 29 09:10:42 PDT 2011


On Thu, Sep 29, 2011 at 1:56 AM, Sandro Santilli <strk at keybit.net> wrote:
> 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;

And -2, and -3?

postgis20=# select st_srid('SRID=-3;POINT(0 0)');
 st_srid
---------
      -3
(1 row)

The capability has always been there to use those numbers. Someone may have.

P

>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list