I have a given table in postgreSQL with OSM data which is used for routing purposes in Java with PGRouting. There exist two columns which I don't understand. They belong to osm2po. They are labeled with "flags" and "clazz". I know, that flags describe the kind of road. It means, whether it is driveable by car, bike,… The problem now is, that I do not understand the meanings of the values in the column clazz. I just know that they also describe the road type. Can anybody explain, what the values like 12, 15, 31,… mean? Does a documentation exist where the meaning of the values is written down?
PostgreSQL – Understanding Values in Column clazz (osm2po)
javaosm2popgroutingpostgresql
Related Solutions
Are all those advantages real?
It can actually do those things, if that's what you mean. It takes work from you to set the data up properly.
Isn't pgRouting a kind of a blackbox? There are just a few tutorials on how to use it, and even these tutorials introduce even more unanswered questions. Isn't it simpler to build the desired [Goal] system from scratch?
The documentation isn't good, that's true. But, all of the source is there. It's hardly a black box and can keep things DRY.
What's the whole purpose of storing routable data the PostgreSQL/PostGIS way (geometry columns, strange database schema) instead of having just two tables - nodes and edges in a simple MySQL database?
If MySQL does everything you need and you're familiar with it then use that. PostgreSQL/PostGIS is much more powerful from a relational database and spatial analysis perspective. That doesn't mean you have to use it or even that it's better for your application. If you want better performance, more features and strong spatial analysis functions, switch to PostgreSQL/PostGIS. If what you have works well enough, don't worry about it.
See also: Cross Compare of SQL Server, MySQL, and PostgreSQL
osm2po exports data compatible with pgRouting's shortestpath and shortestpathastar. Hence turn restrictions are not directly supported. But there is a hidden feature which at least give you some more information: Have a look into the osm2po.config file and search for this line:
#postp.2.class = de.cm.osm2po.plugins.PgVertexWriter
uncomment it by removing the "#" and osm2po will provide a second table of vertices. In this table you'll find a rather informational field called "restrictions". You'll recognize values like this one
-9231_12704+10841_12704
9231, 12704, 10841, 12704 denote IDs in the network table. A minus (-) means "NoTurn" a plus (+) means "OnlyTurn" In words: Coming from Segment ID 9231 you must not turn to 12704 and coming from ID 10841 you may only turn to 12704, other combinations in this link are not allowed.
The latter is the most difficult part because you'll have to analyze the entire crossing in order to change OnlyTurns into NoTurns.
In addition these rules only refer to the corresponding vertex (table row).
You see, the only missing part is a small SQL/StoredProcedures which does this job ;-)
Best Answer
The file osm2po.config, which can be obtained from the downloads tab on the osm2po page, contains a table with four column, defined as:
And here are some sample rows, which I think explain where the 12, 51, etc, you are seeing comes from (in the second column).
It does say that the class can be in the range 1-127, and there are only 23 different values in that config table, so I trust that covers all the ones you are seeing?
Following comment from OP, here are the the official osm highway docs