Maps for Garmin GPS units generated from OpenStreetMap data using mkgmap. Includes all the configuration files used to generate the Garmin maps
See the release zip files for routable and non-routable maps of the whole of NZ and the North Island and South Island seperately.
The following instructions work under Linux or Windows if running a Bourne shell compatible shell (e.g. bash under Cygwin or Mingw/Msys etc.)
As described below these steps will generate maps for the New Zealand North Island, generating for other regions involves editing the scripts as described later in this document.
The following setup steps only need to be performed once:
- Download splitter from http://www.mkgmap.org.uk/download/splitter.html and install in 'tools'
- Download mkgmap from http://www.mkgmap.org.uk/download/mkgmap.html and install in 'tools'
- Download sea.zip from http://www.mkgmap.org.uk/download/splitter.html and install in 'input'
Only if you want to include contours built from SRTM data:
- Windows
- Install phygtmap pre-reqs:
- pip install setuptools
- pip install matplotlib
- pip install numpy
- pip install beautifulsoup
- pip install http
- pip install cookiejar
- pip install bs4
- Install phygtmap pre-reqs:
- Download phygtmap_2.21 from http://katze.tfiu.de/projects/phyghtmap/ and extract into /c/python27
- In /c/Python27/phyghtmap-2.21 directory run
python setup.py install
- Edit
build/contours.py
to set your username and password for Earthexplorer - (NOTE: I'm currently, May-2019, not able to generate contours on Windows, might by a python version issue)
- Linux:
- Download debian package from http://katze.tfiu.de/projects/phyghtmap/ and install
- ...(other steps?)
-
Download an OSM extract as a PBF file and place it in the 'input' directory
-
Split the PBF file into multiple parts with 'build/split.sh'
split.sh options:
- -i= Specify the name of the input PBF file to split. If not specified defaults to .pbf
- -p= Specify the name of an optional polygon file that will be used to define the region to which the split data is clipped
- -r= Specify the name of the region being split, defaults to oceania_nz_ni
-
If including contours, perform the steps from 'Generating Contours' below
-
Generate the Garmin image file with 'build/map.sh', by default this will build a routeable map without contours
map.sh options:
- -c Add contour lines to map
- -r= Specify the region for which map is generated, defaults to oceania_nz_ni
- -s=<STYLE> Use <STYLE> style rules to convert OSM data to Garmin
- -t= Use type rules when rendering the Garmin map
The following steps are only required if you wish to add contour lines to the generated maps. The steps do not need to be performed every time maps are generated as unlike OSM data the DEM data used to generate the contours does not often change.
NOTE: On Windows currently not working with Python2.7, does this require Python3?
Use this step to download SRTM data and build a PBF file of contours from the data.
- Generate the contours with 'build/contours.sh'
- Build your maps as usual using the -c option to include contours
- NOTE: Generate contours after splitting the source OSM PBF file into multiple parts as phygtmap uses the polygon file generated during splitting to define the area extent for the contours.
- Download LINZ contour data as a shapefile from https://data.linz.govt.nz/layer/50768-nz-contours-topo-150k
- Convert LINZ contour data by loading into JOSM (requires the XXX plugin) and then saving as an OSM file
- Split the resulting OSM file into multiple pbf files with: java -Xmx1000m -jar tools/splitter-*/splitter.jar [osm_file] --output-dir=work/contours/[region]
- Build your maps as usual using the -c option to include contours
- Download a OSM data in PBF format for the area for which you wish to generate a map.
http://download.geofabrik.de/
is one source. Put the file in theinput
directory - Create a .poly file defining the area for which you wish to generate the map. Name the file .poly and put it in the
input
directory. This can be ommitted if you wish to generate for the whole downloaded area but this will probably be too big for most Garmin devices. - Perform the generation steps as above
See build/nz.sh
for an example that downloads a PBF file for the whole of New Zealand and builds seperate routable and nonroutable maps for the North and South islands using two different poly files to specify the clipping area.
Under either Linux or Windows QMapShack
may be installed and used to preview the Garmin map img files