[Gdal-dev] PG-Driver supporting no views?

Frank Warmerdam warmerdam at pobox.com
Fri Apr 23 09:21:13 EDT 2004


Tyler Mitchell wrote:
> Is this just because there isn't an entry in geometry_columns?
> 
> Tyler

Tyler,

The OGR PG driver isn't restricted to stuff that appears in GEOMETRY_COLUMNS.
I use the following magical query to get a list of tables that can be treated
as layers:

                          "DECLARE mycursor CURSOR for "
                          "SELECT relname FROM pg_class "
                          "WHERE relkind = 'r' AND relname !~ '^pg'" );

I think I copied that from somewhere else originally.  The GEOMETRY_COLUMNS
is currently only used to lookup SRID values.

So I think the problem is that my query only idenfies proper tables, not views.
If anyone can suggest an appropriate change to pick up queries too, I can update
it more easily.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list