[OSM-dev] Making polylines from route relations

Komяpa me at komzpa.net
Wed Sep 19 13:36:00 BST 2012


2012/9/19 Richard Fairhurst <richard at systemed.net>:
> Hi all,
>
> Does anyone have any code to convert a route relation into a polyline?

Can you please describe the technology that you'd like to use?
In PostGIS it's as simple as ST_LineMerge(ST_Union(way, way, way)).

The code that you may want to look at is in osm2pgsql in C++
(build_geometry.cpp) or in many languages in osm2poly.pl and its
relation-aware versions.

> In other words, given a relation with (unordered) ways A, B, and C, which
> contain nodes "i-j-k", "p-o-n", and "k-l-m-n", I'd like to get
> "i-j-k-l-m-n-o-p" out the other end. Not the hardest of programming
> challenges, but I thought I'd check if it's been done already...
>
> cheers
> Richard
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev



-- 
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
xmpp:me at komzpa.net mailto:me at komzpa.net



More information about the dev mailing list