topo map to 3D terrain

Recommended Posts

Hi, I am interested in finding or writing a program that can read a topographical map and convert it into 3D terrain. I am interested in your thoughts or suggestions about this. Is it feasable? -GE

Share on other sites
Hey galneweinhaw,

This should be feasable permiting you can extract the data you need from the map.

I'm not sure how data is stored for digital topographical maps. If it is just a bitmap that would make things very difficult/impossible as text and stuff like that would mess up the map. Do you have any information on how this is stored? (I wouldn't even know an extention to look up).

Share on other sites
I'm gonna check into how the digital data is stored

Share on other sites
It would be pretty easy to strip out the text & other lines on the map without ruining the topography too much. I'm sure you guys can come up with some creative algorithm to interpolate the map data to cover up any letters.

Share on other sites
Quote:
 Original post by Luke MiklosIt would be pretty easy to strip out the text & other lines on the map without ruining the topography too much. I'm sure you guys can come up with some creative algorithm to interpolate the map data to cover up any letters.

It's not as simple as that if it is just raw color data. Topo maps arnt color depenednt on height. There are lines at each incriment of a hight. Colors are for if its forested, water, etc. So creating an algorithm that would strip text and reconize contour hight lines, is well not going to happen.

Share on other sites
I don't care what the color stands for, whether its how many pounds of jello reside in that region or maybe economic scales... it won't matter. It would still be relatively easy to strip out the text (assuming its a known color of its own) & replace it with interpolated color values from the pixels around it. Even if it characters or symbols lie on edges of 2 or 3 or more colors... you can at least apply a hack if you don't wanna be creative & just copy the color of the closest real pixel to the one you are replacing. Would it be real? heck no... thats what interpolation is... fake, but a good guess.

Share on other sites
All contour height lines are the same colour though... so it should be possible shouldn't it? Check this out as an example:

Do you think it would be possible to extract the contour lines?

Share on other sites
of that map? Absolutely, except its not to clear (to me, just by looking at it) whether a line means an increase or decrease in elevation. You'll have to take those funny pictures off too (tent, cabin, van).

Share on other sites
You think so? cool.....

Now... is anyone willing to give me a hand in getting started? I don't really have a clue where to start.

Up and down don't really matter, if you're wrong you can just flip it upside down.

Share on other sites
well, I image an algo like this:

start at top left corner, assume height of 0move across the top row    if no contour line, continue    else (there is a contour line)        Track the contour line all the way in both directions        count the number of times you've crossed this line already            if the Number is odd, height--, else height++etc.

what do you guys think?

Share on other sites
first of all, up & down do matter. You said " if you're wrong you can just flip it upside down ". But how would you know when you are wrong?
At any rate, I would do two different passes on the data. Once like lonesock said, because you need to know if you are crossing a new contour line or one you previously crossed. Starting from the corner & just assigning it an arbitrary height is good, because this map is just in reference to itself.
The first pass, I would assign heights along the lines & until you hit a new line, keep that height... so basically you will have a very choppy / blocky heightmap. Then for the second phase, run a smoothing algorithm over the data, maybe more than once & you'll have some pretty good 3D terrain of that area.

Share on other sites
Quote:
 Original post by Luke Miklosfirst of all, up & down do matter. You said " if you're wrong you can just flip it upside down ". But how would you know when you are wrong?

By looking at the map it is easy for anyone who is familiar with topo maps which way is up.... for the program, if it could map a river (should be the same as mapping contour lines) it could detect whether the river is in a valley or on a ridge, if it's on a ridge then it would reverse the map.

By the way, thanks everyone for their input and help with this.

Share on other sites
Ohhhh ok. so the rule is ... every line between a river & a peak... is going UP. & there should be an even number of lines between 2 peak lines... cus half go down & half go up. I get it now, this would be a great problem to work on, good luck on it.

Share on other sites
Ok, now that I have the confidence it's possible.... I need a little help. I haven't programmed much with graphics.

How do I open a .bmp file (display it) and read the bits?

I'm using VC++ on WinME

Share on other sites
You know, quite a few years ago I was involved in street-mapping and although this isn't a mapping project, I'm reminded that the info for topo maps is available as data-sets as well as images (sometimes called DRGs, DEMs, etc. by usgs).

So, you might look into the various file-formats (they're all parseable as ascii text)available for topographic maps, it would probably be a lot more dependable than trying to guess an elevation from it's location relative to other pixels or 'landmarks' in a raster image.

ESRI has free stuff for download, too, that deals with government datasets for all sorts of mapping, the data itself come from these guys:

http://www.usgs.gov/pubprod/index.html#software

Also look into the BLM, since they have their own proprietary data and software available for public download.

I'm sure the Canadian Gov. has similar support for national topogaphic data as well as published specifications for their data formats.

Once you have a 'range' of values defined, you can generate a heightmap based on the elevation data you parse from the file and you have your terrain.

Tony

Share on other sites

By way of followup, here is a listing of the various sources for terrain data (free for the most part), including Canadian datasets:

http://www.terrainmap.com/rm39.html

Tony

Share on other sites
Another link you might find useful (open source):

http://www.vterrain.org/

Tony

Share on other sites
You should look for a data version as that will be far easier to do.

No disrespect to luke but doing it from raw pixel data will not be anythign near a easy task, there are gaps in lines, noise, random symbols and text. There are not rivers on every rise and falling peak.

Make no mistake it would be a very though task, but yes it can be done.

Share on other sites
Quote:
 Original post by comservlantAnother link you might find useful (open source):http://www.vterrain.org/Tony

Wow.... this stuff is awsome, thanks for all the links comservlant

Share on other sites
do you want that specific picture put into 3D terrain? like for your camp or your dad's camp or whatever? I'll do it if you want. or do you want just any old topographic map put into terrain?

Create an account

Register a new account

• Forum Statistics

• Total Topics
628275
• Total Posts
2981759

• 10
• 11
• 17
• 10
• 9