Banner

Saturday, 11 August 2012

Mapping through New Zealand

This autumn I’ll switch hemisphere to experience the spring in New Zealand. I’ll spend two months down under to learn more about cartography and mapping, and to go tramping. Where should I go and what should I see? I need your advice!

My journey starts in Auckland and the GeoCart'2012 conference, before I’m heading up to Tongariro National Park and the 8th Mountain Cartography Workshop. Hopefully, Mount Tongario will stay awake. I’ve never been this close to an active volcano before! Then I’m free to go wherever I want. I roughly plan to stay one month on each island.

What I would like to know:
  1. Are there other mapping events going on in New Zealand in September and October? Anything from conferences, small meetups to short-time courses.
  2. Are there museums or institutions worth visiting  for a map geek? I’ve seen that Te Papa in Wellington has an impressive light up satellite photo of New Zealand.
  3. Where can I find geospatial datasets in the public domain? I would like to make my own map of New Zealand while travelling. I know about LINZ and NLRC.
  4. Do you know of an empty office desk or a remote bach (with WIFI!) that I could lend for a week or two. I need to do some work on my Thematic Mapping API.
  5. What will be the best tramps to do on the North Island in September and the South Island in October? I’m a dedicated cross-country skier, but I won’t bring my skis all the way from Norway - so keep it mainly below the snow line. 
  6. Other interesting sites and activities.
Please send me a message by adding a comment below, on Twitter, or by sending me an email: bjorn[AT]thematicmapping.org

And, of course - here is a "Where should I go-map"!



Thanks,
Bjørn  

Wednesday, 8 August 2012

Showing GPS tracks with Leaflet

Last week I had a great 5 day trek through Jotunheimen in Norway, the same area featured on this blog in a number of posts  (12345, 6, 7) . The trek included the Norway’s highest mountain, Galdhøpiggen (2,469 m), and the deepest valley, Utladalen.

A foggy day on Galdhøpiggen (2,469 m).

Visdalen close to Spiterstulen (1,100 m).

The view from Kyrkja (2,032 m)

Storutla river

Avdalen farm in Utladalen.






I used my Garmin GPSmap 60CSx to track the route, which allows me to save the tracklogs on the memory card. After the trek I had 5 GPX files, one for each day. I used GPSBabel to merge the files into one GPX, jotunheimen_track.gpx.

Leaflet don't have native support for rendering GPX files (there is a plugin though), so I decided to convert the GPX track to GeoJSON. This can easily be done with ogr2ogr program (part of the great GDAL library):

ogr2ogr -f GeoJSON jotunheimen_track.json jotunheimen_track.gpx tracks

I'm only using the tracks from the GPX files, not waypoints and routes. The command generates a file, jotunheimen_track.json, where the complete track is represented as GeoJSON. Leaflet has very good support for GeoJSON. Just assign it to a JavaScript variable and add the following lines of code (using Leaflet 0.4):

L.geoJson(mytrack, {
  style: {
    color: '#ff0000',
    weight: 1,
    opacity: 1
  }
}).addTo(map);

You can style the track as you like. The resulting map looks like this:



Fullscreen map