[postgis-devel] UnknownSRID value: 0 or -1 ?
Sandro Santilli
strk at keybit.net
Mon Dec 12 07:23:01 PST 2011
On Fri, Dec 09, 2011 at 10:03:52AM -0800, dustymugs wrote:
> On 12/09/2011 09:35 AM, Sandro Santilli wrote:
> >I've started work on testing dump/restore procedure for getting to 2.0
> >and realized the data w/out a proper SRID won't come back due to
> >ensure_srid_geom checks on tables insisting of the SRID being -1
> >rather than 0.
> >
> >There's no much we can do to fix this, unless we're willing to
> >drop the constraints from the user dump.
> >
> >For this reason I think it would be safer to get our unknown
> >srid back to -1 before it's too late (srid=0 getting in dumps
> >and making things even harder).
> >
> >If somebody has smarter ideas I'm happy to listen to them.
> >
>
> I have no smarter ideas but I prefer 0 without any real reasons. I
> don't get the purpose of having a SRID check constraint if the
> constraint is enforcing the unknown SRID.
Well, it's not something we have control on, it's stuff you have
in your database backup, unless you did something about it _before_
dropping it.
The only way I can think which could fix this would be changing ST_Srid
to return a SpatialRefSys object rather than an integer and make it
so an integer <= 0 casts to the _same_ SpatialRefSys object
(the "unknown srs" object). Mind you: SQL/MM does have such type...
--strk;
,------o-.
| __/ | Thank you for PostGIS-2.0 Topology !
| / 2.0 | http://www.pledgebank.com/postgistopology
`-o------'
More information about the postgis-devel
mailing list