4

I have imported the entire UK OSM dataset using the excellent osm2po. The metatdata of the imported table is shown below and my question is whether any of the columns map to ROAD TYPE. If not may I instruct osm2po to include road type as one additional column?

Of course, I wish to do this in order to help estimate accurate costs for different types of journey.

Many thanks,

        Table "public.result_2po_4pgr"
    Column     |       Type        | Modifiers 
---------------+-------------------+-----------
 id            | integer           | not null
 osm_id        | bigint            | 
 osm_name      | character varying | 
 osm_source_id | bigint            | 
 osm_target_id | bigint            | 
 clazz         | integer           | 
 flags         | integer           | 
 source        | integer           | 
 target        | integer           | 
 km            | double precision  | 
 kmh           | integer           | 
 cost          | double precision  | 
 reverse_cost  | double precision  | 
 x1            | double precision  | 
 y1            | double precision  | 
 x2            | double precision  | 
 y2            | double precision  | 
 geom_way      | geometry          | 

2 Answers 2

5

The attribute you are looking for is the clazz column. Tipp: Compare the values to those configured in the osm2po.config file.

1
  • Ok great: this works. In the osm2po.config file the tag wtr.tag.highway.motorway has values 1, 11, 120. I search for objects with clazz==11 in Quantum and, sure enough, the UK motorways are highlighted. Commented Sep 7, 2012 at 10:28
0

Yes..the column geom_way is actually the column/value you are looking for(i hope i ve understood your question properly) and its type is geometry type.In other words value in this column is the "Geometry" that will represent the "Road" on the map. You can ofcourse extract this geometry into various types like WKT format using functions like ST_AsText. My experience suggests that the columns source and target are the node ids allocated by osm2po and can be used for routing algorithm (pgrouting).The column cost represents the cost you are probably looking for.you also have a high reverse cost (like 100000) that represents that "This way is one way".

1
  • 1
    geom_way is the wkb for the road (line) geometry
    – Carsten
    Commented Sep 6, 2012 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.