Wednesday, 2 May 2018

How to make osm2po 5.1 write an SQL file?


With osm2po 5.1, I can get the osm2po router running


D:\osm2po-5.1.0>java -Xmx1024m -jar osm2po-core-5.1.0-signed.jar 
prefix=vie ..\vienna_austria.osm.pbf

but the resuting vie folder only contains the osm2po graph .gph and no .sql file for import into PostGIS. I don't get any warnings and couldn't find any new instructions in the documentation related to writing .sql files.



In 5.0, the .sql file is created as expected.



Answer



Spotted this under the release notes



The PgRoutingWriter has moved to the osm2po-plugins.jar which is open source. The writer is not enabled by default anymore. If needed, please edit (uncomment) the corresponding line in the osm2po.config or add it to the command line call.



If you update your config file to remove the comment hashes from this block of lines, it generates the .sql file


postp.0.class = de.cm.osm2po.plugins.postp.PgRoutingWriter
postp.0.writeMultiLineStrings = true
postp.1.class = de.cm.osm2po.plugins.postp.PgVertexWriter

postp.2.class = de.cm.osm2po.plugins.postp.PgPolyWayWriter
postp.3.class = de.cm.osm2po.plugins.postp.PgPolyRelWriter

postp.4.class = de.cm.osm2po.postp.GeoExtensionBuilder
postp.5.class = de.cm.osm2po.postp.MlgExtensionBuilder
postp.5.id = 0
postp.5.maxLevel = 3, 1.0

postp.6.class = de.cm.osm2po.sd.postp.SdGraphBuilder


# Pg*Writer usually create sql files. Enable the following
# parameter to redirect them to stdout (console)

postp.pipeOut = false

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...