Monthly Archive for December, 2005

Page 2 of 2

Styling KML to GML

The proposed use of Google Earth to mark some places and produce simple datasets emerged as big success and was widely adopted by some of my colleagues. Actually one of them is using Google Earth pretty intensive.

So I extended my begun KML to CSV XSL stylesheet to take over Google Earth KMLs in a more convenient way. With the help of this XSL stylesheet you can transform a KML to a GML file. As input examples I took the three listings at Keyholes KML-tutorial. They cover three geometry types, so the developed XSL stylesheet should support:

  • Placemarks
  • Paths
  • Polygons.

With the help of Marc Liyanages TestXSLT I was able to test my XSL stylesheet against Sablotron, Gnome Libxslt, Saxon and Xalan-J. You’ll need one of those (or any other) XSLT processor to transform your KML to GML.

For processing XSLT on Mac OS X you can just use Marcs application, it’s easy to use and extremely helpful for developing and testing XSLT.
An online implementation of Gnome libxslt you can find here. Just copy & paste my XSL stylesheet and your KML into the corresponding fields and hit process. Copy the result in any text editor and save it as GML. E voilà!
How to transform XML with a simple java application is described in that tutorial and based on .NET here.

As in the former KML to CSV transformation you first have to delete the KML namespace declaration before processing your KML, otherwise it won’t work:

xmlns="http://earth.google.com/kml/2.0"

If you want to get some ESRI shapefiles out of your GML you can further use ogr2ogr for instance:

ogr2ogr -f "ESRI Shapefile" myfile.shp myfile.gml

I only did some very basic testing with Quantum GIS (which opens GML directly) and ArcGIS (via ogr2ogr). Possibly it won’t work with every KML.
Suggestions will be appreciated!


World population

Fascinating: Map of the Earth with countries sized by population (via BB). I saw it already this summer in the maps exhibition at ICC 2005. Power and distribution are the words that came to my mind.

Old school geek

Very old school and very geeky: iTTUSB – a USB turntable! I’m not sure if it’s equipped with a direct drive, but if so $140 would be a pretty good price.

Mac OS X Earth

Google Earth Mac OS X IconOn my morning news check I found an interesting link. Seems to be a Mac OS X beta version of Google Earth. Unfortunately I can’t download and test it right now, but there are already a few screenshots and reviews around.

Update:
At home and able to test Google Earth on Mac OS X: on an iMac G5 2GHz RevB equipped with 1.5 GB RAM and connected via 3072/384 kbps to the internet it works nicely! After observing memory & cpu consumption for a while I would suggest to stuff some extra memory into your Mac before using Google Earth. Well, some extra memory for Mac OS X is always a good advice. IMHO the performance is comparable to the Windows XP machine in my office (a P4 3GHz with 1GB RAM). Anyhow, great to see Google Earth finally on Mac OS X!!

Google Earth on Mac OS X screenshot

Note:
The link above obviously leads to a leaked beta version of Google Earth for Mac OS X hosted by yousendit.com. If you think this download violates your rights please send any further comments directly to abuse@yousendit.com.

Stop Comment Spam and Trackback Spam « Akismet

Bye bye comment and trackback spam! Hello enforced WordPress.com account!

Spring project

I think I already know what I’ll do first when weather is getting better and I can go by bike again: How-to make a bike charger for your iPod!

G-stoned

Two more G-stone regalos you shouldn’t miss: Dub Club – Picked from the Floor
and Urbs – Toujours le même film.

Sit down

Sofa Surfers released The 4th Studio Album: even-tempered rock accompanied by a soulful voice instead of (usual) driving beats. Check out their album player and the free White Noise Kid Loco remix.