I've been trying to import all the ways for Romania into my PostgreSQL database using Geofabrik and osm2po.

However, I noticed that some chunks of a county road are missing by using the following query:

SELECT id, geom_way FROM ro_2po_4pgr,
    SELECT ST_Expand(ST_Extent(ST_SetSRID(ST_MakePoint(23.2161769, 45.6347162), 4326)), 0.2) as box
) as bbox
WHERE ro_2po_4pgr.geom_way && bbox.box

Which resulted in: enter image description here

The missing chunks for road DJ705A that I have found on openstreetmap.org are:


You can find them by replacing the last param at this url: https://www.openstreetmap.org/way/254048490

With the help of a gentleman from Geofabrik (I was thinking that there was the issue) I received the confirmation that these ways do exist, plus he gave me the following command to run for myself:

osmium cat -tway romania-latest.osm.pbf -fopl | grep -e w254048490 -e w258364773 -e w661526471 -e w258367634 -e w254112343 -e w778597709 -e w778324715

Indeed, these ways do exist in the .pbf file, but they are not present in the generated .sql file.

I tried increasing the memory, the tile size, even importing service and living_street highway types.

I tried parsing the data from .bz2 with the comand:

curl -s -L http://download.geofabrik.de/europe/romania-latest.osm.bz2 | bzcat -c | java -Xmx12g -jar osm2po-core-5.3.2-signed.jar prefix=ro cmd=c tileSize=x postp.0.pipeOut=true log.0.to=err postp.0.class=de.cm.osm2po.plugins.postp.PgRoutingWriter > ro.sql

(here it spits the output straight to an .sql file) ... it still did not work.

This is the command that retrieved the maximum amount of ways (740073)

java -Xmx32g -jar osm2po-core-5.3.2-signed.jar cmd=tjsp prefix=ro tileSize=x http://download.geofabrik.de/europe/romania-latest.osm.pbf postp.0.class=de.cm.osm2po.plugins.postp.PgRoutingWriter

(whether I used 6GB, 10GB, 12GB or 32GB it did not make any difference)

I could really use some help, since I ran out of options and all of this is new to me.


1 Answer 1


After sending an email to osm2po a few days ago, sir Carsten gave me the answer:
.default.wtr.deny.tracktype.grade[4|5] = car|bike - line 241 in osm2po.config

I commented it out and it worked!

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.