[Qgis-user] load data in Qgis by a query on geom column

haubourg regis.haubourg at eau-adour-garonne.fr
Fri Oct 26 04:55:05 PDT 2012


Pietro Rossin wrote
> Which query builder? the one that is on the add postgis vector data? With
> that I can only select item from a table, not execute query on geometry
> column, right?
> 
> Thankyou all
> Pietro

In Layer properties / query, you can use whatever SQL you want if it is
understood by Postgis and it is only a where clause. 
I often use subqueries that way: 
Let's assume your table has a my_id field , you want to filter geometry
objects bases on postgis functions. You can sub filter object whith such a
clause in query builder: 

my_id in (select distinct my_id from mytable where st_xmin(the_geom) >=
2317035 and st_xmax(the_geom) <= 2330326 )

I even could use very complex recursive queries that way.. No Limit... Just
on of the greatest aspects of using spatialdatabases with QGIS... 



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/load-data-in-Qgis-by-a-query-on-geom-column-tp5011161p5011517.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list