Download OsmAndMapCreator and extract.
Install osmupdate
and osmconvert
into path.
cd ~/bin
wget -O - http://m.m.i24.cc/osmupdate.c | cc -x c - -o osmupdate
wget -O - http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o osmconvert
Download dump of China area PBF file from http://download.geofabrik.de/asia/china-latest.osm.pbf
Put PBF file and files in this gist into working directory.
Run createmap.sh
. It does these steps:
- Download latest patch to make map data up to date.
- Generate OBF map file used by OsmAnd.
Generating full China map takes 90 minutes and output OBF file is 845M. Current script uses -b
parameter to filter out middle Guangdong area to reduce time.
To automatically run everyday, add a cron job:
0 13 * * 1-5 cd /home/me/workspaces/osm-mapbuild; ./update_and_create_guangdong.sh > guangdong.log 2>&1
adb push obf/Guangdong_2.obf /sdcard/Android/data/net.osmand/files/