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).

Jusqu’à maintenant, aucune des modifications que nous avons apportées à la carte ont été influencées par les objets qui sont représentés. En d’autres termes, toutes les zones d’occupation du sol se ressemblent, et toutes les routes également. En regardant la carte, les observateurs ne savent rien à propos des routes qu’ils regardent ; seulement qu’il y a une route d’une certaine forme à un certain endroit.

Mais toute la force des SIG est que tous ces objets visibles sur la carte ont également des attributs. Des cartes dans un SIG ne sont pas uniquement des images. Elles ne représentent pas seulement des objets dans des endroits, mais également des informations sur ces objets.

L’objectif de cette leçon : Étudier la structure de données vectorielles et explorer les données attributaires d’un objet

3.1.1. basic Follow Along: Visualisation des attributs d’une couche

Il est important de comprendre que les données avec lesquelles vous êtes en train de travailler ne montrent pas seulement ces objets se trouvent dans l’espace, mais aussi vous informent sur ce que sont ces objets.

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.

    Note

    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.

Vous pouvez maintenant fermer la table d’attributs.

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

Vous savez maintenant comment utiliser la table d’attributs pour étudier les données que vous utilisez. Les jeux de données seront seulement intéressants lorsqu’ils comporteront des attributs qui vous concerne. Si vous savez de quels attributs vous avez besoin, vous pouvez savoir rapidement si vous serez capable d’utiliser un jeu de données spécifiques ou si vous avez besoin d’un autre qui dispose des données nécessaires.

3.1.4. What’s Next?

Des différents attributs sont utiles à différentes fins. Certains d’entre eux peuvent être représentés directement sous forme de texte dans la carte que voit l’utilisateur. Vous apprendrez comment faire cela dans la prochaine leçon.