1

I am trying to merge two height maps in QGIS.

I have DEMs of the lake of constance in germany. It is a result of a goverment project and the data is available in a asc format. I want to 3dprint a landscape relief model. Also i need to split that model into pieces (200x200mm) to print it in blocks for a total length of 1000cm.

There is no problem to import the data in Qgis, also it is no problem to split the height maps into pieces for 3d printing. The fun begins when i try to merge the two DEMs into one. The DEM of the surrounding area ends where the lake begins.

Is it possible to "insert" the lake into the image of the surrounding area and recolor it?

The deepest point in the new DEM should be the darkest in the whole new DEM. At the end i need a single height map. --> Target: DEM of the whole area wir a dried of lake.

Lake plus surrounding area Shows the lake in the middle plus the surrounding area.

surrounding area without lake

Shows only the surounding area

enter image description here

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
  • 2
    We call them "heightmaps" or "DEM"s (digital elevation models). Is the map of the lake showing the depth of the lake? Lakes in a heightmap are usually flat surfaces at the lake's water level. You want to show the landscape as if it was dried up? What are the two images? – Spacedman May 11 '18 at 15:34
  • Yes it shows the depth of the lake an also yes i want to show the whole relief ,later in the print, with the dried up lake. – Jan Grübert May 11 '18 at 15:38
  • the first image shows the surrounding area with the lake in the middle. the second image shows only the surrounding area. This image ends in the middle at the starting level of the lake. in this area the map is just flat. – Jan Grübert May 11 '18 at 15:40

2 Answers2

2

I found the SAGA module "Mosaic raster layers" very useful to merge a lake bathymetry with a topographic elevation model.

Processing > Toolbox > Mosaic raster layers

You have to choose the right classifying option in "Overlapping Areas" to use the bathymetry values where both rasters overlap.

Both rasters must have the same SRS, same pixel size and be referred both to the same reference surface .

Dbran
  • 21
  • 3
1

I think that you mean "elevation map" by "high map", right?

You probably want to combine the two sets of elevation (height) data into one by subtracting the lake depth (negative height) from the smaller set of elevation data from the larger set, where the lake is treated as flat but the surrounding mountains are included?

If I understand you correctly, then you want to use the Raster Calculator (or Rastererrechner) to subtract the lake DEM (digital elevation model) from the larger DEM.

Zack
  • 1,105
  • 9
  • 15
  • Hi :D Yes that is what i want. It is really hard to find the right and specific words when you are not an expert on this kind of programs. I try my best. I try this function now. :) – Jan Grübert May 11 '18 at 16:05
  • You did pretty darn well! Aside from a few technical words, your English was extremely good. – Zack May 11 '18 at 16:14
  • Thanks! do you think this is the right operation: "LC_All_20151210_ETRS89_3m_ac_int@1" - "output_srtm@1" (LC_ALL is the lake and Output_srtm is the surrounding area) – Jan Grübert May 11 '18 at 16:16
  • no success... after the operation i have now a new layer in my panel but it shows up nothing. When i open the layer it says "nan" by black and white..... – Jan Grübert May 11 '18 at 16:23
  • You probably want to subtract the lake from the mountains, so reverse. It also depends on your data. If your lake data is in depth (distance from the lake surface to the bottom), then you're good to go. If the lake is just the elevation of the lake bed then to get the correct value to subtract you probably need to do something like ' "mountain"-((lake surface in meters)-"lake") ', does that make sense? – Zack May 11 '18 at 16:23
  • Another option for you that may be easier is to clip (erase) the lake data from the mountain DEM and then merge (add) your lake DEM. Both data sets need to be the same format for this (i.e. both are in meters above sea level, so if the lake is in meters from the surface you need to fix it first).

    to clip: https://gis.stackexchange.com/questions/165334/cut-part-of-raster-with-another-raster-mask

    to merge: https://gis.stackexchange.com/questions/25499/joining-several-raster-files-using-qgis

    – Zack May 11 '18 at 16:25
  • That is exactly my problem. The outline of the lake must be the deepest point from the surrounding mountain area. The colors had to be recolored. So the lake starts at the bottom of the mountain map (in the deepest black Area and goes in - direction. The mountain map starts at the whitest point (Outline of the Lake) and gos up in + – Jan Grübert May 11 '18 at 16:39
  • i also thought about the option to erase the lake area from the other mountain Area and merge it later back in the "hole" but there you also have to "recolor" or re calculate the heights. The STL Builder (for the 3d stl models) calculates the area by using the colors. – Jan Grübert May 11 '18 at 16:46
  • You will need to get both data sets in the same format no matter what you do. Pick one (the smaller one is better: shorter processing time!) and get it to be like the other. Use raster calculate for this: [New Lake] = [Old Lake]+[Lake Surface (m)] – Zack May 11 '18 at 16:49
  • 1
    ok, i try to get both sets in one format first. Thank you :) – Jan Grübert May 11 '18 at 16:54
  • Wait, I'm sorry. You should be able to subtract the lake from the mountains if your data is like that. Maybe you need to make sure that both rasters overlap before doing the calculation? – Zack May 11 '18 at 17:09
  • how do i overlap the layers? I now have both in Geotiff format. – Jan Grübert May 11 '18 at 17:26
  • Merging rasters: https://gis.stackexchange.com/questions/25499/joining-several-raster-files-using-qgis

    Official doc: http://www.qgistutorials.com/en/docs/raster_mosaicing_and_clipping.html

    – Zack May 11 '18 at 17:31
  • no sucess again. Can it be that difficult? I think it is also not a normal job for qgis isnt it? When do you ever add a DEM UNDER.... a other DEM? that dosent make sense?! May some photoshop specialist can help :D do you know some? :D – Jan Grübert May 11 '18 at 18:10
  • No don't use photoshop! You need that spatial information. Did you try merging? What happened? – Zack May 11 '18 at 18:38
  • I tried to merge and got this error: Traceback (most recent call last): File "C:\PROGRA~1\QGIS2~1.16\bin\gdal_merge.py", line 540, in sys.exit(main()) File "C:\PROGRA~1\QGIS2~1.16\bin\gdal_merge.py", line 470, in main band_type, create_options ) File "C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\osgeo\gdal.py", line 1427, in Create return _gdal.Driver_Create(self, args, *kwargs) TypeError: in method 'Driver_Create', argument 4 of type 'int' – Jan Grübert May 11 '18 at 19:06
  • i also tried to create a virtual raster and got this error: 2018-05-11T21:08:56 1 Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\GdalTools\tools\widgetPluginBase.py", line 88, in onFinished self.base.onFinished(exitCode, status) File "C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\GdalTools\tools\dialogBase.py", line 208, in onFinished msg = unicode(self.process.readAllStandardError()) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 116: ordinal not in range(128) – Jan Grübert May 11 '18 at 19:10
  • I don't know what this is about. There is a disconnect between the code that runs the tool and your inputs, but its unclear to me which side is the problem. You may be able to get around it by encoding your input rasters differently, say by converting them to another file type before merging?

    Maybe there is an issue with your qgis installation? I see some similar issues around the web, (https://github.com/tomchadwin/qgis2web/issues/454) so I'd try upgrading to QGIS 2.18 or QGIS 3 and see if that helps.

    – Zack May 11 '18 at 19:26