[OSM-talk] Route relations on cycle map
Jon Burgess
jburgess777 at googlemail.com
Sun Oct 28 18:04:24 GMT 2007
On Sun, 2007-10-28 at 18:10 +0100, Dave Stubbs wrote:
> Hi,
> For those interested in how the relations are being imported for
> mapnik, it's just an extra python script after the osm2pgsql import
> which parses the relations from the end of the planet.osm, and runs
> some SQL to create new ways in the planet_osm_line table for each of
> the referenced osm_id's (ie: insert into planet_osm_line (ncn_ref,way)
> (select '<ref>', way from planet_osm_line where osm_id in (<relation
> members>)) ). This approach may prove to have some problems, but it
> seems to work for my current tests.
Seems a reasonable approach. The current relation handling on osm2pgsql
is rather messy and only supports multipolygons.
If you have lots of relations to add you might consider adding an index
on planet_osm_line.osm_id otherwise it will need a sequential scan to
locate all the members which will probably be quite slow.
Jon
More information about the talk
mailing list