官术网_书友最值得收藏!

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'
If you have a very large GeoNames table, don't apply the filter at this point. It will be enough if you apply it after we extract a subset you can work with.
主站蜘蛛池模板: 高州市| 安图县| 青浦区| 宁远县| 木里| 海门市| 汝阳县| 兰州市| 赞皇县| 仙游县| 瑞昌市| 山东省| 曲水县| 中卫市| 林芝县| 沅江市| 如皋市| 泽州县| 博客| 金川县| 汝南县| 周宁县| 乐清市| 周宁县| 汽车| 翁源县| 林甸县| 改则县| 巩义市| 汽车| 湟源县| 十堰市| 邯郸市| 仪征市| 雷州市| 渭南市| 淮滨县| 治多县| 宝应县| 湘乡市| 碌曲县|