10

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.

1
  • Running 5.1, I have the same problem as the OP (folder contains only .gph and 2po files) and have tried both Carsten and Steven's suggestions for the .config file mods, without the success that Anita had - ie Still no sql. I've also tried the settings for postp.pipeOut. Interestingly I DO get a warning in the log file, stating that "WARN cmd 'p' set but no postprocessors injected" So clearly PgRoutingWriter can't produce something if it is not being invoked (despite being tasked), but being a newbie I'm at a loss to know why, sorry! (PS I realise that this is not a solution to OP problem but t Commented Nov 15, 2016 at 23:53

1 Answer 1

17

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
5
  • Thanks Steven! Makes sense reading your instructions now.
    – underdark
    Commented Jan 4, 2016 at 19:41
  • 10
    It is sufficient to enable (uncomment) this line only: postp.0.class = de.cm.osm2po.plugins.postp.PgRoutingWriter
    – Carsten
    Commented Jan 5, 2016 at 18:21
  • In osm2po 5.2.9 I got a de.cm.osm2po.sd.postp.SdGraphBuilder not found warning ... Is it important? ( It was changed to postp.7.class )
    – Magno C
    Commented Jan 18, 2018 at 11:22
  • 1
    @MagnoC see Carsten's comment above - you should only need the one line (IIRC, Carsten is author of osm2po) so try commenting out any which give exceptions.
    – Steven Kay
    Commented Jan 18, 2018 at 11:33
  • How can I append or update data ?
    – Magno C
    Commented Feb 6, 2018 at 13:28

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.