Skip to main content

Posts

Showing posts from September, 2012

Mapping New Zealand: Exporting tiles from TileMill

I wanted to publish a tiled version of my New Zealand maps. I first tried to upload my maps directly to MapBox.com from TileMill, but their free plan (50 MB upload storage) was not enough for all my zoom levels. This blog post describes an alternative, and a bit more complicated, way to publish your maps from TileMill. TileMill uses a clever format called MBTiles . This is an open specification from MapBox capabale of storing millions of tiles in a single SQLite database. You can download your maps as MBTiles from the TileMill interface. This was easy to do for my topographic map , and a bit more tricky for my seafloor map which crosses the antimeridian . TileMill don't allow you to select an area for export which crosses the antimeridian, without making a full roundrip around the Earth: Almost 45,000 tiles are needed to cover this big area for zoom level 0 to 9, while only 4700 tiles are needed to cover the area with data. Although TileMill has support for reduntant tile...

Mapping New Zealand: Doing magic with TileMill

Finally, I got some time to play with TileMill . I've added some textures to my shaded relief map, and I'm quite happy with the result. Here are a few samples: Tongariro National Park Marlborough Sounds Westland National Park Milford Sound All the data I've added are from  NZ Topo 500 from LINZ Data Service , and I've tried to find natural looking colors for my map stylesheet:

Creating a shaded relief map of New Zealand

After creating a shaded relief map of New Zealand's seafloor , and it's time to move onshore. I'm going to use the same slope-enhanced hillshade technique. It was a bit tricky, but I think I've found a workflow that works. While we got a 250 meter resolution Digital Elevation Model (DEM) of New Zealand's seafloor , you can download a 25 meter resolution DEM for the North and South Island from Landcare Research . The free datasets are available from the LRIS portal , where you can also read about the accuracy of the data . I got an invitation to visit Landcare Research when I was passing through Palmerston North. They do a lot of open source stuff, and they have some exciting projects going on! Also, if you have a budget, you should definately consider buying the 8 meter resolution DEM from the best cartographers (or mapsmiths which they like to call themselves) in New Zealand -  Geographix . They also provide some free samples for you to play with. You...

Mapping New Zealand: Editing and merging shapefiles with QGIS

The data you want to map is not always in the format you need. I was looking for a dataset containing polygons for all land areas (islands) in New Zealand (1:500,000 scale), but I couldn’t find it on the LINZ Data Portal . So I tried to create it myself from the data I found: Update Oct. 8th 2012: LINZ has added new polygon datasets for all land areas in New Zealand (see comments below), so you don't have to do the job described in this blog post. The techniques for editing and merging shapefiles are still valid. NZ coastlines (Topo, 1:500k) This dataset (nz-coastlines-topo-1500k.shp) contains coastlines for North Island, South Island and Stewart Island, - but not for offshore islands (most notably the Chatham Islands ) and the smaller islands around the coast. The coastlines are represented as lines, while I need the data as island polygons. This is how I converted the lines into polygons with QGIS: Vector -> Geometry Tools -> Lines to polygons I named the...

Mapping New Zealand: Dealing with the antimeridian in TileMill

I want to play with my new seafloor map in TileMill , which is a great map design studio. It’s built on top of Mapnik , but instead of XML you can style your maps with CartoCSS , which is much more user friendly. The biggest limitation of TileMill is that it only supports the Web Mercator projection (even though the underlying rendering engine, Mapnik, handles multiple map projections very well). Hopefully, TileMill will add support for other map projections and custom tiling schemes in the future. Web Mercator is clearly not the ideal map projection to use for countries far north, like Norway (use UTM 33N ), or countries not so far south, like New Zealand (use NZTM2000 ). Another problem with Web Mercator, and other projections centered at the prime meridian, is that you often get troubles crossing the antimeridian  on the opposite side. This is unfortunate for New Zealand, where the animeridian is just east of the North Island, leaving the Chatham Islands on the other...

Creating a custom map tiling scheme for New Zealand’s seafloor

First of all I want to thank Brent Wood at National Insitute of Water & Atmospheric Research (NIWA) for inviting me to their office after writing my first blog post about seafloor mapping in New Zealand. Luckily I happened to be in Wellington where they are located, the best city in New Zealand (see photos below)! I was also fortunate to meet Kevin Mackay, the Marine Database Manager who’s responsible for the bathymetry dataset I’ve been using to create this map. You’ll be surprised about the amount of work and data needed to create a bathymetry dataset for such a large and hidden area of our planet. This mapping has been beneficial to New Zealand, as they have been able to claim rights to 1.7 million square kilometers of extended continental seabed , an area about six times New Zealand’s total land area. In the last blog post we created a seafloor map of New Zealand using shading relief. The map image we created was very large, 12000 x 15200 pixels, with a resolution of 250 m...

Creating a seafloor map using shaded relief

I'll use the bathymetry data from NIWA to create a seafloor map of New Zealand using shaded relief techniques. I used the same techniques when I created the terrain map of Jotunheimen in Norway, so I won't go into detail here. Let’s start by creating a color relief of the seafloor. I’ve used a blue color gradient similar to the one used by NIWA , progressing from light shallows to dark depths. Source: NIWA gdaldem color-relief -co compress=lzw nz-bathymetry.tif depth-gradient.txt nz-bathymetry-relief.tif I want to enhance the view by using a couple of hillshade techniques. Let’s create a plain hillshade with gdaldem: gdaldem hillshade -alt 60 -az 135 -co compress=lzw nz-bathymetry.tif nz-bathymetry-hillshade.tif  Notice that the light source (-az) is not from the default top left position (azimuth = 315°), but in a bottom right position (azimuth = 135°). The reason for this is that bathymetry data are inverted compared to elevation data, with higher d...

Creating a Seafloor Map of New Zealand

New Zealand is the perfect country to map, not only because of all the free data available - it also has a very interesting topography, above and below the sea surface. Actually, around 95 percent of New Zealand’s territory is under water. So I wanted to start off my mapping tour by creating a seafloor map of New Zealand. On my way to  Whakaari / White Island , New Zealand’s only active marine volcano. Why is it there and what's hiding below the surface? You can get bathymetry data (underwater depth) from the National Institute of Water and Atmospheric Research (NIWA) . The dataset covers New Zealand's Exclusive Economic Zone and is free to use for non-commercial purposes ( terms and conditions ). This page describes how the data was collected. I downloaded the “NZ 250m ESRI ASCII grid 530Mb” version of the dataset. The zip containes two files, RegionalBathymetry2008.asc and RegionalBathymetry2008.prj. The first file contains the actual data in an ASCII grid fo...

Getting free data in New Zealand

So far on my travels through New Zealand I’ve been a bit frustrated with the the slow and costly WiFi services. Access to publicly funded data about the country is a totally different story. It’s fast, easy, and free! Countries who lock up their publicly funded data (including my own country, Norway) should definitely look to New Zealand. So where can you get free data about New Zealand? As I’ve just been in the country for two weeks, I’m not the best person to answer this question. But I’ve done some research and the natives where happy to tell me when I asked this question on my blog a few weeks ago. Koordinates This great Auckland-based company has created a portal which allows you to search, sort, bookmark and share geographic data sets. Download in the the format, projection and area you need, connect with web services using industry standard services or developer friendly APIs, or explore data within the browser. It’s a success story in how geodata should be distributed. ...