Skip to main content

Posts

Merging polygons in QGIS

I'm going to play with the mapping capabilitites of D3.js in my new blog series from Foldøy island. I would like to use data from my own country, Norway. This dataset needs some improvements, and this blog post will show you how to do merge polygons in QGIS . As announced in an earlier blog post, Norway will open it's topographic datasets to the public . This week we got some details about the launch: The data will be released on October 1st this year, The licence will be CC BY 3.0 . Vector- and rasterdata at various scales up to 1:50,000 will be available.  This includes administrative borders for counties and municipalities  and driveable roads longer that 50 meters.  Digital elevation data at 10x10 meter resolution, which is great news! Before October 1st, I'm stuck with a dataset at 1:2,000,000 scale, but it will be suitable for country-wide mapping with D3.js. You can download the shapefiles from the Norwegian Mapping Authority on this page ....

Creating a synchronized view of two maps or images with Leaflet

In my last blog post , we created a Leaflet plugin capable of showing zoomable high-resolution images with Leaflet. Now, I need to compare two images side-by-side, and I've decided to create a generic plugin which can be used for maps as well. The Leaflet.Sync plugin is just a few lines of code , but it took some time to figure out the inner workings of Leaflet. Here is a synchronized view of two maps of Foldøy island where I'm currently staying: Fullscreen This is the JavaScript code needed to create this map: var layer1 = L.tileLayer('http://opencache.statkart.no/gatekeeper/gk/...');  var layer2 = L.tileLayer('http://opencache.statkart.no/gatekeeper/gk/...', {     attribution: '© Kartverket' }); var map1 = L.map('map1', {     layers: [layer1],     center: [59.336, 5.967],     zoom: 14             }); var map2 = L.map('map2', {     layers: [layer2],     center: [...

Showing Zoomify images with Leaflet

Today, I'm starting a new blog series written from Foldøy, a tiny island in south west Norway which will be my home for two months. In this first post, I'll show you how to deliver zoomable high-resolution images with Leaflet . I've brought along 17 kg of mapping and visualization books to keep me occupied: Fullscreen Zoom in if you want to see the details! The photo is broken into tiles and then displayed as required. You don't really need Leaflet to create images like this, as Zoomify provides both Flash and HTML5 viewers. I decided to use Leaflet to create an open source alternative, and to learn more about tiling schemes. This is the JavaScript code needed to show this image: var map = L.map('photo').setView(new L.LatLng(0,0), 0); L.tileLayer.zoomify('http://thematicmapping.org/playground/zoomify/books/', {     width: 5472,     height: 3648,     tolerance: 0.8,     attribution: 'Photo: Bjørn Sandvik' }).addTo(map); ...

Norway will open its topographic datasets to the public!

Today, 30th April 2013, is a milestone of the mapping history of Norway. Together with two governmental ministers, the Norwegian Mapping Authority  announced they will open its topographic datasets to the public, free of charge. Norway will follow progressive countries like Denmark, Finland and New Zealand , considering geographic data as a public good. The topographic datasets at 1:50,000 scale will be freely available later this year, together with address, road and cadastre data. A database of 950,000 place names was released to the public one month ago. Hopefully, digital elevation data will be free as well, but it's not yet stated. Cheers!

Cross-country skiing in Norway

It's been a great winter in Norway. Pleny of snow, lots of sunshine and good skiing conditions, except from my last trip where we caught in a storm and luckily found our way back to the hut. Outdoors was what got me into mapping in the first place. A hike is much more enjoyable with a good trekking map, and on my last trip I really experienced how crucial a GPS can be. As I spent my free time skiing there's been no time for blogging, so I decied to post a few photos instead. Cross-country skiing in Norway is highly recommended! Mt. Gaustatoppen , where you can see one sixth of Norways mainland from the top. A view of Rondane ,  the oldest national park in Norway.  Mountain pasture used for the grazing of sheep and cattle in the western part of Norway.  By the Hardangerfjord , the third largest fjord in the world. Skiing in Dovre National Park . PS! I'll start a new blog series on mapping with D3.js in June. Stay tuned!

How to minify GeoJSON files?

You can't do web mapping these days without knowing your GeoJSON . It's the vector format of choice among popular mapping libraries like Leaflet , D3.js and Polymaps . Size matters on the web, especially if you want to distribute complex geometries, like the world's countries. The challenge is even bigger if you want to target mobile users - or support web browsers with poor vector handling (IE < 9). This blog post will show you how to minify your GeoJSON files before sending them over the wire. The first thing you should do is to generalize your vectors so they don't contain more detail than you need. In a previous blog post , I was able to remove 90% of the coordinates without loosing to much detail for map scale I wanted to use. This will of course have a great effect on the file size. Today, I'm going to use country borders from the Natural Earth dataset . These datasets are already generalized for different scales (1:10m, 1:50m, and 1:110 million), so ...

Mapping New Zealand - a summary

I've had a fantastic two months study trip to New Zealand. Unfortunately, I had to go back to Norway this week to fill up my bank account - just when the summer was arriving in New Zealand. I'm going to miss the beautiful country with its great people.   New Zealand is the perfect country to map, as an isolated country surrounded by a vast ocean, and because of all the free data available. I hope my Mapping New Zealand blog series has been useful for others as well: Getting free data in New Zealand Creating a Seafloor Map of New Zealand Creating a seafloor map using shaded relief Creating a custom map tiling scheme for New Zealand’s seafloor Dealing with the antimeridian in TileMill Editing and merging shapefiles with QGIS Creating a shaded relief map of New Zealand Doing magic with TileMill Exporting tiles from TileMill Creating a "Where I've Been" map with Leaflet and CartoDB How to control your Leaflet map with URL parameters Where are the ho...