OpenStreetMap – Extracting Primary and Secondary Roads from OpenStreetMap Data

openstreetmap

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.

Best Answer

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.

Related Question