9

After importing my country roads from OSM data, I need to create a network ( roads connecting big cities ) for use with pgRouting.

For this, I need the green, blue and red ones (http://www.openstreetmap.org/#map=11/-29.8582/-51.5238) but I'm unsure how to select them in database, since OSM is not clear about how to find them.

I just try http://taginfo.openstreetmap.org/keys/highway#values using PRIMARY and SECONDARY tag values, but the result sometimes gives me the orange and yellow ones too.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Magno C
  • 2,140
  • 3
  • 24
  • 63

3 Answers3

8

As already mentioned you have to look at the highway key.

The colors you are talking about are defined by the rendering stylesheet and represent the following tags:

  • blue: highway=motorway, highway=motorway_link
  • green: highway=trunk, highway=trunk_link
  • red: highway=primary, highway=primary_link
  • orange: highway=secondary, highway=secondary_link
  • yellow: highway=tertiary, highway=tertiary_link

For more details on the colors refer to the stylesheet of the current default layer at openstreetmap.org. There is also a description on the international equivalence of these values.

scai
  • 6,120
  • 16
  • 28
3

Use the OpenStreetMap (OSM) Key for Highways:

http://wiki.openstreetmap.org/wiki/Key:highway

Mapperz
  • 49,701
  • 9
  • 73
  • 132
3

It's true, what is in special interest in this case are all objects with highway=* tagged.

BUT usually all the processing is already done by OSM2pgrouting and you don't need to struggle around with tagging schemas etc.
If you then want to tweak the routing itself, you might consult the pgrouting manual.

So you download an OSM planet extract, (optional filter it for highway=* objects using osmosis) and drop it to osm2pgrouting.

Mapper
  • 1,642
  • 11
  • 20