Thursday, 3 December 2009

Introducing Atlas of Norway (

Great news! On December 1st, the Norwegian Mapping Authority (NMA) launched a series of map services. The best and most detailed maps of Norway are now freely available. You can browse the maps in my new web application: (Atlas of Norway). The following map layers are fetched from NMA:
  • Sjøkart = Nautical chart
  • Topografisk = Topographic map (very nice!)
  • Fylker og kommuner = Administrative boundaries
  • Sjødybder = Sea depths
  • Sjøgrenser = Maritime boundaries
Below are a few examples depicting Foldøy island - 1 square km of beauty in southwest Norway.

Google Satellite, highest resolution available.

Google Streets, highest level of detail available.

Nautical chart from NMA.

Topographic map from NMA.

Topographic map and sea depths from NMA.

Large scale topographic map from NMA.

Grazing land on Foldøy.

NMA maps can be accessed as a Web Map Service (WMS) or as cached map tiles for fast retrieval. Both Google Maps and Bing Maps tiling schemes are supported, as well as WMS-C. Limits are 300 requests per end-user per day for the WMS and 10000 request per day for the cached version (Terms of Use).

According to this blog post, the NMA map services are based on open source software: MapServer, PostGIS and GeoWebCache. is based on OpenLayers, ExtJS and GeoExt, - great tools to build web mapping applications.

Tuesday, 20 October 2009

Using KML for Thematic Mapping - Research Paper Now Available

My research paper, Using KML for Thematic Mapping, is now available for download (PDF, 2.3 MB). This is the first part of my MSc GIS thesis from University of Edinburgh. The second part of my thesis, describing the Thematic Mapping Engine, is already available on this page. The thesis was awarded with distinction and an invitation to Googleplex.

This is a short summary:

Why use KML for thematic mapping?

The purpose of this paper is to examine how KML, Keyhole Markup Language, can be used for thematic mapping. A thematic map displays the spatial pattern of a social or physical phenomenon, such as population density, life expectancy or climate change. Thematic mapping has a long history in cartography, but the new geobrowsers tend to have a stronger focus on detailed satellite imagery and general-reference maps than on more abstract data sources.
"From the perspective of the social sciences, the focus on content that is visible from above is problematic, given the abundance of more abstract data sources. A new generation of techniques is needed that can mash such data with the Google Earth base, creating more powerful ways of communicating what social scientists know about the surface of the Earth."

Due to their huge public interest and relative accessibility, geobrowsers are potentially capable of bringing thematic maps or visualizations to a wider audience. By allowing the user to visualise statistical data in an external geobrowser instead of a built-in mapping application, data from various sources can be more readily combined. The value of the statistical data can be increased if the user is allowed to tie it to other data sources. This can be both quantitative and qualitative data, like text, pictures and videos. Furthermore, geobrowsers can also be embedded in other web applications to enhance their utility and general ability to contextualise information.

Why not?

Using geobrowsers for thematic mapping can, however, be problematic. For 2-D geobrowsers, the big players in the web mapping world (Google Maps and Microsoft Live Search Maps) use the Mercator projection. Mercator is a good choice for zoomable satellite imagery, but less suitable for thematic world maps due to the great area distortions. Current 2-D viewers also have problems rendering large vector-based maps, due to web browser limitations.

3-D virtual globes, like Google Earth and Microsoft Virtual Earth, partly avoid the distortions of map projections. Since images still have to be projected onto a flat screen, virtual globes use the Perspective Orthographic projection, which is also the projection inherent in the human visual system (Goodchild, 2008). Unfortunately, the ability to see the whole Earth at once is lost when thematic maps are rendered on a globe. It is also difficult to estimate the area or the volume of proportional symbols when seen in perspective.


Current possibilities for making proportional symbol maps, chart maps, choropleth maps, prism maps and animated maps with KML are presented in the paper. These techniques are described in detail in the supporting document (PDF, 7.4 MB). The paper also compares KML with other stadards of interest; Geography Markup Language (GML), Styled Layer Descriptor (SLD), Symbol Encoding (SE) and Scalable Vector Graphics (SVG).


It is possible, with some inventiveness, to use KML for thematic mapping. There are, at least, three different ways of making proportional symbol maps: by scaling image icons, by calculating the longitude/latitude vertices of regular polygons, or by scaling 3-D Collada objects. Furthermore, an external web service, like Google’s Chart API, can be utilised to create chart maps. Choropleth maps can be generated by using shaded polygons, and turned into prism maps by adding an altitude value to each coordinate tuple. The KML time primitives can be used to create temporal or animated maps. There is also an option to distribute thematic maps as (raster) map tiles, instead of via a vector format.

However, the current KML standard is not optimised for thematic mapping, as it was not explicitly designed for this purpose. Many of the techniques presented in this paper can be characterised as “hacks”, because KML elements are used in ways for which they were probably never originally intended. There are consequently issues that need to be resolved in future KML versions, like the “polygons-hole problem” that occurs when prism maps are rendered on a 3-D globe. There is also a lot of redundancy in the data, as height (altitude) values have to be repeated for each vertex in a polygon, and entire feature structures need to be repeated for every time step in an animation. Proportional symbols would be easier to create if KML supported regular polygons natively. Collada objects would be more suitable for thematic mapping if they were made clickable.

KML needs to be harmonised with other OGC standards to achieve greater interoperability and more extensive use. Particularly important for thematic mapping are styling rules for transforming feature and attribute data into various 2-D and 3-D representations. Such styling rules are already present in the OGC Symbology Encoding specification. KML also needs enhanced graphics functionality and symbolisation constructs. Instead of reinventing the wheel, this functionality could be modelled after the Scalable Vector Graphics (SVG) specification. The KML standard, combined with powerful and accessible geobrowsers, like Google Earth, has a great potential for thematic mapping. Hopefully, this potential will also be realised by the OGC and geobrowser vendors, and lead to future improvements and native support for thematic mapping functionality in the open standards promulgated by OGC and the vendors.


I would like to acknowledge and extend my gratitude to the following people who have made the completion of this dissertation possible:

Bruce Gittings and James Reid, for their supervision, advice and constructive criticism.

To those whom I haven’t met, but who have given me valuable feedback and advice on my thematic mapping blog.

And to all the people who believe in open data, open access and open source solutions. This dissertation will be my contribution.

You're welcome to post your feedback in the comments!

Thursday, 8 October 2009

Projecting KML with OpenLayers and Proj4js

Back in May I was waiting for a geobrowser capable of showing KML in different projections. Inspired by a great blog series by Richard Marsden (1, 2, 3, 4, 5, 6 & 7!), I've done some experiments with OpenLayers and Proj4js.

Proj4js is a JavaScript library that provides methods for coordinates transformation between map projections and longitude/latitude. OpenLayers integrates with Proj4js, and by combining these libraries your able to project KML in pure JavaScript. No server side dependencies!

This example shows a KML document from the Thematic Mapping Engine in three different projections (Mollweide, Sinusoidal and Equal Area Cylindrical). The KML document contains borders, but these are not extracted and displayed by OpenLayers.

OpenLayers and Proj4js rocks! :-)

Tuesday, 29 September 2009

Generating KML from CMS - and how to make mashups without a key

After a great thematic mapping timeout this summer, it feels good to start blogging again. In my first autumn post, I want to write about the benefits of using a Content Management System (CMS) to create KML documents. I will also show how you can create Google Maps and Google Earth mashups without a map key.

My office is currently running a UN relay race across Norway. 19 schools are participating, one school from each county. It's possible to follow the race on our webpage - on a 2-D map and as a 3-D tour. I wanted make a dynamic solution which could be reused and automatically updated as the race went on.

I ended up playing with our content mangement system. A well designed CMS should enable you to output content in various formats, not only HTML. We're using eZ Publish, maybe the best open source CMS in the world. eZ Publish enables you to create your own content classes and objects. Combined with the built-in template system, I was able to output my new content objects as KML instead of HTML.

One KML is generated for the lightweight 2-D map. You can embed this map on any webpage using an iframe containing a link to google maps and the KML. No Google Maps API key is needed, and the map is updated whenever the KML is updated by the CMS.

Show larger map

The other KML makes use of the new touring capabilities of Google Earth 5. By using KML scripting instead of JavaScript you can easily embed your tour on any webpage. This tour will show you all the schools participating in the relay race.

Every school are asked to make a letter which will eventually become a sentence.

My last tip-of-the-day:
When creating KML on the fly, you can benefit from some hidden features of the Google Chart API. The numbered map pins above are created with this API (it's a problem that Google Maps always renders KML icons as 32 x 32 pixels). KML only support images as screen overlays, but I was able to add dynamic text by using this feature of the Google Chart API (see top left corner of the tour).

Friday, 29 May 2009

Thematic Mapping Timeout

The summer and everlasting days are here. I need to prioritize my free time in the upcoming months. All the work reflected on this site has been unpaid - and it won't be continued unless I'm able to earn a salary... 

I wish my readers a great summer (or winter if you're down under)!  

Wednesday, 27 May 2009

KML projections

I'm waiting for a geobrowser capable of showing KML maps in different projections. The projections commonly used by geobrowsers are not the best choice for thematic world maps. Many cartographers dislike thematic maps rendered on virtual globes, and the Mercator projection is not suited for large area maps. Greenland looks like the same size of South America, while it is actually 8 times smaller.

The coordinate system of KML is geographic (latitude/longitude) coordinates on the World Geodetic System of 1984 (WGS84) datum. Geobrowsers use different projection techniques to render a KML document. Google Earth uses a General Perspective projection, which is similar to the Orthographic projection (see Larry Moores informed speculation of the Google Earth projection). Google Maps and Microsoft's Live Maps both use Mercator projection, which is a good choice for a map that can be panned and zoomed seamlessly

My favorite projection for world maps is Winkel Triple, which is the standard projection for maps made by National Geographic. How can I display my KML based thematic maps in a Winkel Triple projection?

Axis maps recently announced indieprojector. This is a web service (based on Adobe Flash) that allows you to (re)project KML files and export the result as SVG. I tried the service with one of my choropleth maps from the Thematic Mapping Engine

The above image shows my KML file in Google Maps using the Mercator projection. 

Indieprojector nicely and quickly projects my KML file, but the service is not preserving colour styles.  When will we see a Flash based KML viewer capable of showing KML documents (with styles!) in various projections?  

And what about raster data - is Flash capable of converting image tiles into a seemless Winkel Triple projection?

Wednesday, 20 May 2009

Introducing Thematic Mapping API

The brand new Thematic Mapping API enables you to create KML based thematic maps from your own data source. This JavaScript library is the missing link between Google Visualization API and Google Earth API (or other geobrowser APIs supporting the KML standard).

A few examples:
The API is still in beta. Please email me if you would like to try the new API: bjorn[at]

Thematic Mapping API will be free to use on non-commercial sites.

Friday, 17 April 2009

Virtual Globes are a good idea for thematic mapping

It's important to seriously discuss and measure the quality of different thematic mapping techniques. I appreciate the critique from Dr. Mark Harrower on the Axis Maps Blog. I encourage everyone to read Mark's blog post - it's an interesting and timely read. This is a quick response to this critique - more blog posts will follow.

In short, I agree with most of the arguments put forward, but I disagree with the conclusions:
  1. I agree that my 3-D graduated symbol maps are "pure chart junk", but there are some good examples of 3-D symbol maps. (See previous blog post)

  2. I disagree that 3-D prism maps are chart junk - but thematic world maps on a 3-D globe are problematic. (See previous blog posts: [1], [2], [3]).

  3. I very much disagree that Virtual Globes are a bad idea for thematic mapping, but it's certainly not the only or the ultimate way of showing thematic maps.
I hope more people will engage in this important debate. What is your opinion about 3-D visualisations?

Update 28 April: This issue is currently debated on Axis Maps Blog, Google Earth Design and PTS Blog.  

Monday, 9 March 2009

KML in Research Award to

Today, Google announced that one of my KML visualisations won a prize in the KML in Research contest. The animated prism map shows Global Infant Mortality from 1960 to 2005. The statistical data was downloaded from UNdata, a great resource for global statistics. 

The statistics can be explored in time and space. Click here to download the KMZ file.
My dissertation, Using KML for Thematic Mapping, was also awarded the MSc Dissertation Prize at University of Edinburgh. The second part of my dissertation gives a detailed description of the Thematic Mapping Engine, and can be downloaded from

Friday, 20 February 2009

My Google Tech Talk

My Google Tech Talk "Using KML for Thematic Mapping" is now on YouTube:

Poor video quality, but the slides are also available on Slideshare:

You can try the Thematic Mapping Engine online, and download the source code and documentation. Some funding is required to make a general purpose library for KML based thematic maps. Any ideas?