[OSM-dev] osm2pgsql: junctions (closed ways) imported as polygon?

Stefan Keller sfkeller at gmail.com
Fri Feb 20 15:17:38 UTC 2015


I could even identify more evidence why osm2pgsql is incorrectly
bulding polygons out of closed ways (roundabouts):

Look at these two roundabouts (both single closed way):
http://www.openstreetmap.org/way/24932843
...
Part of
  Relation Bus 992: Rapperswil - Jona Bahnhof (2691985)
  ...

http://www.openstreetmap.org/way/217996619
...
Part of
  Relation Bus 992: Rapperswil - Jona Bahnhof (2691985)
  Relation 2887574 (as outer)
  ...

I admit that way 217996619 should be split since only a part of the
roundabout it's part of the outer boundary of "landuse=residential".
Then osm2pgsql won't put it in polygon since the roundabout consists
of more than one closed way.

My hypothesis is, that osm2pgsql is incorrectly building polygons here
because these single closed ways are also part of a relation
(disregarding what this relation is).

-S.

2015-02-18 17:28 GMT+01:00 Stefan Keller <sfkeller at gmail.com>:
> Thanks Sarah!
>
> I'm stll stuck with the observation that roundabouts mapped as one
> single closed way (like
> http://www.openstreetmap.org/way/24932843 ) are imported as polygons
> into planet_osm_polygon
> by osm2pgsql whatever style file I use...
>
> -S.
>
>
> 2015-02-18 0:15 GMT+01:00 Sarah Hoffmann <lonvia at denofr.de>:
>> On Tue, Feb 17, 2015 at 12:07:21AM +0100, Stefan Keller wrote:
>>> Now I found a pattern: osm2pgsql imports junction=roundabouts
>>> incorrectly into table planet_osm_polygon (instead of planet_osm_line)
>>> if they are mapped as one single closed way (like
>>> http://www.openstreetmap.org/way/24932843)!
>>
>> Works fine with the default style for me. If you are using a modified
>> version make sure that 'junction' and 'highway' are set to 'linear',
>> not 'polygon'. osm2pgsql will put closed ways into the polygon table
>> as soon as any of its tags is marked as polygon in the style file.
>>
>> Sarah
>>
>>
>>>
>>> -S.
>>>
>>> 2015-02-16 2:20 GMT+01:00 Stefan Keller <sfkeller at gmail.com>:
>>> >> I observed, that many junctions (mapped as closed ways, see e.g. [1])
>>> >> but not all are imported as polygons (into table planet_osm_polygon)
>>> >> by osm2pgsql. I'd prefer to keep them as ways/roads.
>>> >
>>> > I meant roundabouts (junction=roundabout).
>>> >
>>> > -S.
>>> >
>>> > 2015-02-15 13:28 GMT+01:00 Stefan Keller <sfkeller at gmail.com>:
>>> >> Hi,
>>> >>
>>> >> I observed, that many junctions (mapped as closed ways, see e.g. [1])
>>> >> but not all are imported as polygons (into table planet_osm_polygon)
>>> >> by osm2pgsql. I'd prefer to keep them as ways/roads.
>>> >>
>>> >> Any ideas?
>>> >>
>>> >> -S.
>>> >>
>>> >> [1] http://www.openstreetmap.org/way/24932843
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev at openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list