2

I am a real beginner with QGIS 2.8. I am able to generate a contour map from a raster DEM, but the contour map is very 'busy' because the land form is pretty flat. There are lots of short contour loops that clutter up the output which would be easy to remove if there was a way to select all contours greater than a certain length. QGIS is able to determine the contour length if I inspect a particular contour line, but this is a 'derived' value, and I do not find a way to use this derived value as a selection criterion.

  • Welcome to GSE ! Please try to add more context with the DEM source (if possible) and the tools used under QGIS. Have you a particular reason for begin with QGIS 2.8 ? If you want to learn using QGIS, I recommend you to start with the latest LTR 3.4 : qgis.org/en/site/forusers/download.html – J. Monticolo Mar 28 at 12:23
  • Can you please explain what GSE stands for.I would start with 3.4 but am nervous of installing programs that haven't made it to my distributions repository – John_Beatty Mar 28 at 15:49
  • GSE stands for Gis Stack Exchange, this site ! Since 2.8, QGIS have made great updates. – J. Monticolo Mar 28 at 16:23
  • I bit the bullet, upgraded from Mint 18.2 to Mint 19.1 and now have QGIS 3.6 installed. Thank you for your suggestion. – John_Beatty Mar 29 at 18:07
3

There are several way for that

If you just want to select line shorter than 500 you could use $length <500 (or $perimeter <500 if you're working with polygons) as an expression in the select by expression (the 500 is the length in the layer CRS unit, if you want 500m made sure to use a projected CRS whose unit is meters)

Alternatively you could calculate a length field in the attribute table using $length as expression (you could either create a new field (no auto-update if you edit the line but the value are added to your layer) or create a virtual field (auto-update on edit but the value only exist in this specific QGIS project, also usefull if you don't have edit rigth and can't add a new field).

After calculating the lenght you could select or symbolise by attribute as usual

  • Fantastic! Using 'Processing Toolbox' > 'GQIS geoalgorithms' > 'Vector selection tools' > 'Select by expression' and putting in your suggested query I have got exactly what I wanted. Thank you – John_Beatty Mar 28 at 15:53
  • OK, done. I had to look up on Google to find out how to do this! – John_Beatty Mar 28 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.