Import fails for custom bounding box

Hello everyone. I have a big osm file and I’ve cut it by osmosis. When I run - it throws an error. Is it possible to cut the map (bound) and generate routes?

This is definitely possible - were there any quirks you stumbled over @boldtrn? Maybe the area is too small? Also can you try 0.8.2 instead of the latest master?

Tryed version 0.8.2 - the same result.
Maybe, something wrong in my osmosis script? Or some needed settings in

osmosis --rx file=“D:\Downloads\south-fed-district-latest\south-fed-district-latest.osm” --mw file="…/maps/" bbox=45.083502,39.080878,45.309949,39.466773 preferred-languages=ru

And after that I ran import “path to”

Make sure the bounding box is correct, that was a mistake I made. E.g. use something like this here instead:

–bounding-box top=52 left=9 bottom=51 right=10

It seems to me - bbox is correct - because the map works fine without offline routing (renders,scrolls,zooms). Also, I’m a bit confused your answer - where should I paste --bounding-box ?

because the map works fine without offline routing (renders,scrolls,zooms).

ok, then it should indeed work. Can you try to remove the graph-cache folder? Or are you using this for routing only? Can we then remove the ‘map matching’ tag of this topic?

–bounding-box ?

after osmosis … so something like osmosis --bounding-box …

Hmmh, did you run the or … it looks like there is some problem which I need to fix (or at least the error message)

E.g. it is not

./ action=import some.pbf


./ action=import datasource=some.pbf

I used bbox. I think it equals bounding-box - used for cutting area. I used import.
Sure, we can remove map tag. So are you going to fix the problem or is there any ways to fix it now?

I’ve changed core-map-mapping tag to core. If I’m wrong, it’s nice of you to change it.

The should work - what is your exact command? Did you remove the created graph folder before trying again? And does a city extract like this work in your case?

  1. Prepare map
    osmosis --rx file=“D:\Downloads\south-fed-district-latest\south-fed-district-latest.osm” --mw file=“D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2\” bbox=45.083502,39.080878,45.309949,39.466773 preferred-languages=ru

  2. Then -try to generate routing files
    D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2> import “D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2\”

No, I didn’t find graph folder - so couldn’g delete it

Tryed file provided by you - but import - threw an error - out of memory

Ok, you cannot use the .map file from mapsforge or something. You have to use the pbf, please try the linked one above

I tried to use pbf.

There is an error

  1. I downloaded file
  2. Then I ran script
    D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2> import “D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2\kyrgyzstan.pbf”

Any ideas?

You need to increase the available memory for the JVM. Use e.g.

export JAVA_OPTS="-Xmx2g -Xms2g"

before the script

Indeed there is some confusion here…

  • Mapsforge map creation with map-writer (using bbox parameter)
  • GraphHopper graph creation from osm/pbf data extracted with Osmosis (using --bounding-box parameter)

Thanks everyone who helped me. At the end I did next:

  • used this site for download pbf file for routing and another
  • fixed according to karussell advice (-Xmx2g -Xms2g)
  • based on this file - I generated offline routing files
  • ran map-writer for needed file for generate cutted translated mapsforge file

No need to change the script just call the command before you execute the script and it will be picked up

Sorry for the late reply in this topic. I just received an email. Cutting osm files with other tools and loading with graphhopper is definitely possible and shouldn’t require any additional steps.

Just wanted to add this is additional information for anyone wondering since the problem of @someonehere seems to be unrelated to that.