If you assume I know little to nothing about QGIS 3.10, but have been attempting with some success to create fictional world maps with it, and that I have very limited (OpenScript and Excel) programming skill, perhaps the imprecise technical nature of my question will make more sense!

I am creating Raster files to serve as DEM files.

My process is to create a a set of polygons (within a multi-polygon shapefile layer) for elevation contours.

I have tried starting the coastline contour as elevation 0, elevation 1 and elevation 10

I have used elevation (contour) intervals of 100

I then use Vector/Geometry Tool/ Extract Vertices and get a series of points along each polygon perimeter.

I use the Processing Toolbox / Vector Geometry/ Add Geometry Attributes tool to create x,y,z coordinates for each point

I have then gone into the attribute table, selected all of the points, used the multi edit tool and set zcoord = to elevation

I then have either created contours from the data, or just used the points themselves with similar results, and completed a TIN interpolation.

The raster files are sufficient to create a decent 3-D map, but the triangulation plays havoc with my coastline (the 0,1 or 10 elevation contour) as shown in the photo. enter image description here

You can see the triangles departing the coastline, which produces a raster that doesn't really show the coast at all. I have added a second photo to demonstrate and you can see the triangles jutting off the coastline in the raster file

enter image description here

I am certainly committing some error in this process and wondering if anyone can direct me to a tutorial or provide some suggestions for how to create a more precise coastline.

I have not yet attempted creating a -100 contour around the island and then a 0 elevation coastline.

Here it is after implementing Gabriel De Luca's suggestion about adding points where sections of the polygons were excessively long unbroken lines. enter image description here

2 Answers 2


In some sectors of the coastline, the vertices are far apart from each other, so the triangulation finds triangles that cross over the coastline.

Densify by count the coastline. Add only one point for each segment. Extract the vertices and interpolate again. If it is not enough, densify it again by adding one more point per segment.

In TIN interpolation, you can show triangulation instead of interpolation, as a previous step, to see where interpolation is taking place.


  • Thank you Gabriel! That makes total sense looking at the map - those errant triangles occur where I had long stretches of unbroken segments in the polygon edge. I will add points and try it again. I will now also do more research on interpolation and triangulation. Commented Nov 17, 2019 at 13:56
  • 1
    @ReallyNewUser You are welcome! Automated triangulation algorithms follow the Delaunay triangulation method, considering all the points belonging to a plane. Elevations are then interpolated following each side of the generated triangles. The addition of break and structure lines should avoid unwanted triangulations, but I am not totally satisfied with the way these restrictions are taken into account, at least in QGIS TIN interpolation algorithm. Commented Nov 17, 2019 at 14:12
  • it worked very nicely! Thank you for the help. Commented Nov 18, 2019 at 15:57

Before you go into this work, check if data isnt avalible already. You can get 90 m DTM for the whole world here: http://www.webgis.com/srtm3.html. Also 30m is avalible for some reagions, as far as i know for US and Europe..

Basically your 0 m contour is the coastline. You can convert it to polygon and clip raster with it. Think this is the most reliable way of getting exact coastline you wanted. If i was doing this task, workflow would be:

-draw polygon for each contour, layer would include column "z" for hight of each contour

-extract vertices (each point should already have height attribute from step 1) -TIN interpolation (in SAGA Tin plate spline you can select attribute column, dont need actual point z coordinate)

-Clip raster by mask layer (select coastline, so 0 m contour and use it to clip "bleeding" Dem with it.)

  • Cliping the result does not solve the topographic error caused by interpolating a point in the territory with a point on the coast on the other side of a water mirror. Commented Nov 17, 2019 at 9:25
  • Thanks for your answer, Mat. As I am not using real world data, the first part won't apply. I will test out the other settings you mention - I have found that the stretch and clip setting has given me the best results but I will try the combinations you suggest. Commented Nov 17, 2019 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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