I downloaded a KML track from Google Latitude. The service allows to download the tracked route from the user's profile providing a link such as:
https://maps.google.com/locationhistory/b/0/kml?startTime=1318716000000&endTime=1318802400000
ogr2ogr
I would like to convert the .kml file into a Shapefile. I am running Ubuntu. I am a bit familiar with QGIS and ogr2ogr. Therefore, I tried the following command as usual:
$ ogr2ogr -f "ESRI Shapefile" example.shp example.kml
ERROR 4: No layers in KML file: example.kml.
FAILURE:
Unable to open datasource `example.kml' with the following drivers.
[...]
Quantum GIS
QGIS states "invalid data source" when I open the .kml file as a vector layer.
Kml2Shp Online
I also tried Kml2Shp Online without success. It is not able to read any information either:
Entities found:
# Points: 0
# Paths: 0
# Inner Polygons: 0
# Outer Polygons: 0
Google Earth / GPSBabel
Furthermore, I found out that Google Earth is not capable of exporting GPX. Google refers to GPSBabel which converts KML to GPX using the following command:
$ gpsbabel -i kml -f ~/Desktop/example.kml -o gpx -F ~/Desktop/example.gpx
However, in my case it outputs a GPX file without location data.
GPS Visualizer
As a first success I found the website GPS Visualizer. Uploading and converting the file their actually produces a valid GPX file.
Still my question remains to be open:
Is there a command line tool that is capable of converting the file? I do not want to upload the tracking data to yet another website for the conversion.