- Practical GIS
- Gábor Farkas
- 251字
- 2021-07-02 22:49:16
Filtering layers
The filtering dialogue can be accessed by right-clicking on a layer in the Layers Panel and selecting Filter. As we can see in the dialogue, filtering expressions are much more restrictive in QGIS as they only allow us to write basic SQL queries with the fields of the layer. Let's inspect our study area in the administrative boundaries layer with the Identify Features tool, select a unique value like its name, and create a query selecting it. For me, the query looks like the following:
"NAME_1" = 'Baranya'
Applying the filter removes every feature from the canvas other than our study area:

Now the only feature showing up on the canvas is our study area. If we look at the layer's attribute table, we can only see that feature. Now every operation is executed only on that feature. What we cannot accomplish with filtering is increasing the performance of subsequent queries and analyses. Rendering performance might be increased, but, for example, opening the attribute table requires QGIS to iterate through every feature and fill the table only with the filtered ones.
Let's practice filtering a little more by creating a filter for the GeoNames layer, selecting only points which represent first-level administrative boundaries. To do this, we have to supply the following query:
"featurecode" = 'ADM1'
- 手機安全和可信應用開發指南:TrustZone與OP-TEE技術詳解
- Software Testing using Visual Studio 2012
- 趣學Python算法100例
- Swift 3 New Features
- Python神經網絡項目實戰
- 精通Scrapy網絡爬蟲
- 深度學習:算法入門與Keras編程實踐
- Getting Started with Laravel 4
- HTML5與CSS3基礎教程(第8版)
- SQL 經典實例
- C#程序設計教程(第3版)
- Mastering Python Design Patterns
- Machine Learning for Developers
- 現代C:概念剖析和編程實踐
- 監控的藝術:云原生時代的監控框架