6

I am following a tutorial with which to create Tanaka contours from: Tanaka Contours.

I used contour with the default 10 increments setting. Below are the raster and resulting contours.

Raster enter image description here

Following this I used V.split to break up the segments and used max 2 vertices. I then used this equation in the advanced python calculator to get azimuth:

formula

At which point I styled the resulting calculated layer with this expression: expression

Here is the result of that:

Doesn't look like Tanaka

Clearly, I'm doing something wrong. I just have no idea what that would be. Can anyone shed some light?

4

First off, it's funny because when I saw your DEM, I knew exactly where it is instantly, that's my hometown.

There is a much simpler solution that I developed when I wasn't able to use the method you tried. No need to break the features into bits, no scripting or GRASS tools, just plain rendering tricks.

First off, you need to have a simple fill symbology on the layer. If your isolines are of type line, you'll need to polygonize them with a suitable processing tool. Two can give the right result:

  • Lines to polygons will yield polygons with no voids which means a closed contour inscribed in another will overlap. This isn't problematic but it will require an additional rendering step to work.
  • Polygonize will yield non-overlapping polygons. This will save a rendering step further along the way but the layer will be composed entirely of doughnut polygons, which might not be ideal for certain tasks.

When you have a polygon layer, choose graduated symbology type and set the gradient according to the contour elevation field. This works best if you want discrete color steps. Then,

  • Go to your isoline layer properties, then to the symbology tab.
  • Open the symbol selector dialog
  • At the bottom, tick the draw effects checkbox
  • Then click on the customize effects button

From there, you can play around. In the case of the project in my screenshot, I used two drop shadows, one white at -45° and one black at 135°. You can play around with the offset distance to achieve the boldness you want.

Optional: If your isoline layer contains overlapping polygons (for example resulting from the lines to polyons tool), there's one setting left to set for the whole thing to work correctly: in the main layer properties, go to the layer rendering section and tick the control feature rendering order checkbox, then open the corresponding dialog and set the controlling data field to whichever contains the elevation values, ordering it as ascending. That way, features will get rendered progressively from the bottom up. That's pretty much it!

Tanaka contours example

  • Brilliant! Quick, easy, and fun! – Kazuhito Jun 9 '18 at 14:05
  • How can you have simple fill symbology on isolines? – Miro Aug 23 at 4:22
  • 1
    @Miro I should have specified that you need to polygonize your isoline layer beforehand. I'm going to modify. – Gabriel C. Aug 23 at 12:36
  • 1
    Thank you for tips on conversion. In my case lines to polygons failed - there are obviously errors in geometries - contours not enclosed, self intersecting etc. So I guess I'll better go with raster to vector conversion - polygonize and hopefully finally get that beautiful effect. – Miro Aug 24 at 14:34

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.