Published by breki on 21 Mar 2009 at 10:59 pm
GroundTruth: Relief Contours
Just a little teaser before going to bed. The screenshots show relief contours generated by GroundTruth using SRTM3 data. The map area is progressively zoomed in: first you can see the 100m contours, then also 20m ones and finally 10m contours are visible.

Expect it in the next release of GroundTruth.




igorbrejc.net » GroundTruth v1.3 on 31 Mar 2009 at 21:47 #
[...] GroundTruth: Relief Contours [...]
Stefan on 27 Jun 2009 at 8:57 #
Hello,
First of all, this is fabulous work you are doing here with OSM and SRTM data.
And now for the question : I’ve been trying to find a way to create a simple topo map using the ‘contours’ command; this works very well, even for large volumes, but I would like to restrict the output to a certain polygon, like the ones used by osmosis’ “–bounding-polygon” task; is this possible ? can you give me some hints on this ?
Thanks in advance and for your time,
Stefan.
breki on 28 Jun 2009 at 9:22 #
@Stefan,
Thanks for the praise. Unfortunately cutting contours along a polygon is not provided in GroundTruth. Maybe I’ll add support for it in the next version of the DEM library, but not until I implement more urgent features.
There is another way (if you’re a programmer): preprocess the SRTM hgt files so that all of the cells which are outside of your polygon have a value of -32767, this way they’ll be ignored by the DEM library.
Stefan on 29 Jun 2009 at 11:02 #
Thanks for the idea. I have written a small piece of C++ code to process the HGT files, and it seems ok; it’s quite slow (my goal was functionality not speed), and I’m testing the tiles with the Virtual Terrain Builder. Once they are done, I will test them with GroundTruth and I will try to optimize the algorithm.
When it’s done, I will send you the code.
Stefan on 30 Jun 2009 at 7:55 #
Worked like a charm. Now I have to find a more efficient way of doing it (the first attempt used region GDI objects), as it took almost a day of processing. As soon as I make it work, I will get back to you.
breki on 30 Jun 2009 at 16:36 #
@Stefan,
Good to hear. As for the approach: maybe some kind of polygon rasterization could be used? You rasterize polygon’s edges into a NxM “bitmap”, then use some kind of flood fill algorithm to fill the rest of the polygon. This bit mask can then be used to turn off the height data for cells outside of the polygon.
Stefan on 30 Jun 2009 at 18:28 #
I’m not sure it will work due to the size of the map I’m trying to build; at first look it’s the fastest, but my concern is memory size on one hand.
The map is about 10*6 SRTM tiles in size, so that takes up quite some memory, but this may not be the biggest problem, but the fill algorithm. Even worse, other people may try even bigger areas.
I have started to work on a classic point-in-polygon algorithm, and I will make a performance comparison. I’ll let you know how it goes.
One question : if I reply to the address in the notification mail, do you receive the mail ? I would rather send intermediate results by mail and post only final stuff here.