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

Selecting data

Selecting data is very useful in GIS. We can create a new layer from a selection, or we could add new data specific to that selection. QGIS allows multiple ways of selecting data, and we will cover some of these here. Later, in Chapter 6Extending QGIS with Python, we will look at spatial selections. The data attributes toolbar allows selecting by area (this means drawing on the map by hand) and selecting by value (this means passing a query to select the data). The selection tools are highlighted in the following screenshot:

The select data tools

Working from left to right, the tools are Select by Area, Select by Attribute, and Clear Selection. Click on the Select by Location button and click on the largest area associated with the Alaska layer. It will change to yellow to highlight the selected layer. The following screenshot shows the other Select by Area options in the drop-down list:

Feature selected in QGIS

Click on Clear Selection to remove any selections from the layer.

The Select by Value button is the second button on the toolbar described previously. Click on this button to open a new window:

Map showing the selected features by value option

In the Select Features by Value window, we have clicked on the Exclude field button associated with AREA_MI and selected Less than or equal to (<=). As a parameter, we have typed 1000 into the box. We then clicked Select features and QGIS selected the features that match this expression. At the top of the screen, a notification tells us how many features have been selected. In this case, it is 640.

If we click on close and then press F6 or click on the button immediately to the right of the Clear Selection button, the attribute table will appear with the selected rows highlighted. This attribute table for the Alaska layer is shown as follows:

Attribute table with features selected

When you are finished inspecting this table, close it down by clicking the close button, on Windows this is an Χ symbol in the top-right corner. Keep this selection handy, as we will use it in the next section.

There is one more very useful tool worth mentioning, and that is the Field Calculator tool. This button looks like an abacus and is next to the Attribute Table button. We will use this tool next to begin creating our own data.

主站蜘蛛池模板: 淳安县| 济南市| 太仆寺旗| 当阳市| 玉门市| 荃湾区| 高邑县| 东山县| 林甸县| 郸城县| 舒城县| 巴东县| 双城市| 雅安市| 怀来县| 惠水县| 信丰县| 新丰县| 泾源县| 柳江县| 子洲县| 东海县| 太仓市| 邳州市| 北票市| 准格尔旗| 恩施市| 平江县| 鄱阳县| 洞口县| 贺州市| 萨迦县| 河源市| 克山县| 彩票| 宜君县| 安宁市| 友谊县| 眉山市| 普兰县| 偏关县|