I tried create a .map file of Alaska from the .osm file provided by
downloads.cloudmade.com.
I finally got a .map file, but I had to convert the .osm to a .pbf
first, otherwise I was getting the following Exception upon running
~/Development/osmosis-0.40.1/bin/osmosis --rx file="alaska.osm" --
bounding-polygon file="alaska.poly" --mw file="alaska.map" type=hd
SEVERE: Thread for task 1-rx failed
java.lang.NullPointerException
at
org.mapsforge.preprocessing.map.osmosis.MapFileWriterTask.release(MapFileWriterTask.java:
192)
at
org.openstreetmap.osmosis.areafilter.v0_6.AreaFilter.release(AreaFilter.java:
640)
at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:
125)
at java.lang.Thread.run(Thread.java:680)
Jan 17, 2012 6:25:07 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
After downloading and building osmconvert (download osmconvert.c, run
"cc osmconvert.c -lz -o osmconvert"), I was able to do the conversion
with:
~/Development/osmosis-0.40.1/osmconvert/osmconvert alaska.osm -
o=alaska.pbf
Then running the following, gave me the .map file:
~/Development/osmosis-0.40.1/bin/osmosis --rb file="alaska.pbf" --
bounding-polygon file="alaska.poly" --wb alaska.map
I pushed the .map file onto my device so it lives at /sdcard/
alaska.map.
Changed the hardcoded String in the BasicMapViewer.java file to point
to that map file (instead of Berlin, which worked fine). Now, when I
activate that activity I get the following log messages:
01-18 10:27:19.440: D/osm(3256): main: invalid magic byte: ������
01-18 10:27:19.440: D/osm(3256): OSMHeader 1 %
I get the same message when I try to use the California map from
http://download.mapsforge.org/maps/north-america/us/.
Anyone have a good idea what is going on? I am happy to provide more
information if it would be helpful.
Thanks,
Joey