3.1. Lesson: Vector Attribute Data

Vector data is arguably the most common kind of data in the daily use of GIS. The vector model represents the location and shape of geographic features using points, lines and polygons (and for 3D data also surfaces and volumes), while their other properties are included as attributes (often presented as a table in QGIS).

今までは、地図に行った変更はどれも、表示されているオブジェクトに影響されませんでした。言い換えれば、すべての土地利用エリアが同じように見え、そしてすべての道路が同じように見えます。地図を見る人とき、人は見ている道路については何も知りません。知っているのは何らかの地域に何らかの形状の道があることだけ。

しかし、GISの全体強みは、地図上に表示されるすべてのオブジェクトが属性も持っていることです。GISでの地図はただの絵ではありません。それらは場所内のオブジェクトだけでなく、それらのオブジェクトに関する情報も表しています。

The goal for this lesson: To learn about the structure of vector data and explore the attribute data of an object

3.1.1. basic Follow Along: レイヤー属性を表示する

作業しているデータは、オブジェクトが空間の どこ にあるかを表すだけでなく、それらのオブジェクトが であるかを語っていることも、知っておくことが重要です。

From the previous exercise, you should have the protected_areas layer loaded in your map. If it is not loaded, then you can find the protected_areas.shp ESRI Shapefile format dataset in directory exercise_data/shapefile.

The polygons representing the protected areas constitute the spatial data, but we can learn more about the protected areas by exploring the attribute table.

  1. In the Layers panel, click on the protected_areas layer to select it.

  2. In the Attributes Toolbar click the openTable Open Attribute Table button. This will open a new window showing the attribute table of the protected_areas layer.

    ../../../_images/attribute_data_preview.png

    A row is called a record and is associated with a feature in the Canvas Map, such as a polygon. A column is called a field (or an attribute), and has a name that helps describe it, such as name or id. Values in the cells are known as attribute values. These definitions are commonly used in GIS, so it is good to become familiar with them.

    In the protected_areas layer, there are two features, which are represented by the two polygons we see on the Map Canvas.

    注釈

    In order to understand what the fields and attribute values represent, one may need to find documentation (or metadata) describing the meaning of the attribute values. This is usually available from the creator of the data set.

Next, let's see how a record in the attribute table is linked to a polygon feature that we see on the Map Canvas.

  1. Go back to the main QGIS window.

  2. In the Attributes Toolbar, click on the selectFeature Select Feature button.

  3. Make sure the protected_areas layer is still selected in the Layers panel.

  4. Move your mouse to the Map Canvas and left click on the smaller of the two polygons. The polygon will turn yellow indicating it is selected.

    ../../../_images/select_polygon.png
  5. Go back to the Attribute Table window, and you should see a record (row) highlighted. These are the attribute values of the selected polygon.

    ../../../_images/select_record.png

You can also select a feature using the Attribute Table.

  1. In the Attribute Table window, on the far left, click on the row number of the record that is currently not selected.

    ../../../_images/select_record2.png
  2. Go back to the main QGIS window and look at the Map Canvas. You should see the larger of the two polygons colored yellow.

  3. To deselect the feature, go to the Attribute Table window and click on deselectAll Deselect all features from the layer button.

Sometimes there are many features shown on the Map Canvas and it might be difficult to see which feature is selected from the Attribute Table. Another way to identify the location of a feature is to use the Flash Feature tool.

  1. In the Attribute Table, right-click on any cell in the row that has the attribute value r2855697 for the field full_id.

  2. In the context menu, click on Flash Feature and watch the Map Canvas.

    ../../../_images/flash_feature.png

    You should see the polygon flash red a few times. If you missed it, try it again.

Another useful tool is the Zoom to Feature tool, that tells QGIS to zoom to the feature of interest.

  1. In the Attribute Table, right-click on any cell in the row that has the attribute value r2855697 for the field full_id.

  2. In the context menu, click on Zoom to Feature

    ../../../_images/zoom_to_feature.png

    Look at the Map Canvas. The polygon should now occupy the extent of the Map Canvas area.

ここで属性テーブルを閉じてください.

3.1.2. basic Try Yourself Exploring Vector Data Attributes

  1. How many fields are available in the rivers layer?

  2. Tell us a bit about the town places in your dataset.

  3. Open the attribute table for the places layer. Which field would be the most useful to represent in label form, and why?

Check your results

3.1.3. In Conclusion

これで使用しているデータ中に実際に何があるかを見るために属性テーブルを使用する方法がわかりましたね。どんなデータセットでも有用なのは気になる属性を持っている場合だけでしょう。どんな属性が必要かを知っていれば、与えられたデータセットが使用できるかどうか、あるいは必要な属性データを持つ別のデータセットを探す必要があるか、すぐに判断できます。

3.1.4. What's Next?

異なる属性は異なる目的のために有用です。それらのいくつかは、地図のユーザーが見るテキストとして直接表現できます。次のレッスンでこれを行う方法を学びます。