[GIS] How to use a .kml file to create a 3D mesh from contours

contourgoogle earthkmlqgis

I have downloaded a .kml file from this source: http://www.carpworld.co.za/index.php/dam-contours/boskop-dam.
This is how it looks in Google Earth:

enter image description here

This file contains contours of Boskopdam (a local lake). The contours don't have height data/attributes, or non that I am aware of, but the task I'm trying to complete is converting or displaying these contours in a 3D fashion like this:

enter image description here

I've seen a few videos on how to use a .dem file in Blender to create a 3D mesh, but thats about all I know.

I have QGIS and have little to no knowledge on using it.

Best Answer

To expand on GBG's answer, here are some details about how to proceed in QGIS.

QGIS may not be able to edit a layer in KML format. You'll know that QGIS can't edit your layer if you can't click the edit button edit button in the digitizing toolbar. If that's the case, export to a different vector format, eg shapefile.

explode the multi-part features to single features

Follow the method explained here: Exploding multipart polygons within shapefile in QGIS?

Use the PDF to manually assign elevations to the lines

Add a numerical attribute table field and start adding data to the corresponding features. Since a numerical field cannot store units of measure, it may be useful to include that in the field name. For example, if your elevation is in meters, you could call the field "Elev_m."

See the relevant section of QGIS manual for more details.

Optional: Try one of these methods to make it easy to see at a glance which contours have elevation assigned, and which still need it.

  1. Label the layer with the new elevation field.
  2. Set up rule-based styling, so that contours without elevation data are one color, and contours with elevation data are another color. Eg, set up one style with the rule "Elev_m." is not null, and a second style with the rule ELSE
  3. Set up conditional formatting of the attribute table to highlight rows where the elevation field is blank.

Be sure to save your changes to the layer once you're done. Note that QGIS has two different save buttons: one for the QGIS project, one for layer edits.

Some of the methods for the next step (interpolating a surface/creating a TIN) require points instead of lines, eg Creating Tin from Elevation Points in QGIS?

To convert your contours to points, use the Extract Vertices tool from the processing toolbox. How to convert a line to points?

Note: the contours were probably created from elevation point data. By converting the elevation point data to contours and back to points again, you've lost a lot of the details of the original information. If you can acquire the original point data, your results will be more precise.