2

I am working on a offline routing app for a particular region which will use graphhopper library for android. I want to know is there any way to create osm.pbf file for a region instead of downloading the file for the whole country. Moreover is it possible to create .map file for a particular region ?

Thanks.

Rohit Kumar
  • 45
  • 1
  • 6

2 Answers2

2

The .map file can be created via mapsforge writer. The osm.pbf you can get via your database or your OSM extract using osmosis or other tools.

But I guess you just have an .osm file downloaded? This can be read directly from GraphHopper no need for a conversion.

Karussell
  • 17,085
  • 16
  • 97
  • 197
1

I used osmconvert (from PBF to PBF) to extract a boundary box subset out of the PBF file. Thus download the country file as a PBF; create a subset PBF file using osmconvert; process the PBF file for my GraphHopper, Nominatim and friends use.

Colin
  • 1,119
  • 12
  • 17
  • Thanks. Osmconvert is nice. Have you worked with graphhopper ? – Rohit Kumar Mar 12 '15 at 05:13
  • @RohitKumar - yes used the cut down PBF for a lightweight internal GH web service for walking directions around a campus. Essentially just followed their tutorial but inserted my PBF into the flow. Also fairly easy to extend the GH servlet to create your own response JSOn format if needed. Took a few days to get the hang of everything and make the process to download and crop new files and then insert them into the web service. Solid "product". – Colin Mar 17 '15 at 19:17