Import fails for custom bounding box

Hello everyone. I have a big osm file and I’ve cut it by osmosis. When I run import.sh - 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 config.properties

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

And after that I ran graphopper.sh import “path to cutted.map”

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 map-matching.sh or graphhopper.sh? … it looks like there is some problem which I need to fix (or at least the error message)

E.g. it is not

./map-matching.sh action=import some.pbf

but

./map-matching.sh action=import datasource=some.pbf

I used bbox. I think it equals bounding-box - used for cutting area. I used graphhopper.sh 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 graphhopper.sh 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\dinskay_stanica.map” 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>graphhopper.sh import “D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2\dinskay_stanica.map”

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

Tryed file provided by you - but graphopper.sh 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 http://download.bbbike.org/osm/extract/planet_70.83_40.236_156acdd0.osm.pbf
  2. Then I ran script
    D:\Downloads\graphhopper-0.8.2\graphhopper-0.8.2>graphhopper.sh 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 http://extract.bbbike.org/ for download pbf file for routing and another
  • fixed graphopper.sh 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.