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:
Labels window:
![enter image description here
EDIT: using ELEVATION instead of ID doesn't display the altitude
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.
Here's the attribute table of the layer:
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.