[OSM-dev] support for osm2pgsql with relation type=route

Jon Burgess jburgess777 at googlemail.com
Sun Apr 13 17:25:00 BST 2008

On Sun, 2008-04-13 at 17:00 +0200, Martijn van Oosterhout wrote:
> On Sun, Apr 13, 2008 at 10:42 AM, ivom <ivo.vdmaagdenberg at pandora.be> wrote:
> >  I was wondering when route relations are processed with osm2pgsql. In the
> >  current svn tree I can see that there has been some effort in adding
> >  polygons but the code has been functionally disabled. Does not work well?
> >
> >  Is there someone who can tell about near-future support for relations with
> >  type=route? There seem to be at least 2 public sites that are able to
> >  process relations successfully. Where is that code? :)
> The problem is scaling: to process a route relation you need to have
> the ways and you don't have the memory ot store all the ways. The ways
> are processed before the relations. However, if you run in --slim mode
> it will store all the ways in the database and then you can handle the
> route relations.

I recently enhanced the planet dump to copy the relations into another
file. I was hoping that we would be able to use this to avoid parsing
the file twice. 

> Yesterday I committed some changes which make slim-mode almost as fast
> as non-slim-mode (well, only 2x as slow in the simple case, I havn't
> tested the whole world case). I have the code to handle route
> relations and will be adding it shortly, however, it will only work in
> slim-mode, because you don't have the memory to do it in
> non-slim-mode.

Sounds good. I have not looked at your recent changes yet but I will do
soon. I've got a few more enhancements I'd like to make to get rid of
the 'polygon' flag. There are now several tags which can not be
classified as linear/polygon by just looking at the keys. I'm thinking
that we should put any closed way into both the line and polygon tables.

This should avoid problems like the roundabout next to Heathrow T5[1]
which has both highway= and landuse= tags. Because of the landuse tag
this is currently only appearing in the polygon table but it really
needs to appear in the line table as well.



More information about the dev mailing list