[OSM-dev] Osm2pgsql 'route' relations geometry building

yvecai yvecai at gmail.com
Tue Jan 28 19:11:44 UTC 2014


Hi Kai,
A picture is maybe easier to understand: 
http://opensnowmap.org/?zoom=14&lat=46.54631&lon=6.12847&layers=&marker=false&marker=true
The red pistes are relations rendered with an offset to depict the ways 
they have in common with the orange one.
See how the offset affects http://www.openstreetmap.org/relation/1446600 
at the start and end: one wayleft, one way right.

As to know if it's a general demand, hard to say. This is just one of 
multiple corner cases that makes using offsets complicated in Mapnik.

Thanks for the pointer, I'll try to see if I can do something in 
pgsql_out_relation().

Yves

On 01/28/2014 07:14 PM, Kai Krueger wrote:
> Hi,
>
> I am not sure I fully understand what you are trying to do, but the part
> of the code that seems most likely what you are looking for is the
> function pgsql_out_relation (
> https://github.com/openstreetmap/osm2pgsql/blob/master/output-pgsql.c#L693
> ). First I thought you might be able to use the lua tagtransform to do
> this, but it doesn't actually pass the osm_ids (or geometry) into the
> lua script.
>
> If this is a general thing people want and need to do, perhaps one could
> expand the lua interface to pass the necessary information in to do
> these kind of processing steps too?
>
> Kai
>
> On 01/27/2014 02:16 PM, yvecai wrote:
>> I'm looking for the code in OSm2pgsql responsible for 'route' relations
>> pre-processing.
>>
>> When a relation make a loop on itself (the same way appears twice in the
>> relation, backward, then later forward) osm2pgsql does the same: the
>> resulting linestring is complete. Certainly great for routing, this has
>> some un-desired effects (at least for me) for rendering.
>> For instance if using 'offset' parameter in mapnik, the forward part
>> will be offset left, and the backward right, which I'd like to avoid in
>> some cases.
>> Could somebody points me to the relevant part of the code where I could
>> check for duplicate way IDs passed to geos Linemerger ?
>>
>> Yves, not so good in reading C
>>
>>
>




More information about the dev mailing list