2

As osm2po was a more reliable way to convert an .osm I went for that solution to load my date in postgres.

In the workshop however the author points out to check the result after osm2pgrouting. The following tables must be created:

"classes"
"geometry_columns" "nodes"
"spatial_ref_sys" "types"
"vertices_tmp"
"vertices_tmp_id_seq" "ways"

After the sql (generated from osm2po) has run, only the tables "geometry_columns" and "spatial_ref_sys" are created. How do I fix this difference?
Is osm2po incomplete? Did something go wrong?

Can anyone point me in a better direction?

Thanks alot!

2 Answers 2

2

geometry_columns and spatial_ref_sys are created and populated by PostGIS automatically in case you add a geometry column. The other tables are more or less temporary, used for finding links via assign_vertex_id. osm2po does all this segmenting-stuff for you. All you need is the resulting table which is created by osm2po. In addition osm2po does not rely on assign_vertex_id and uses the original links from osm instead.

6
  • Carsten is right. And there is nothing incomplete when vertices_tmp is missing either, which is a temporary table and can be deleted. While osm2po is the better import tool at the moment, it's not part of the workshop, because it's not on OSGeo Live DVD. And it's not on the LiveDVD because it's not released under Open Source license.
    – dkastl
    Commented Aug 9, 2012 at 20:18
  • Thanks alot for this valuable info. Now I can continue without doubt, which means alot :)
    – user9347
    Commented Aug 10, 2012 at 8:37
  • But as I'm continuing, confusion increases too. I see in the workshop that it uses the functions of pgRouting. (e.g. shortest path) How do I continue now, knowing that there is not even a "ways" table? The osm2po tutor (osm2po.de/tutorial.php) clearly states that this is the only thing needed for pgRouting, which looks like contradiction if the ways table is not existing.
    – user9347
    Commented Aug 10, 2012 at 9:34
  • 1
    The tutorial is deprecated and not part of the official web page anymore.
    – Carsten
    Commented Aug 10, 2012 at 11:58
  • 1
    Have a look into the pdf on page 9 chapter 4.5.
    – Carsten
    Commented Aug 11, 2012 at 9:41
1

There is one more thing that no one mentioned. So the standard osm2po tables end up missing a vertex table equivalent to the vertices_temp table in osm2pgrouting. I found this table quite useful, as it has the lat/long for each osm vertex as well as its osm_id node id. You can still get this from the osm2po application, but you need to go into the osm2po.config configuration file and uncomment the line:

#postp.1.class = de.cm.osm2po.plugins.PgVertexWriter

If you uncomment this line, (remove the #), then rerun the osm2po application on your osm or pbf file, it will generate a new sql script with a prefix_2p_v.sql file. You can then run this like the pgr.sql file and it will add a vertex table.

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.