[Qgis-user] Select by attributes

Carson Farmer carson.farmer at gmail.com
Fri Dec 12 03:02:57 PST 2008


Mats E.,
> What would be the simplest way to select elements by their geometric 
> attributes in QGIS?
>
> In MapInfo, the SQL select string I need would look like this:
>
> select * from TableName where Area(obj, "sq km") > .5
>
> As a workaround, I could populate an 'area' column in the table, but I 
> would still need an Area() function to do that.
If you download fTools, there is an 'add/export geometry info' tool 
which will calculate area for you, and add it to the attribute table of 
your layer (actually, it just creates a new layer with this field in it).
>
> Please do not suggest compiling this and that library from hist and 
> here because this is a question from a vanilla QGIS user.
> Other than that, any help is appreciated.
No compiling or extra packages required! Just download and install. See 
http://www.ftools.ca/ for download links and installation instructions.

If I *was* going to suggest going a step further, I'd suggest using a 
PostGIS database, which allows you to do this quite easily, and it's a 
great way to store and manage your data anyway! ;-)



More information about the Qgis-user mailing list