Limit the display of contour lines

You can filter the features you want to display based on an attribute (like elevation in your case, I guess).

Set the layer to rule based rendering and define a rule when a feature should be visible. I have six lines with an attribute elevation with values 100, 200, 300, 400 500 and 600. To display only intervals of 200 m, I define a filter rule: "elevation" % 200 = 0 to get only the red lines. % is the operator for remainder (modulo operation): I want to display the lines with elevation value that can be divided by 200 without remainder. Use any other filter condition that fits your needs: the whole complexity of QGIS expressions is at your disposal to define tailor-made conditions/filter rules.

Just for visualization purpose (to "prove" that the layer is really filtered and contains more lines), see the black dottet symbol for all other lines. Clicking the checkbox next to each symbol, you can hide every rule based symbol.

enter image description here


this problem is caused because of at the edge of the TIN there are invalid values or values that will out put errors due to no data beyond this point.

best option is to

  • create the contour layer little lager
  • and draw a extents of the required area in a new layer
  • then Vector Overlay > Clip the contour layer from the newly created raster via processing tool box

enter image description here

or

at the time of the creation of the contour with the use of GDAL > Raster Extraction > Contour please do not tick the box Advance Parameters > treat all raster values as valid

enter image description here

do not tick the box Advance Parameters > treat all raster values as valid as by not ticking this will eliminate blunders and gives a smoother contour lines.

enter image description here

example - enter image description here

Tags:

Qgis