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

Frank Broniewski brfr at metrico.lu
Thu Jun 13 07:32:11 UTC 2013


I tried that once too, but then I stopped using a osmosis based DB and 
switched to osm2pgsql. But I had a somewhat 90% working solution ...

I've uploaded my SQL files to my repo [1], maybe you find some ideas on 
how to treat inner and outer polygons. There're no comments on the SQL 
so it might be hard to grasp, but you can find your way around.

Frank

[1] https://bitbucket.org/metrico/osm-sql

Am 2013-06-12 13:37, schrieb Jocelyn Jaubert:
> 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.
>
>


-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu



More information about the dev mailing list