# The harbour's map data

The Textbook of Sailing's simulator, on this website and in its phone app, sails on a model of
Auckland's Waitematā Harbour adapted from OpenStreetMap: the coastline and what each shore is
made of, the water's depth, the piers, pontoons and breakwaters, the beacons and buoys, the
buildings, the roads and the land use.

Map data © OpenStreetMap contributors (https://www.openstreetmap.org/copyright).

These adapted databases are made available under the Open Database Licence (ODbL) 1.0:
https://opendatacommons.org/licenses/odbl/1-0/. Here they are, whole, as the website and the
app use them, free to download:

- https://textbookofsailing.com/credits/map-data/coast.bin: the website's harbour. The land as
  polygons (the OpenStreetMap coastline and islands, with the mangroves and breakwaters), each
  edge of shore tagged with what it is made of; the beaches; the piers and pontoons; the beacons
  and buoys with their colours, shapes, topmarks and lights; and the ground's height on a 40 m
  grid. The header "CST2" and then a zlib stream.
- https://textbookofsailing.com/credits/map-data/osm.bin: the city. The road network, building
  footprints with their heights and kinds, and houses. The header "OSM2".
- https://textbookofsailing.com/credits/map-data/landuse.bin: what the ground is made of, on a
  10 m grid (0 unknown, 1 paved, 2 grass).
- https://textbookofsailing.com/credits/map-data/app-coast.bin: the phone app's copy of
  coast.bin (the header "CST1"), which its simulation reads.
- https://textbookofsailing.com/credits/map-data/app-obstacles.bin: every fixed thing in the
  harbour the app's boat can hit (piers, pontoons, berths, moored boats, ships alongside,
  beacons), made from the data above: a little-endian u32 count, then six f64 for each (x, z,
  the half extents along its own axes, its angle and the height of its top).

All positions are in metres on the simulator's flat map of the harbour, x east and z south of
36.84°S 174.755°E: latitude = -36.84 - z / 110950, longitude = 174.755 + x / 89170.

The ground's height in coast.bin and app-coast.bin also draws on New Zealand terrain data,
Copyright 2011 Crown copyright (c) Land Information New Zealand and the New Zealand Government
(the 8 m digital elevation model, through AWS Terrain Tiles), used under the Creative Commons
Attribution 3.0 New Zealand licence: https://creativecommons.org/licenses/by/3.0/nz/
