[gdal-dev] WAsP map output for ogr

Even Rouault even.rouault at mines-paris.org
Tue Feb 25 11:13:45 PST 2014


Vincent,
> 
> I'd like to develop a ogr driver to create .map files used by WAsP
> <http://en.wikipedia.org/wiki/WAsP>
> 
> The .map files contains height contours and roughness zones, the former
> are linestrings with an height attribute, the later are linestrings that
> separate two adjacent polygons with a roughness parameter on the righ
> and left sides.
> 
> An algorithm to create roughness zones from polygons with a roughness
> attribute would be useful: extract the polygon boundaries and output
> linestrings with attributes on the left and right sides.
> 
> What driver would you recommend as a starting point to get the
> interface, the coding style and the error handling right ?

A write-only driver if I understand well ? There are not so many instances of 
such drivers. I can think to the PGDump driver.

As far as coding style, there's http://trac.osgeo.org/gdal/wiki/rfc8_devguide 
with a few general guidelines.

> 
> Is the algorithm to create roughness zones from polygons (i.e. extract
> polygon boundaries and add left/right attributes) something that should
> be integrated in the driver, somewhere else or not at all in gdal ?

That's certainly the trickiest part of your task. There's no such algorithm in 
GDAL. I'm not very familiar with that but it sounds a bit like topological 
processing. Perhaps PostGis topology could be used to compute the edges from 
the polygons ? Reading the introduction of 
http://postgis.net/docs/Topology.html,  I can see that you should have in-
house competences on that ;-)
There's an idea for GSOC 2014 (Geography network support : 
http://trac.osgeo.org/gdal/wiki/SummerOfCode ) that seems a bit connected with 
your problem and could potentially served as the base for such algorithm.
But I'm not sure that GDAL alone could solve it. You likely need some 
intermediate storage to store and retrieve the edges from the polygon set 
(unless you have not that many polygons to deal with in which case in-memory 
processing could be OK).

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list