The pyKML – a Python library for manipulating KML

pyKML is an open source Python library for generating, parsing, and modifying KML, the geo-spatial data language used by Google Earth, Google Maps and a number of other GIS platforms.

I was motivated to create pyKML because I frequently need to visualize large, and often complex, environmental datasets. While the KML language has a wide range of options for styling, annotating and interacting with geo-spatial and temporal data, most programs that generate KML don’t take full advantage of these rich features. I created the pyKML library to address this problem by providing easy, programmatic access to all KML elements.

pyKML facilitates working with large and complex KML documents by leveraging the use of basic programming constructs (looping, branching, etc.). In this regard pyKML is similar to libkml, Google’s open source C++ library, but takes advantage of the highly readable syntax of the Python programming language and the processing capabilities of the popular lxml Python library.

As a simple example, check out this Python script that loops through a text string (“Hello World!”) and uses pyKML to create a series of KML Placemarks. You can download the resulting KML document, and below is a screenshot of how it looks in Google Earth.

This is just a teaser of what pyKML can do. For more complex examples, check out the pyKML documentation and the project’s Google Code site that includes sample code for: generating KML from CSV data, creating KML Tours, and visualizing ephermeris data for Stonehenge (e.g., orientation of the sun on different dates). pyKML can even be used to create “slides” for presentations!

To get started, browse the project’s documentation, install the library, try it out, and let us know what you think!

via:  Tyler Erickson, Senior Research Scientist / Engineer, MTRI

A Google Map Maker Roundup

Google announced today that Map Maker is now available for the United States; the tool that allows users to add contributions to Google Maps had, I thought, been targeted at countries where Google lacked map data, but it appears that user contributions are welcome in countries with existing data — once they’ve been reviewed.

So it looks like a Map Maker vs. OpenStreetMap conflict is shaping up. Last week, Mikel Maron accused Map Maker of copying OpenStreetMap’s model and exploiting freely made contributions in a way that benefits Google, in that the resulting data is not freely available; moreover, he says,

Corporations should not be the stewards of a public resource, and a potentially controversial public resource. Compare Gaza in OpenStreetMap and Gaza in Google for just one example of why this is a bad idea. We’re approaching a situation where a corporation is becoming the decision maker on international borders. Wait, did you think the UN or other international forum was supposed to have some role in these kind of things? Nope, Google is getting UN data too.