Page 18 of 19

Re: How To: Generate Superb Heightmaps :)

Posted: 12 Jul 2016 05:51
by Keplergamer
An HM I made for Train Fever that can also work here. Expect more to come soon. Also. Transport-fever.net is a great source for PNG heightmaps.

Re: How To: Generate Superb Heightmaps :)

Posted: 15 Jul 2016 20:59
by Keplergamer
Another 2, one with erosion applied and the other not. This time I tried to make it using a scale that suits OpenTTD maps, not train fever. OpenTTD 4k maps are like 30x bigger.

Try around 150-100 usable height for a 4K x 4K map.

Re: How To: Generate Superb Heightmaps :)

Posted: 15 Jul 2016 21:06
by Eddi
you forgot the attachments.

Re: How To: Generate Superb Heightmaps :)

Posted: 16 Jul 2016 02:31
by Keplergamer
Yeah, started uploading them right after I posted, but minimized the window and only saw it now.

Re: How To: Generate Superb Heightmaps :)

Posted: 23 Jul 2016 11:51
by Mr Bruco
This is a video on how to create heightmap could be useful!

Re: How To: Generate Superb Heightmaps :)

Posted: 06 Oct 2016 00:39
by NekoMaster
The instructions on the first post don't seem to be working for me, I installed the SRTM thingy for Google Earth and nothing shows up. I'm using Google Earth Pro 7.1 on Windows 10 64-bit



Honestly though it'd be a hell of a lot easier if I could just find a nice big heightmap of Canada (2048x2048 and bigger) that includes the major rivers and waterbodies like lakes. I want to make a HUGE Canada scenario so that people like me can have fun trying to cover the expanses of Canada with roads and rails. I want a huge map so I can have the space to place most of the major towns and cities as well as space for industries.



If someone could help me get the data for all of Canada to make my own heightmap, or if someone could just generate a map for the entirety of Canada, either would be great (though the latter would be better since I have no idea what I'm doing with DEM and satellite stuff)

EDIT : It'd be nice if I could get this kinda detail for Canada's waterways as seen in this map http://kurld.com/images/canada-map/canada-map-04.jpg

I imagine that kinda detail may require a height map around 4096x4096.

Re: How To: Generate Superb Heightmaps :)

Posted: 15 Jul 2018 00:21
by Andrex
Mr Bruco wrote:This is a video on how to create heightmap could be useful!
That's a great idea, +1

Re: How To: Generate Superb Heightmaps :)

Posted: 03 Oct 2018 01:21
by Bad Hair Day
I've been creating heightmaps in World Machine, steadily learning as I go. I'm going to continue messing about with the program, but I think I'm done with this particular map. I may make a scenario from it in future but if anyone wants to use it, feel free. As the heightmap is a composite of sixteen 512x512 images there will be some minor issues at the seams, and the coastlines need some manual tweaking in some areas. The .tmd file of the world is included if anyone wants to tweak it further.

Re: How To: Generate Superb Heightmaps :)

Posted: 09 Oct 2018 15:13
by Bad Hair Day
So I tried a different approach with World Machine, only to find what I was doing originally worked better, so I went back to working on the heightmap I posted before. With version 13 I have a heightmap I am satisfied with enough to turn into a scenario. I have figured out how to reduce differences between the tiled heightmaps by not using the erosion tool too much as at leads to significant differences at the borders of tiles. I may create a basic tutorial at some point because even the free version World Machine has a lot of potential for creating scenarios, despite its limitations.

Re: How To: Generate Superb Heightmaps :)

Posted: 24 Oct 2018 12:22
by MAGNUM_PI
I am not able to make a height map. I followed the tutorial but SRTM 4.1 does not show me any option, drop down or button to download any DEM in Google Earth 7.3.2 (x64). In the drop-down, only "elevation", "logo" and "logo2" are shown, but nothing. It's strange, years ago I created a map of heights for Openttd and apart from simple, I do not remember having done all this, but the tutorial is from 2010, it had to be the same method. What am I doing wrong? Thank you.

Re: How To: Generate Superb Heightmaps :)

Posted: 06 Feb 2019 09:50
by vesgo
Sorry for digging the post, but i figured it out how to generate the maps, using everything in the first post with the exception of google earth. (I Can explain it if anyone needs it)
Been playing with the tools, read all the topics related, i can get nice detailed maps but its missing something...
Just wondering if there is any tool like the The city import patch by Zydeco to import citys in an automated way or any update to this patch to do this.
Trying to refresh some maps and it would be cool to have this.

Thx in advance

Re: How To: Generate Superb Heightmaps :)

Posted: 26 Feb 2019 21:23
by kamnet
This could be a more useful tool for getting your heightmaps to import.
https://tangrams.github.io/heightmapper/

Re: How To: Generate Superb Heightmaps :)

Posted: 03 Mar 2019 10:03
by skummel
I can give a little update
The DEM data from google Earth dont works, but i manage to get those i needed from http://srtm.csi.cgiar.org/srtmdata/
Choose the cell you want, make sure to move the dot from Geo TIFF to Esri ASCII
I choosed Tile 5x5 degree

Download , take a cup of coffe

Microdem , i downloaded one named Build 2019.1.11.1 and follow the guide in the first post how to raister and merge , worked fine

Re: How To: Generate Superb Heightmaps :)

Posted: 06 Mar 2020 06:48
by MetallicGene
thank you

Re: How To: Generate Superb Heightmaps :)

Posted: 21 May 2020 13:33
by speeder
There are now some websites that offer SRTM versions that were fixed, for example for non-commercial use only there is this site: http://srtm.csi.cgiar.org/ (just saw is same site as last post...), so no need to use MicroDEM

I downloaded straight from that site, and opened it using QGIS, and exported from there, alongside with rivers (that I got from my own country government downloads section) and whatever else I needed. Also QGIS supports OpenStreetMap by default, handy for knowing where RL stuff is on the heightmap.

Re: How To: Generate Superb Heightmaps :)

Posted: 30 Jul 2020 13:02
by Chrill
Beridow wrote: 30 Jul 2020 10:52 This is my first heighmap and i wanted to share it with you.
Hey friend, welcome to the TT-Forums! :)

You forgot to upload the heightmap, so if you want to share it go ahead and make a new reply!

Re: How To: Generate Superb Heightmaps :)

Posted: 25 Aug 2020 19:45
by bba
Hi everyone,

I have been working on a heightmap for Ireland, which I will share separately. I followed the Word document on the wiki to the extent possible. I would say it took me about an hour to get a heightmap that was maybe 90% of the way there, and then an entire weekend (and then some) to get it in a state I'm happy with. I thought it would be helpful to share what I found in case anyone else encounters the same problems I did.

- As others have noted, Topoview no longer seems to work with Google Earth, so I went directly to the CGIAR website at http://srtm.csi.cgiar.org/srtmdata/ and downloaded the relevant DEM files myself.

- Microdem works fine on Linux through Wine, but there are a couple of references in the Word doc to features that don't appear to be in the more recent versions of Microdem. Specifically:

-- There is no top-level "Merge" option in the "Data Manipulation" window. Instead, in the main window, just select "File -> Open -> Open and merge DEMS/grids".

-- I couldn't find any "Automatic choropleth palette" option in Microdem, as referred to in the Word doc. (It might have just moved / been renamed but I couldn't find it.) So I had to do the "original" method of selecting "Grey scale (monochrome)" and playing around with the z Range.

- In fact, I couldn't ultimately get Microdem (or QGIS, by itself) to output a greyscale image I was happy with. The problem seems to be that some very low land (eg, 1-5m above sea level in my case) gets rounded down to the same value as sea level when the raster is converted to a greyscale image. That means that some low land gets treated as sea in the resulting heightmap. I couldn't satisfactorily fix this issue without creating other problems, such as water being treated as land. Normally this might not be an issue, but for me it was resulting in peninsulas being rendered as islands and / or inlets being rendered as lakes. I eventually wrote a Python script to help solve this issue, by (1) setting all pixels with sub-zero elevation to zero elevation, (2) calculating the lowest elevation that is likely to be visible (non-zero) in the greyscale image, (3) finding pixels with an elevation above 0 but below that value, and (4) setting the elevation of those pixels to that value. I ran that script on the merged .ASC file before importing it into QGIS to convert to greyscale (Microdem continued to have issues distinguishing low land from sea even after running the script).

- To use QGIS to convert to PNG, I used the following steps:

-- In QGIS, from the top menu select "Layer -> Add Layer -> Add Raster Layer..." and choose your .ASC (or .TIF) file. It immediately appears as a greyscale image.

-- You may find that the image is a bit squished vertically, because by default it is displayed in the WGS 84 / Mercator (EPSG:4326) projection rather than the "pseudo-Mercator" (EPSG:3857) projection you may be used to. QGIS can be a bit finicky about how you change the projection. What worked for me was selecting "Raster -> Projections Warp (Reproject)..." from the top menu, choosing EPSG:4326 as the source CRS and EPSG:3857 as the target CRS and clicking Run. A new layer named "Projected" should appear. With the new layer selected, click on the projection button in the bottom left corner (it should say EPSG:4326, or at least it did for me), choose EPSG:3857 and click OK.

-- To export properly to PNG I had to follow the following steps (I don't know why I had to follow this rather round-about process, but it was the only way the greyscale image would turn out properly for me):

--- Right-click on the layer you want to export and select "Export -> Save As...". In the dialog that pops up, set the "Output mode" to "Rendered image", and choose where you want to save your layer as a .tif file. As well as saving to a file, a this will add a new layer in QGIS.
--- With this new layer selected, from the top menu select "Raster -> Conversion -> Translate (Convert Format)...". Click the "..." beside the "Converted" field to choose the file and format (ie, PNG) to export to.

- However, one feature from Microdem that I wasn't able to replicate in QGIS is the "Check Lakes" option. Basically, when you are converting to greyscale (or any other colour scale) in Microdem, you can tell it to check for lakes and give them a distinct colour. It does this by looking for contiguous sets of at least 9 "points" with the exact same elevation. This is helpful if you want to set the elevation of these lakes to sea level, so that OpenTTD renders them as water (only a good idea if the lakes are reasonably close to sea level in real life). I ended up writing a Python script to do this as well. It doesn't work exactly the same as the Microdem algorithm as it checks per-pixel rather than per-"point", so I had to use a higher threshold than 9 to get a reasonable number of lakes (I used 80 to get a reasonably good looking map).

- I used GIMP for the final image editing, rather than Paintshop Pro or Photoplus6 as suggested in the Word doc. I found the simplest way to do it in GIMP is as follows:

-- From the top menu select "Image -> Canvas Size..." which will allow you to choose the width and height of the image. Choose a width and height that gives you an image you are satisfied with while adhering to one of the aspect ratios supported by OpenTTD (1:1, 1:2, 1:4, 1:8, 1:16, 1:32 or the inverse of any of those). This will crop the image and / or expand it, filling in the new area with the colour of your choice (which should be #000000 if you want any new area to be sea). Click Resize.
-- Then from the top menu select "Image -> Scale Image..." and scale the image to the nearest resolution supported by OpenTTD.
-- Finally, select "File -> Export As..." to save the resulting image as a PNG.

So in summary, my process was as follows:

- Download the relevant SRTM data (as .ASC files) from the CGIAR website.
- Thin and merge the data files in Microdem, per the Word doc (I presume you could do this in QGIS and avoid having to use Microdem altogether; you can definitely merge in QGIS, though I don't know how to thin the data).
- Run fill_lake_elev on the merged .ASC file to detect any lakes and set them to zero elevation.
- Run fix_elev on the resulting .ASC file to bump any low land up to the minimum visible elevation.
- Convert the resulting .ASC file to a greyscale PNG using QGIS.
- Crop and scale the resulting PNG image to the desired resolution in GIMP.

Re: How To: Generate Superb Heightmaps :)

Posted: 27 Jan 2021 16:42
by gravelpit
Keplergamer wrote: 15 Jul 2016 20:59 Another 2, one with erosion applied and the other not. This time I tried to make it using a scale that suits OpenTTD maps, not train fever. OpenTTD 4k maps are like 30x bigger.

Try around 150-100 usable height for a 4K x 4K map.
look's like COVID 19 in microscope :lol:

Re: How To: Generate Superb Heightmaps :)

Posted: 27 Jan 2021 16:45
by gravelpit
bba wrote: 25 Aug 2020 19:45 Hi everyone,

I have been working on a heightmap for Ireland, which I will share separately. I followed the Word document on the wiki to the extent possible. I would say it took me about an hour to get a heightmap that was maybe 90% of the way there, and then an entire weekend (and then some) to get it in a state I'm happy with. I thought it would be helpful to share what I found in case anyone else encounters the same problems I did.

- As others have noted, Topoview no longer seems to work with Google Earth, so I went directly to the CGIAR website at http://srtm.csi.cgiar.org/srtmdata/ and downloaded the relevant DEM files myself.

- Microdem works fine on Linux through Wine, but there are a couple of references in the Word doc to features that don't appear to be in the more recent versions of Microdem. Specifically:

-- There is no top-level "Merge" option in the "Data Manipulation" window. Instead, in the main window, just select "File -> Open -> Open and merge DEMS/grids".

-- I couldn't find any "Automatic choropleth palette" option in Microdem, as referred to in the Word doc. (It might have just moved / been renamed but I couldn't find it.) So I had to do the "original" method of selecting "Grey scale (monochrome)" and playing around with the z Range.

- In fact, I couldn't ultimately get Microdem (or QGIS, by itself) to output a greyscale image I was happy with. The problem seems to be that some very low land (eg, 1-5m above sea level in my case) gets rounded down to the same value as sea level when the raster is converted to a greyscale image. That means that some low land gets treated as sea in the resulting heightmap. I couldn't satisfactorily fix this issue without creating other problems, such as water being treated as land. Normally this might not be an issue, but for me it was resulting in peninsulas being rendered as islands and / or inlets being rendered as lakes. I eventually wrote a Python script to help solve this issue, by (1) setting all pixels with sub-zero elevation to zero elevation, (2) calculating the lowest elevation that is likely to be visible (non-zero) in the greyscale image, (3) finding pixels with an elevation above 0 but below that value, and (4) setting the elevation of those pixels to that value. I ran that script on the merged .ASC file before importing it into QGIS to convert to greyscale (Microdem continued to have issues distinguishing low land from sea even after running the script).

- To use QGIS to convert to PNG, I used the following steps:

-- In QGIS, from the top menu select "Layer -> Add Layer -> Add Raster Layer..." and choose your .ASC (or .TIF) file. It immediately appears as a greyscale image.

-- You may find that the image is a bit squished vertically, because by default it is displayed in the WGS 84 / Mercator (EPSG:4326) projection rather than the "pseudo-Mercator" (EPSG:3857) projection you may be used to. QGIS can be a bit finicky about how you change the projection. What worked for me was selecting "Raster -> Projections Warp (Reproject)..." from the top menu, choosing EPSG:4326 as the source CRS and EPSG:3857 as the target CRS and clicking Run. A new layer named "Projected" should appear. With the new layer selected, click on the projection button in the bottom left corner (it should say EPSG:4326, or at least it did for me), choose EPSG:3857 and click OK.

-- To export properly to PNG I had to follow the following steps (I don't know why I had to follow this rather round-about process, but it was the only way the greyscale image would turn out properly for me):

--- Right-click on the layer you want to export and select "Export -> Save As...". In the dialog that pops up, set the "Output mode" to "Rendered image", and choose where you want to save your layer as a .tif file. As well as saving to a file, a this will add a new layer in QGIS.
--- With this new layer selected, from the top menu select "Raster -> Conversion -> Translate (Convert Format)...". Click the "..." beside the "Converted" field to choose the file and format (ie, PNG) to export to.

- However, one feature from Microdem that I wasn't able to replicate in QGIS is the "Check Lakes" option. Basically, when you are converting to greyscale (or any other colour scale) in Microdem, you can tell it to check for lakes and give them a distinct colour. It does this by looking for contiguous sets of at least 9 "points" with the exact same elevation. This is helpful if you want to set the elevation of these lakes to sea level, so that OpenTTD renders them as water (only a good idea if the lakes are reasonably close to sea level in real life). I ended up writing a Python script to do this as well. It doesn't work exactly the same as the Microdem algorithm as it checks per-pixel rather than per-"point", so I had to use a higher threshold than 9 to get a reasonable number of lakes (I used 80 to get a reasonably good looking map).

- I used GIMP for the final image editing, rather than Paintshop Pro or Photoplus6 as suggested in the Word doc. I found the simplest way to do it in GIMP is as follows:

-- From the top menu select "Image -> Canvas Size..." which will allow you to choose the width and height of the image. Choose a width and height that gives you an image you are satisfied with while adhering to one of the aspect ratios supported by OpenTTD (1:1, 1:2, 1:4, 1:8, 1:16, 1:32 or the inverse of any of those). This will crop the image and / or expand it, filling in the new area with the colour of your choice (which should be #000000 if you want any new area to be sea). Click Resize.
-- Then from the top menu select "Image -> Scale Image..." and scale the image to the nearest resolution supported by OpenTTD.
-- Finally, select "File -> Export As..." to save the resulting image as a PNG.

So in summary, my process was as follows:

- Download the relevant SRTM data (as .ASC files) from the CGIAR website.
- Thin and merge the data files in Microdem, per the Word doc (I presume you could do this in QGIS and avoid having to use Microdem altogether; you can definitely merge in QGIS, though I don't know how to thin the data).
- Run fill_lake_elev on the merged .ASC file to detect any lakes and set them to zero elevation.
- Run fix_elev on the resulting .ASC file to bump any low land up to the minimum visible elevation.
- Convert the resulting .ASC file to a greyscale PNG using QGIS.
- Crop and scale the resulting PNG image to the desired resolution in GIMP.
https://tangrams.github.io/heightmapper/

Re: How To: Generate Superb Heightmaps :)

Posted: 22 Jul 2021 21:16
by MagicBuzz
Hello,

I just discovered this link : https://cs.heightmap.skydark.pl/

It's very helpfull for creating nice heightmaps based on real life.

The only matter is that I didn't found how to zoom and change the heightmap size. You need to combine some pictures together if you want a wider area.