Tag Archive for 'KML'

Standards

Sure, KML is a great (additional) format for map dissemination nowadays, but saying

Our choice to give KML to the OGC is part of our strong commitment to open standards.

pushes the “don’t be evil” credo a little. Look closer and you’ll see something like

We need the geo-industry to focus and produce more searchable geo content.

between the lines.

I’m still surprised that the HTML of geographic content is not listed at W3C, right next to standards like SVG, MathML, SMIL, etc.

Mapping Google Spreadsheets

There are several methods to use free map services for visualizing a list of point-features. I found this wizard for instance at the gmaps samples. It uses a published Google Spreadsheets document and puts the listed features on a map. This method is a clever way because you can use Google Spreadsheets to hold, manage and edit your data and don’t have to go through the map publishing process over and over again when you update your data.

The problem with that wizard is, that you have to know the coordinates already. So it won’t help if there is just a list of addresses without coordinate information. You must geocode (assign coordinates to each address) your items before you can put them on a map with this method. And if the map should be shown somewhere else, you’ll need a Google Maps API key, which is tied to exactly one url-string.

Luckily Yahoo! invented the Pipes: I put a quick Pipe together which allows you to geocode addresses stored in a Google Spreadsheet.

Here is how it works:

  1. Enter a list of addresses in Google Spreadsheet. Here, for instance, is a list of shops in Vienna where you can grab a free copy of biber.
  2. The column “Name” identifies the name of my features and the column “Address” holds the address to geocode. If you want to use another structure, you should clone the pipe and adjust the Regex-module to match your needs.
  3. Publish your Google Spreadsheet as Atom or RSS feed (click the link “More publishing options” in the “Publish” section), e.g. the biber feed
  4. Enter the feed url into the “Google Spreadsheet feed url” field and hit “run pipe”
  5. A Yahoo! Map showing all your (successfully geocoded) addresses should be produced

Alternatively you can take the GeoRSS feed or KML-file from the Pipe and display it in Google Earth or put it on a Google Map (and embed it into a blog post).


bigger map

Yahoo! Pipes are simple, yet powerful, and I think it should be possible to modify the Pipe in order to return a table containing coordinates. There is already a JSON output by default. Regarding the geocoding limit, I’m not sure which number applies for Yahoo! Pipes.

Google Earth EULA changes

Stefan Geens from Ogle Earth points out the possibly most important change in Google Earth’s EULA:

For a business entity user, the Software may be used by you and your employees for internal use…

First of all, this is excellent news for GIS professionals. Ok, but what exactly does “internal use” mean? Our IT staff is now allowed to install Google Earth by default on any business PC and Laptop. I’d assume our employees can then legally use Google Earth for preparing business trips for instance.

But how far does “internal use” go when it comes to enterprise GIS support?

Available tools like Arc2Earth make GIS result presentation in Google Earth very easy and convenient. Instead of setting up map servers, where employees explore GIS results in web browsers, an internal enterprise information strategy could shift to Google Earth as client and KML as data storage (cf. Brian Timoneys smart KML S3 solution). Would that be considered as “internal use” by Google?

Imagine the GIS department of the city of Vienna serving their data as KML to Google Earth clients on 12.000 internal workstations across the city administration. Basically it’s internal use, but I’d assume such an “internal use” would probably upset Google.

Clearly, I’m now allowed to run Google Earth on my business PC, but, as GIS professional, I’m still not sure if I can consider it as possible way to go for “internal” data dissemination strategies.

GPS hiking tours

Naturfreunde TourenportalNaturfreunde published over 900 Austrian hiking, bike, ski, etc. routes as GPS data on their recently launched Tourenportal. In addition to the GPS tracks they provide some more information such as best season to go, an elevation profile, route length, descriptions, etc. about the routes. A KML file lets you nicely preview each tour in Google Earth. The project is a cooperation with Garmin, who is hosting the GPS routes as service too.

The GPS device is no problem, but if I only had the right shoes to do a hike I’d give that service a try. Maybe somebody should come up with a more urban tourportal…

[via kartentisch]

Local traffic information

BaustelleThe Austrian automobile club ÖAMTC now publishes traffic information (road works and traffic jams) about the Austrian road network as KML file. Originally designed for desktop applications like Google Earth, but faster and more convenient viewed online as Google Maps overlay.

Anyways, by its nature I would consider GeoRSS as the format of choice for publishing that type of information: a frequently updated news feed containing geocoded items. If KML is taking over that ground too (after heading towards a de-facto standard for online geodata), what’ll be left for GeoRSS then?

The point is that I don’t really see the need of KML and embedding styling information, etc. in this case. The value lies in the information rather than the representation. A syndicated GeoRSS news feed, for instance, I can receive on my mobile news reader too. Even though my mobile news reader doesn’t provide any features for mapping geocoded items yet, but at least I’m be able to get traffic information on the way, when traffic information is essential. On the other hand, how many potential users are able to view KML on the way?

Andrew Turner provides an excellent further read in this KML & GeoRSS context.

Update
An extra traffic information RSS feed is on the site available too, but with less items and not geocoded. However, the initial question remains: why prefer KML for publishing frequently updated location aware content over GeoRSS?

User-created content in Google Maps

Since a few weeks Google includes user generated content in Google Maps search results. Basically it’s a good idea and useful data because some places or place-names aren’t collected by commercial mapping companies, who provide services like Google Maps with data. Jesuitenwiese at Prater for instance, a nice picnic spot in Vienna, now shows up in Google Maps search results because it got mapped by a random user on some site on the internet.

However, I’m not quite sure of how many people are really aware of that marked spots in their Google “My Maps” are available to a broader public audience through Google’s search functionality.

A search for picnic in Vienna for example links to the wedding route of a Google user (identified by a real name), or a picnic a woman (again, a real name is showing up) went to last Sunday.

To make sure private things remain private, well, at least not shown as Google search result, the flag “unlisted” in Google “My Maps” has to be set. Regarding KML or GeoRSS you can tell Googlebot how to handle the content by editing either robots.txt or sitemap.xml.

ArcGIS 9.2 includes GML and KML support

James Fee reports that ArcGIS 9.2 ArcView will support OGC GML Simple Features and KML by default. This means an important step for interoperability!

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!


A little KML to CSV converter

Today I had to take over some places a collegue marked in Google Earth. Maybe I was too blind or actually too stupid but I was not able find a simple tool for converting KML to an ArcGIS-compatible format. Except FME of course, but that would be the overkill for my purposes. So I wrote a quick and dirty XSLT-hack to convert a KML-file to a very basic CSV-structure, which I could later import as X/Y coordinates to ArcGIS.

I had following structure in Google Earth:

My Places
__Folder
____Placemark 1
____Placemark 2

Saving the folder as kml brought me this file (GE_original.kml).

For some reasons (I’m no XSLT expert) I had to delete the KML namespace declaration and of course add the XSL-stylesheet information. See the modified KML file here (GE_modified.kml).

The XSL-file I wrote you can find here (kml2csv.xsl).

Put your modfied KML file in the same folder as kml2csv.xsl and open it in a XSLT compatible Browser. You should see now coordinates and placemark names in a CSV structure instead of a KML-XML-tree:

Name,X,Y,Z
Placemark 1,13.08349600542125,47.79234503541417,0
Placemark 2,13.27061184961974,47.68484958984244,0

Save it as text file, open it in ArcGIS (or in your prefered GIS client, spatially enabled DBMS, spreadsheet app or wherever you want) and add the X/Y coordinates to your layer. For now the XSLT is limited to placemarks and it only works if your placemarks are contained by exactly one folder – as I said, a quick and dirty hack.

Further improvements to come (as soon as I have some time left):

  • the conversion of KML to GML would be a more elegant way
  • support of lines and polygons

Google Earth is a nifty tool to create some spatial notes and simple geographic objects. It’s easy to use, offers access to basic geodata but it’s definitely not a tool to produce large and complex geodatasets.


Google Earth KML Tutorial

A useful document if you want to create KML files: Google Earth KML Tutorial.