[OSM-dev] Osm2pgsql not importing routes?

Lynn W. Deffenbaugh (Mr) ldeffenb at homeside.to
Thu Feb 23 20:36:38 GMT 2012


I've read that osm2pgsql doesn't really import everything from an OSM 
file into the DB.  Specifically,  
http://wiki.openstreetmap.org/wiki/Osm2pgsql/schema says:

> Notice that relations are not imported directly. Ways which are 
> members of relations are imported in a special manner (see description 
> for planet_osm_line), but there is no easy way to establish a 
> relationship between a relation and its members, or to get tags 
> associated with a relation (unless they have ways as members). 

Also:

> Note that the mechanism of creating additional rows for each relation 
> membership, with the tags of the relation, does *not* apply to nodes. 
> That is, with the current scheme, there is no way to get parent 
> relation data for a given node. 

which, conjunction with the following from 
http://wiki.openstreetmap.org/wiki/Osm2pgsql#From_source_.28generic.29, 
may explain the lack of the route_name column.

> The default style for osm2pgsql does not import all tags from an .OSM 
> file to a pgsql database. see 
> http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/default.style 
> for a list of what keys are imported. 

I wonder if that's part of what you're running into?

Lynn (D) - KJ4ERJ - Author of APRSISCE for Windows Mobile and Win32


On 2/23/2012 3:20 PM, yvecai wrote:
> Sorry, I took the subject from an old topic.
>
> Here an extract of my osm file:
>
>     <relation id="1401913" version="1"
>     timestamp="2011-01-31T21:31:42Z" changeset="7149413" uid="171657"
>     user="yvecai">
>     <member type="way" ref="48769799" role=""/>
>     <member type="way" ref="97599611" role=""/>
>     <tag k="color" v="green"/>
>     <tag k="name" v="Haute Joux"/>
>     <tag k="piste:type" v="nordic"/>
>     <tag k="route" v="ski"/>
>     <tag k="type" v="route"/>
>     </relation>
>
> Which contains 49 relations according to osm2pgsql output, but the 
> following requests find nothing:
>
>     select count(*) from planet_osm_line where osm_id = -1401913;
>     select count(*) from planet_osm_line where osm_id < 0;
>
> and the column route_name does not exists.
>
> osm2pgsql SVN version 0.80.0
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20120223/6664fc56/attachment.html>


More information about the dev mailing list