Easy guide for creating heightmaps

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
turbo84gn
Engineer
Engineer
Posts: 3
Joined: 16 Mar 2010 19:51

Easy guide for creating heightmaps

Post by turbo84gn »

I have seen a few posts of how to do height maps. With this you should be able to create one in less than five minutes. It's easy.

Step 1:

Go to http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
Here you will download the DEM (Digital Elevation Model) for the area you want.
1. Select Server: pick closest one.
2. Data selection method: your preference. Whichever way you go, it will download a whole quadrant file (or files), not just specific area you pick. The grid in the world image shows the quadrant files.
3. Select File Format: GeoTiff. Then click yellow box to right that says "Click here to Begin Search"
[/list]

The next page shows the information and overview for the file(s) you have selected.

Select the Data Download link(s) below the file you need. You don't need the Mask data.

Choose either FTP or HTTP. Easiest is usually HTTP. Save and unzip file to anywhere you want.

Step 2:
Download this file and put it in the same place as geotiff file you just downloaded.
grayscale.dat
(88 Bytes) Downloaded 736 times
Step 3:
Download and install this tool.
http://freegeographytools.com/3dem_setup.exe

Step 4:
Start the 3DEM program. The icon is located under Programs|Visualization Software|3DEM. When the program launches you will be prompted for file type, choose geotiff. Then browse to the location you unzipped the file you downloaded above. If you downloaded more than one, you will have to do this one at a time and combine the files later.

Once open you will see the elevation model, in color, with 3D enhancements. First, remove the 3D shading. From the menu select Color Scale - Shaded Relief. Change the Shade Depth to 0%. OK. Now to change to gray scale. From the menu select Color Scale - Modify Scale. Below the color scale you will see a Load File button. Load the grayscale.dat file.

From Menu, choose Geo Coordinates - Lat-Lon Off. That way the grid lines won't print to the bmp file.

If you want to select a smaller portion of the map, from the menu choose Operation - F8 Select Smaller Area. With the mouse draw a box around the area you want. Press Enter. You will be prompted to verify the specific lat-long boundaries of your area. OK.

Now from the menu choose File - Save Map Image. Leave default type as bmp. Then save to wherever you want.

At this point you can import the file as a heightmap as is in OpenTTD.

Extra Stuff:
* OpenTTD will allow many different map sizes. If for example your gray scale bmp is 500x600 pixels in size, and you choose a 512x512 map, OpenTTD will re-size and center the imported file to 427x512 preserving the aspect ratio. The extra map squares above 427 will be water.

* You can use the Windows paint program to paste together more than one map and then save as a single larger gray scale map you can import.

* I like to use an image tool called IrfanView. http://www.irfanview.com/index.htm
You can use this tool to easily re-size and crop images. Convert image formats. Lots of cool stuff.

* One thing that I do is a little more complex. When you view the TTD map, it's a diamond. So any square height-map you import will be rotated left or right 45º, depending on if you had clock-wise or counter clock-wise selected. This will then put north pointing upper right or upper left, not straight up. What I do is overcapture the area I want, use IrfanView to do a fine rotation to 45º. Then crop and save a new square area. When imported, north will be up!
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Easy guide for creating heightmaps

Post by petert »

Hi,
I just tried to make a test map of Tazmania, but all the white causes the heightmap to be extremely high. How do I reverse that?

Peter
Attachments
tazmania.zip
(69.28 KiB) Downloaded 218 times
tazmania.png
tazmania.png (19.75 KiB) Viewed 13260 times
User avatar
turbo84gn
Engineer
Engineer
Posts: 3
Joined: 16 Mar 2010 19:51

Re: Easy guide for creating heightmaps

Post by turbo84gn »

On the modify scale window, you can change the range.
Attachments
terrain.jpg
terrain.jpg (125.22 KiB) Viewed 13136 times
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: Easy guide for creating heightmaps

Post by City Builder »

How do I put multiple images together to use as one larger height map. For instance I want to create cuba, and it's made up of multiple images, do I open them all up in my photoshop and paste them side by side to recreate the whole of cuba or is there another way of doing this?

Thanks,
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Easy guide for creating heightmaps

Post by kamnet »

Yep, just use your favorite image editor to paste it all together.
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: Easy guide for creating heightmaps

Post by City Builder »

Ok, so I tried this, however after saving it from paintshop pro to a tiff file it no longer opens in 3dem. I believe the error is something along the lines of the image is not a GeoTiff.

Perhaps I'm doing something wrong? Or maybe somebody knows of a plugin for Paintshop Pro XII that will allow me to save as a GeoTiff file.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Easy guide for creating heightmaps

Post by kamnet »

Follow the steps w/ 3DEM first. Then import your images into Photoshop, save that new file as a BMP, TIFF or PNG. Import the new file into OTTD.
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: Easy guide for creating heightmaps

Post by City Builder »

thanks, for some reason I would never have thought to do it that way. I'll give it a go.
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: Easy guide for creating heightmaps

Post by City Builder »

Hi,
Is there a sense to the naming convention that they use? I ask because I'm trying to put a map together in Paint Shop Pro that consists of about 20 pieces and it's like working with one of those puzzles that you have to slide around the individual images to make the whole image. Maybe if there is a sense to the naming system then I can easier try to put them together.

Thanks,
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Easy guide for creating heightmaps

Post by kamnet »

There is, but it isn't one that makes sense as far as geography goes. The easiest way to access the data is to use Google Earth and then grab the SRTM overlay plug in from King's College London.

Wow, 20 images? If you're using a SRTM3 image (3 arcsecond) hat's going to be a map way larger than what the game will normally handle. Using 3 images x 3 images will be pushing the 2048 map limit.
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: Easy guide for creating heightmaps

Post by City Builder »

Thanks for the information. The 20 images comprised the east coast of the U.S. and I shrunk down the images in photoshop figuring to get them into a smaller area in the game, however couldn't for the life of me figure out the image slider puzzle so I gave up on it. Loaded up Google Earth, downloaded 6 images from them that covers the great lakes area and am now working on that in the editor as I've finally gotten the 6 images to look presentable as a height map and imported with only a couple hours worth of work to clean them up of extra stuff that was imported with the image.

Thanks for the help.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Easy guide for creating heightmaps

Post by kamnet »

For 20 images of the USA East Coast, sounds like you were using the SRTM1 images, which are a much closer view of 1 arcsecond, 30m. For SRTM3 files, CGIAR-CSI has organized the data in a nice grid when you use it with their Google Earth overlay software, but without it you don't have a clue where each data file corresponds geographically.

Now the SRTM1 data files ARE a little better organized, the filenames are broken down to the longitude and latitude. N38W084.hgt.zip for example means the file data starts at 38 degrees north, 84 degrees west. But, if you don't know again what geographical areas that covers, it can be difficult to figure out what data files you need, as there isn't an organized map that visually links the map data to a geographical area, only a more generic JPEG map that NASA created in 2000. The coverage area is also not in a nice grid array as the SRTM3 data is, but has irregular defined regions. I've posted a message to a NASA message board about the SRTM project seeing if I can get some more info.
MGSteve
Traffic Manager
Traffic Manager
Posts: 133
Joined: 11 Aug 2002 15:07
Location: Walsall, England

Re: Easy guide for creating heightmaps

Post by MGSteve »

City Builder wrote:Thanks for the information. The 20 images comprised the east coast of the U.S. and I shrunk down the images in photoshop figuring to get them into a smaller area in the game, however couldn't for the life of me figure out the image slider puzzle so I gave up on it. Loaded up Google Earth, downloaded 6 images from them that covers the great lakes area and am now working on that in the editor as I've finally gotten the 6 images to look presentable as a height map and imported with only a couple hours worth of work to clean them up of extra stuff that was imported with the image.

Thanks for the help.
Yeah, for large maps like that, its probably best to follow my original instructions http://www.tt-forums.net/viewtopic.php?f=29&t=27052

But you will need one hell of a monster PC, I had a reasonable PC when I wrote that, but even I didn't try the USA... I'd probably cope now with a i7 & 12GB of ram, as long as Microdem survived to produce the file! lol
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Easy guide for creating heightmaps

Post by planetmaker »

Let me share with you another way how to create a height map from an arbitrary section of the world:

NOAA offers 3D bathymetry and altimetry data for free download from their website; you can choose an arbitrary map in longitude and latitude: http://www.ngdc.noaa.gov/mgg/gdas/gd_designagrid.html
Personally I choose to export it as xyz (lon, lat, z) data with an ASCII header and comma separation. This will give you after download a nice file with heights associated to a certain geographic location.

These data are then easily converted into a nice colour or gray-scale encoded image by means of IDL or GDL. Import the table, plot the data as surface plot using grayscale, maybe tweak as long as you like to improve the result, save it as image. Done.

Very rough guide, I know :-)
jimmydanny
Engineer
Engineer
Posts: 123
Joined: 26 Mar 2006 17:39
Location: jim-tore@oshaug.com

Re: Easy guide for creating heightmaps

Post by jimmydanny »

US in a feckin bottle. Where is the northern parts of the world? Didn't cover it? Not important enough? Thanks.
Intel Core i7-3930K @ 4,0GHz, 16GB DDR3, AMD Radeon HD 6970, Intel 530 SSD
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Easy guide for creating heightmaps

Post by Yexo »

jimmydanny wrote:US in a feckin bottle. Where is the northern parts of the world? Didn't cover it? Not important enough? Thanks.
You're posting in a thread which is meant to teach you how to create your own heightmap. To me it's not even clear to which exact post you respond, but that doesn't really matter.

If you want someone to help you (or create for you) a heightmap of the complete US instead of only a part of it, I strongly advise you to ask nicely next time.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 2 guests