Elevation Files?

For discussion about scenarios! Post your scenarios, comment on others' scenarios, discuss triggers, and so on.
Post Reply
Neotje
Intermediate Member
Posts: 84
Joined: Sun Mar 29, 2009 10:02 am

Re: Elevation Files?

Post by Neotje »

I remember there used to be a website where you could download this. But I do not remember where... As this was 10 years ago, I also for sure don't have these files anymore.

I would look on heavengames if I were you, for example here is one for Europe:
http://ee.heavengames.com/downloads/sho ... ileid=3168

If this one works you should be able to find out how the data works and make one yourself from 'some' datasource.

[Edit]
They also got some information on how the datafiles work:
http://ee.heavengames.com/new/eeh/mapde ... tion.shtml

Neotje
Intermediate Member
Posts: 84
Joined: Sun Mar 29, 2009 10:02 am

Re: Elevation Files?

Post by Neotje »

Yes, that should be possible. I have not looked into it very deeply, but the dataformat seems somewhat simple, you just need a way to save it as such.

According to the heavengames link I gave above the data is stored as binary, combined with the mapsize (e.g. 1400x700, or 2500x1600 or w/e). I checked in one of the files I could download there, and it seems there are 2 bytes per position. So it is probably int16 or uint16 data.

What you need is a program that can read in a binary blob, interpret every 2 bytes as a single int16 or uint16, and then see if what you get makes sense.

If this works, you can create a map yourself and save it as such. I might have a look how to do this with python, but I never played with storing raw binary files, so I'm not promising anything as of yet.

Neotje
Intermediate Member
Posts: 84
Joined: Sun Mar 29, 2009 10:02 am

Re: Elevation Files?

Post by Neotje »

Alright, so I have been looking into it for you a littlebit. Data is stored as int16 (so integers with 16 bits per position). A negative value denotes water, positive values give land.

You can quite easily read in the files with python, the following code for example reads in the datafile from the first link I provided, and plots it. Note that it is quite hard to discern where the water starts because the European coastline is quite shallow compared to the height of the Alps...

Code: Select all

fileName = "<path to>\Map of Europe.dat"

with open(fileName, mode='rb') as file: # b is important -> binary
    fileContent = file.read()
    
import matplotlib.pyplot as plt
import numpy as np
f = open(fileName)

#%%
data=np.fromfile(fileName,'i2')
data_array=np.reshape(data,(1201,1801))
plt.figure()
plt.imshow(data_array)
Writing these binary files also seems quite straightforward, the following code will write the data in 'data' to a correct binary file:

Code: Select all

np.ndarray.tofile(data,'filename_of_the_output.bin')
Just make sure that data contains your heightdata, in int16 format and you should be good to go.

Pyton in general is pretty nice on importing data in different formats, so you just need some datasource, import the data in python, then you can modify it (for example, you can make mountains flatter, water less deep, smoothen out the surface etc) and after modification you can save again, export to this binary format.
Importing images in python is also very possible.

In case you have never used python, I use the Anaconda distribution https://www.anaconda.com/distribution/#download-section, after installation run spyder and you get a nice graphical user interface where you can run the code I put up above. If you have some more questions please ask.

User avatar
bradleybrand
Novice Member
Posts: 16
Joined: Tue Oct 15, 2019 4:48 am
Xfire: ogel123
Lobby Username: bradleybrand
Location: Newmarket, Suffolk, UK.
Contact:

Re: Elevation Files?

Post by bradleybrand »

We need new sources for elevation files.
B. Brand

Post Reply

Return to “Scenario Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests