[gdal-dev] Re: Countour polygons instead of lines

Tim Michelsen timmichelsen at gmx-topmail.de
Tue Sep 9 16:37:19 EDT 2008


Hello!

Although your message is already some days old I wanna respond.

> Did you ever want gdal_contour to produce polygons instead of lines?
Yes!

> I made a small Perl program that uses the Perl bindings to GDAL and 
> which converts the lines into polygons. The polygons represent "plates" 
> of equal elevation and thus overlap. The polygons are stored into a new 
> layer in such an order that ordered rendering of them produces a nice 
> visualization. Visualization is my main goal here - I want to get a 
> similar effect as in some weather forecasts. However, transparency does 
> not work as expected in standard viewers because of overlapping 
> polygons. Here's an example created from DEM: 
> http://map.hut.fi/files/misc/contour_polygons.png
> 
> The code is also at http://map.hut.fi/files/misc/
> 
> I found this by googling: 
> http://lists.maptools.org/pipermail/fwtools/2005-November/000199.html
> 
> I wonder what's the current situation. Does GRASS do this?
It seems that GRASS cannot do this in a satisfying way. Or at least it 
appears to be (don't wanna offend any GRASS dev/user).

Here I asked fro something similar:
http://thread.gmane.org/gmane.comp.gis.grass.user/24889

The maps I created with the suggested approach looked exactly as your 
screenshots. The converted vectors didn't follow the countourlines 
smouthly. Instead, the borders retraind the pixel-like raster outline.

Matplotlib and other plotting programs (matlab, IDL) can do this (see 
the examples here: ).
So either
* plotting programs do an inaccurate interpolation
or
* the GRASS approach is too complicated that even experience users don't 
find it.

Kind regards,
Timmie



More information about the gdal-dev mailing list