[GIS] Labelling contour lines in QGIS

contourlabelingqgis

I need to label contour lines in QGIS 2.14. I've tried a few things, including Choosing only one contour line to label in QGIS? but it labels with the IDs instead of altitude.

EDIT: I've created the contour lines using this method : loaded an MNT (RGEALTI from IGN in France that contains altitude data), then menu raster / extraction / contour
Here's the MNT image:
enter image description here

enter image description here

Labels window:

enter image description here

![enter image description here

EDIT: using ELEVATION instead of ID doesn't display the altitude
enter image description here

EDIT: I went again through the process of extracting contour lines (raster/extraction/contour lines) but this time I added a name to the attribute as suggested below by Gabriel C. And there is an error during the process. enter image description here
Here's the attribute table of the layer:
attribue table

Best Answer

I feel the error comes from your contour generation. If you didn't set an elevation attribute name, the attribute gets skipped and you have no way to define what elevation your contours are at. Make sure the name respects shapefile requirements (no accents, no spaces, maximum 8 characters) to avoid problems.

enter image description here

Related Question