[OSM-dev] Website to generate polygons from OSM relations

Jocelyn Jaubert jocelyn.jaubert at gmail.com
Wed Jun 12 11:37:43 UTC 2013


On Wed, Jun 12, 2013 at 08:41:55AM +0200, Frank Broniewski wrote:
> nice work! Your service is really running quite fast. How do you
> determine what a polygon relation is? Do you have a list of keys and
> values, like osm2pgsql does? Or do you check if a geometry is closed
> and produce polygons from them?

I check if a geometry is closed, and generate polygon from it.

For example, if you try on a bus line, you will get the errors generated from
postgresql, with information on where the disconnection might be:

http://polygons.openstreetmap.fr/?id=36052

NOTICE: missing connexion at point -0.1406638f 51.5131253f
NOTICE: missing connexion at point -0.135611f 51.5099509f


This is done by plgsql function create_polygon() here:
https://github.com/jocelynj/osm-polygons-generation/blob/master/init.sql#L24

Note that I think that it doesn't correctly handle inner members of relations.


-- 
Jocelyn



More information about the dev mailing list