[OSM-dev] Polygon buffer tool (for Osmosis)

marcus.wolschon at googlemail.com marcus.wolschon at googlemail.com
Fri Dec 11 12:03:52 GMT 2009

On Thu, 10 Dec 2009 21:40:39 -0500, Frank Steggink <steggink at steggink.org>
> Hi,
> I've created a small Python tool which buffers the polygon in a polygon 
> file (for Osmosis),

Excuse me, wich polygon is buffered, when and for what purpose?
>From the source I see "Calculate a buffer around the polygon, using
So this creates some PostGIS geometry that covers whatever the polygon
"NB: holes aren't supported yet" plus some area around the polygon?
Then this (temporary?) geometry is exported as another polygon-file?

If is is a python-scrips, how is it used with Osmosis?
I guess these created polygon-files are nice for extracts that shall
contain elements next to the border?

Why does it need a PostGIS for this job? Wouldn't calculating
the normal in each vertex and offsetting the vertex along that normal
be enough? (Plus a check if the new location is not inside the polygon,
else offset only to the point where it touches the polygon.)

> and creates a new polygon file. It can be found 
> here: [1]. For the buffering PostGIS is used. All Canadian polygon files 
> from [2] have been tested and are working.
> Requirements: Python (2.6, but 2.5 likely works too), PostGIS (1.3+), 
> PyGreSQL
> More info can be found in the file itself, or by typing "./polybuffer.py 
> -h" in the command prompt.
> Please let me know any issues you experience with this tool.
> Cheers,
> Frank
> [1] 
> [2] http://www.maproom.psu.edu/dcw/


More information about the dev mailing list