# Contour maps and height maps

This topic is 4001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey there! I have browsed around the internet a bit without finding anything that can help my particular problem... I would like to use an height map, but since my app only has access to (very) very little disk space I must save the height map in some other form, namely topology contour maps (I hope you know the kind I'm talking about :) ). The thing is, I've not been able to figure out how to "decompress" such a contour map into a grayscale height map, which I intend to do on smaller portions of the map, as they come along. My app is not very dependent on speed, so it doesn't matter if the contour map -> height map conversion takes a little time. So, basically, what I'm asking is, how do you go from a countour map to an height map? Any links or tips are much appreciated! Thanks in advance! /Magnus

##### Share on other sites
Really, how little space are we talking about here? How big is the world? Would an image really be too large?

Anyways, if you're going to start with a contour map, why not create an appropriately sized array, and go through and set the heights of the points that fall along the lines of contour. After that, you could simply interpolate the values of any field that is unset. With bilinear interpolation, it should be too hard, and you can always iterate until all fields are full.

##### Share on other sites
How about constructing a finite element approximation based on the contour lines? I mean, a piecewise continuous function F(x,y) whose values are fixed at points belonging to the contour lines and interpolated everywhere else.

The simplest way to do this would be to sample the contour lines at N points. We'd obtain an N point set which we can triangulate using standard algorithms. This corresponds to a piecewise-linear approximation of F.

After triangulation we have a representation for F, the triangle mesh, which we can sample to construct the heightmap.

-- Jani

##### Share on other sites

We're talking around 100k for map storage, and a pretty vast map ;)

I've thought about that bilinear interpolation approach, and I think it would actually suit me quite well :) Thanks for sparking the idea!

/Magnus

1. 1
2. 2
Rutin
21
3. 3
JoeJ
18
4. 4
5. 5

• 14
• 39
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631719
• Total Posts
3001883
×