[postgis-users] geometry_columns & LW_GEOM
dblasby at refractions.net
Fri Mar 19 10:34:49 PST 2004
> On Thu, Mar 18, 2004 at 07:08:15PM -0800, Dave Blasby wrote:
>>Quoting Ralph Mason <ralph.mason at telogis.com>:
>>>Why does it need it?
>>The ogc spec says it has to be there...
> Do you think we could make it a view ? I've made some research some
> time ago on this.
> If we make use of custom DOMAINs we could detect geometry type and nDims
> and also stick type-constraint to the domain instead of the table
> (OGCPolygon2d, OGCPolygon3D, etc)
> What remains is the SRID value, which still needs to be written somewhere
> custom_datatype(custom_parameter) support has been discussed
> on pgsql-hackers, but I do not know if something moved on since then.
> That syntax would allow to specify a SRID which would be put in
> the pg_attribute table for public use.
> News from that front Mark ?
I think we could make a geometry_columns table thats a view. We'd need
to have a metadata-table with type and SRID information in it. We could
then create geometry_columns as a join between the metadata-table and
the pg_class table.
For example, the SRID could be "discovered" by looking:
a) in the metadata table
b) looking for a constraint on the geometry table/column
c) doing a "SELECT getSRID(<column>) FROM <table> LIMIT 1"
** NOTE: this query can sometimes take an awfully long time
(even thought it shouldnt)!
More information about the postgis-users