[postgis-devel] Valid SRIDs
Kevin Neufeld
kneufeld at refractions.net
Wed Jun 25 22:18:50 PDT 2008
Not to long ago in the bug tracker, a user suggested that
ST_AddGeometryColumns() should error out if the supplied SRID is not in
spatial_ref_sys.
What does the team here think? Should PostGIS be responsible for
ensuring correct parameters? (We currently raise exceptions for all
other invalid parameters). If so, the solutions I see are:
1. Modify the plpgsql function to error if the SRID does not exist
2. Put a foreign key constrain on geometry_columns referencing
spatial_ref_sys.
Essentially, if we do this, loading spatial_ref_sys into PostGIS will no
longer be an optional part of the install process. This also means that
we'll have to add a dummy record for an SRID of -1 and perhaps 0.
Personally, I'm undecided. I like enforcing data integrity - it has
saved me many times in the past ... not to mention it's good practice.
But putting the onus on the user also has it's pros.
Thoughts?
-- Kevin
More information about the postgis-devel
mailing list