1

I develop an Android app that uses Mapsforge to display OSM maps. I could use a pre-built map in the MapsForge file format but that makes my APK file to big and I only need a small part of my country anyway.

How can I only get a small rectangle part of the world of OSM and put it in a map file?

3 Answers 3

4

A ready-to-go solution can be the web service of http://extract.bbbike.org/, there you can define a boundingbox on an online map and choose many different output formats for OSM based maps. They also have mapsforge format there.

Have not tried on my own so far, so I cannot give any information about size limit for downloads, like a whole continent or similar

1

I assume that you require the .OSM format.

Start by downloading the Planet.osm file, and use the program Osmconvert.

The command osmconvert planet-160104.osm -b=-144,20,-50,90 -o=subset.osm will subset to a square AOI as specified.

See more info here and specifically for subsetting the dataset here.

5
  • I guess I could do it with the Argentina map also? Since I can't download 46GB.
    – juergen d
    Commented Jan 8, 2016 at 11:08
  • Yes, you could also use a Argentina.osm file, if you had that available. Commented Jan 8, 2016 at 11:24
  • I think the Mapsforge file format is somewhat different than OSM: github.com/mapsforge/mapsforge/blob/master/docs/…
    – juergen d
    Commented Jan 8, 2016 at 13:38
  • @juergend - Then follow the guide here github.com/mapsforge/mapsforge/blob/master/docs/… and convert your subsetted .osm file into the Mapforge format. Commented Jan 8, 2016 at 14:13
  • I used OSMosis to convert a OSM file to a Mapsforge MAP and did only take a part of the map in the process with: .\bin\osmosis.bat --rb c:\\argentina.osm.pbf --mw c:\\argentina.map bbox=-27.12881324,-55.20423889,-26.50621777,-54.56977844
    – juergen d
    Commented Jan 8, 2016 at 16:48
0

You could try DogSheep Customizable Maps app. It lets you download maps by cutting it with a bounding box. The app uses MapsForge, so you could grab the map.map file from the download/dog_sheep/map_name directory, where map_name is the name you gave to the map when you downloaded it.

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.