Wednesday 13 August 2008

Using KML for Thematic Mapping

The work is done! Today I could finally hand in my MSc GIS thesis: "Using KML for Thematic Mapping".

From the abstract:
The use of geobrowsers has increased considerably over the last few years. Thematic mapping has a long history in cartography, but the new geobrowsers (like Google Maps and Earth) tend not to focus on this aspect of geographical information representation. This paper examines how Keyhole Markup Language (KML) can be used for thematic mapping. KML is not targeted towards thematic mapping, but it is possible to use KML elements in ways that were probably not intended. Current possibilities for making proportional symbol maps, chart maps, choropleth maps and animated maps with KML will be presented. These experiments show that KML and geobrowsers offer great potential for thematic mapping, but that there are significant issues that need to be resolved.
Thanks to everyone who has given me valuable feedback and advice during these months!

Stay tuned!

Monday 4 August 2008

Why the direction of polygon coordinates matters in KML

If you use the World borders shapefile provided on the site to create a KML prism maps, you will experience a problem. The same problem is likely to occur if you extract polygon features from other shapefiles. The prism map will look like this in Google Earth:

The prisms are not colourised properly. The reason turned out to be the clockwise orientation of the polygon vertices (winding order). 3-D implementations of KML use the vertex winding order for determining the direction in which it faces. This is necessary to display the correct lighting on curved surfaces. For the prisms to be displayed properly the vertex order has to be anti-clockwise.

The prisms will be colourised properly by simply changing the direction of the coordinates.

The light has been switched back on.

The vertex order was changed by this PHP function:
function kmlReverseCoordinates($coordinates) {
  $coordinates = explode(" ", $coordinates);
  $coordinates = array_reverse($coordinates);
  $coordinates = implode(" ", $coordinates);
  return $coordinates;