7

I was trying to insert a reference system in PostGIS from http://spatialreference.org/, and got a constraint violation for spatial_ref_sys_srid_check. I checked that constraint and found that, when inserting in spatial_ref_sys, the srid must never be greater that 998999.

I understand that the root cause of the problem is that spatialreference prepend a 9 to the srid. Probably to avoid collision srid in the srid column, or something of the sort. I don't really care about that, its easy to solve: removing the 9 make it work most of the time.

But why that arbitrary upper limit on the srid number? It is way below the maximum value for a Postgresql integer, so it doesn't seem to be a technological limit, and the number itself look quite arbitrary. Introducing that limit broke the code in http://spatialreference.org/ so there is an obvious downside.

So what was the rational for introducing such an upper limit, at that specific value? Is that a limit imposed by a standard body?

2

The significance of the number 998999 is that it is 1 less than 999000. It actually serves as the upper bound 'custom' user SRIDs. The range of SRIDs reserved for user custom SRIDs is from 910000 to 998999.

It took me a while, but I dug this up as reference: http://lists.osgeo.org/pipermail/postgis-users/2012-July/034716.html

In terms of your comment that the number is arbitrary, I'm assuming since some self-important organization went and reserved 900913 as an SRID, the postGIS devs thought no one else would be so silly as to go higher than 910000, thus the lower bound.

There's a bit of discussion spread out over the developer mailing list. The most relevant message seems to be from Feb 2012:

http://lists.osgeo.org/pipermail/postgis-devel/2012-February/018440.html

  • So its basically it is an arbitrary limit. They just had to pick one so that users have a range to put their custom SRID into. Make sense. Nice job digging that up. – Laurent Bourgault-Roy May 25 '15 at 15:26
  • 1
    It seems that way. It would be a shame if an organization legitimately needed an SRIS in the 910000-998999 space, but it's probably very unlikely to happen. We would probably end up just using a 'user custom' SRID as a type of proxy anyway. Oracle did this (for who knows what reason) by creating SRID:8311 as an alias for 4326. DBMS developers really seem to have a way with SRIDs. – nagytech May 25 '15 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.