User:Karora

From OpenStreetMap Wiki
Jump to: navigation, search
Mini-osm-logo.png New Zealand

Latitude : -41.11, Longitude : 174.87
Browse New Zealand map
Map of New Zealand

I live in Porirua and work in Wellington. I've lived all over Wellington in the last thirty years, and before that I lived in Christchurch, Hamilton and Rotorua. I'm also very familiar with some areas in Auckland.

My real name is Andrew McMillan and if you want to know more about me a good starting point is [1].

Here are some map bookmarks that I find useful from time to time:

Nightly OSM Export for New Zealand

I do a nightly export of the New Zealand OSM data which you can download from http://debian.mcmillan.net.nz/nzosm/ along with a conversion to the Garmin IMG format using mkgmap.

The script I use to do this looks like this:

#!/bin/sh
#
# Script by Andrew McMillan <andrew@catalyst.net.nz> to retrieve
# current OSM data for New Zealand and convert it into a Garmin
# file.
#

# Our bounding box
WEST=166
EAST=178.5
NORTH=-34
SOUTH=-47.5

# Which the API wants as...
BBOX="*[bbox=${WEST},${SOUTH},${EAST},${NORTH}]"

# Which attaches to the URL...
OSMAPIURL="http://osmxapi.hypercube.telascience.org/api/0.5/${BBOX}"

# We'll timestamp our files with this
filedate="`date +%Y%m%d-%H%M`"

# Retrieve with curl
for (( count=0; count < 5; count++ )); do
  echo "`date`: Retrieving OSM file (try ${count})"
  curl --globoff --fail --silent "${OSMAPIURL}" -o "New_Zealand-${filedate}.osm" && break
done
if [ "$count" -ge "5" ]; then
  echo "`date`: Failed to download OSM file"
  exit 1
fi

# Symlink as current default name
rm New_Zealand.osm
ln -s "New_Zealand-${filedate}.osm" New_Zealand.osm

# Build the Garmin file with mkgmap
echo "`date`: Building Garmin .img file"
rm 64010001.img
java -jar ../mkgmap/mkgmap.jar --mapname=64010001 --description="OpenStreetMap for New Zealand" New_Zealand.osm

#
# Move to a timestamped filename and link back to the invariant one.
mv 64010001.img "64010001-${filedate}.img"
ln -s "64010001-${filedate}.img" 64010001.img