QGIS-like dialog for PostGIS layer selection
--------------------------------------------

                 Key: UDIG-1134
                 URL: http://jira.codehaus.org/browse/UDIG-1134
             Project: uDIG
          Issue Type: Improvement
          Components: postgis
    Affects Versions: UDIG 1.1.RC6a
         Environment: any
            Reporter: Martin Jansche
         Assigned To: Jody Garnett
            Priority: Minor


The PostGIS table selection dialog is a bit unusual to me, having worked with 
QGIS before.  First, I'd like to be able to select tables from multiple schemas 
at the same time. Second, I only want to see tables with one or more geometry 
columns (if a table has multiple geometry columns, it should be listed multiple 
times). Third, relying exclusively on the OpenGIS table GEOMETRY_COLUMNS will 
not suffice, because that table won't include views.  Here's a query I would 
suggest for retrieving the tables and views with geometry columns, based on, 
but not completely identical to, what QGIS does:

SELECT pg_namespace.nspname AS "Schema", pg_class.relname AS "Name", 
pg_attribute.attname AS "Geometry Column"
   FROM pg_attribute, pg_class, pg_type, pg_namespace
  WHERE pg_type.typname = 'geometry' AND pg_attribute.atttypid = pg_type.oid 
AND pg_attribute.attrelid = pg_class.oid AND pg_namespace.oid = 
pg_class.relnamespace AND (pg_class.relkind = 'r' OR pg_class.relkind = 'v');

The result of this query could be incorporated into the PostGIS table dialog 
more or less directly. I'm picturing a first dialog window asking for the host, 
port, database, role, and password. With that information, a connection can be 
opened and the above query can be issued. Then the next dialog window would 
display a list with three columns (schema, table/view name, geometry column) 
allowing the user to select any number of layers to include.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to