kml

Google Earth integration for Drupal 6

Druplicon meets Google EarthThe KML module for Drupal allows you to view location-enabled data from your site inside of Google Earth, and it's now available for Drupal 6 - the latest release of the Drupal content management platform.

Having realised last week that the Location module for Drupal was already working pretty well on Drupal 6 I set about to update the KML module to start working with it.

It had been a while since I'd done much with the module, and have thankfully had some help from another community member - Robin Rainton, or raintonr - who was keen to add some new features, so it was great to get stuck back into it and try out some of the new things that Robin had added since I last touched the module. Perhaps the biggest new features are the caching of KML feeds so whenever you're accessing them in Google Earth you put less of a strain on your Drupal site (especially if you are using Network Links to regularly update the feed), and the ability to choose the style of the markers instead of using the default pins that we used to have.

So, if you want to use the KML module on your Drupal 6 site, you can now do that. You'll need to download the latest version of Location module and also the latest version of KML module. There will likely still be issues with this early version, so please let me know if you come across any by posting them in the issue queue on drupal.org.

Note: The icon depicted above is a combination of elements from the Druplicon (licensed under the GPL) and the Google Earth icon (used without permission). Hopefully it's not breaching Google's trademark or copyrights or anything...

Views support in Drupal's KML module

To set up a KML feed in Drupal all you need to do, after downloading the latest Drupal 5 version of KML module, is create a new view, enable the 'page' display for that view and choose 'KML feed' as the format to display. You can then filter it by anything you wish, sort it in different ways and feed it arguments to filter it down even further on the fly (untested, but should work).

If you want to use that feed as a self-refreshing network link, point the user at http://www.example.com/kml/view/<viewname>/networklink

I haven't had a chance yet to test it all thoroughly but it appears to work just fine. Any feedback and testing appreciated though, as always.

Finding Drupal sites from Google Earth

I love finding new sites that use the Drupal KML module, and seeing what they're doing with it. The great thing about it is that it can be used for absolutely anything that has associated location information, so every site out there can be a site about something completely different to the previous one.

The site I discovered today is an Ontario real estate website, listing houses for sale and their locations, but also events and other such things. Not only are they able to add a 'kml' link to each relevant page, allowing the user to click through to Google Earth and see the location, but they are also able to have people find their properties through Google Earth itself.

For a while Google has been indexing KML feeds (ones from Drupal included) and allows their content to be searched in Google Earth. To take an example, there is a $300k townhome in Newmarket, Ontario for which the realtor has added location information to the node in Drupal. Try doing a search for 'townhome in Newmarket' whilst in Google Earth, and you'll see that property show up as the first in the list of web search results.

The KML module can help bring your information to a completely new set of users, or potential customers in the case of the Jasmina Homes site.

How do I know about what sites are using the module? Well, I've started keeping track of of them through the Google Alerts service, monitoring any site that has links with kml/node in them.

Geo brings people to Drupal

I recently discovered the iCommunity.tv localised video news site (via High Earth Orbit) and was especially interested as it was being run on Drupal.

This was one of the first places out on the internet that I'd seen Drupal's KML module being put to good use, for example to be able to view in Google Earth all of the citizen journalist videos from YouTube that are tagged as being from the city you're interested in (e.g. Stuttgart video news and its associated KML feed of Stuttgart video news). Grass roots journalism is only useful to readers if the content is filtered to your needs, if it's in the area you want to know about and it's the type of news that you're looking for. The iCommunity.tv site does that by tagging videos by location (both coordinates and the name of the nearest city) and by topic (politics, community life, arts, etc.) and lets you filter by a combination of those*.

I heard back from Chris Haller of iCommunity.tv after posting a comment on his announcement of the site. He told me that he was previously a Mambo/Joomla user, attracted to Drupal both by its flexibility and by its geo-capabilities. It's great to see that happening, and someone told me exactly the same thing yesterday too. It's also great that organisations like the Open Source Geospatial Foundation are using Drupal as their platform of choice.

Its good to see Drupal becoming more and more of a GeoCMS and people taking the tools and finding ways to apply them in useful and practical ways.

* KML feeds for multiple tags do not currently work in the KML module, as I've just discovered

KML and GeoRSS now ready for Drupal 5.0

Over the past few days I've been readying the KML module (thanks to AjK for starting the work) and the GeoRSS module for new releases that will work on the latest, shiny, version of the Drupal content management platform: Drupal 5.0.

They are both now ready (with the exception of some minor bugs and some feature requests) and there are a number of bits I need to backport to the 4.7 version of KML module to ensure it starts working again with recent updates to the Location module. I also need to make sure that GeoRSS module is consuming feeds properly from the successor to Aggregator2, Leech, as well as Feedparser.

I've also been helping out a little with the port of Location module as it is an essential part of getting the two modules to produce their geodata. It's not quite ready to be tagged as being ready for Drupal 5.0 but most of it is already working in this release.

If you're interested in any of these modules, please try them out and report any bugs in their issue trackers. If you have any ideas for future features, please also add them in there. Ideas (and patches, if possible) are always welcomed!

GeoRSS to KML through Drupal

I was working at the end of last week on pulling GeoRSS-enabled feeds into Drupal and attaching the location information for each item to the nodes created from each item. Once it's within the flexible world of Drupal, all the benefits of having attached geodata then apply.

With the number of GeoRSS enabled feeds around the world slowly growing, the opportunity to make your own geospatial mashup machine (borrowing the name slightly from Zacker's Drupal Mashup Machine screencast) is now here.

Much of the functionality was already there in contributed modules - aggregator2 module to pull in feeds (not sure what's going to happen to this module in the future) and location module to store location data for nodes. Then my recently released KML module can feed all of this information back out in different ways (eg by tags assigned to the incoming feeds), GMap module can display them on top of Google Maps.

The only part that was missing was the bit to pull geodata from the incoming RSS feeds, based on the GeoRSS standards, of which Version 1 was released last week. To do this I created a little module (GeoRSS module) that tied aggregator2 module and the location API together.

The functionality here overlaps slightly with the location module in that it already inserted geographic information into RSS feeds being sent out by Drupal, but I prefer to use the module as an API to store the information and then extend it in other ways. In the future the GeoRSS module could be extended to deal with more complex geodata than simple points, being able to cope with lines and areas as well if that time comes along and people have that need.

Geo-enabling your Drupal site

Unpublished

Did you see Zacker's mashup machine screencast a few months back, showing how simple it is to add geographic information into a Drupal site and then display it to the users on top of a Google Map?

If you set up a site like that, then the likelihood is you have a lot of geographic information within the site. There's no point keeping it locked up within the site when you can set it free and allow people to explore it in Google Earth alongside any other dataset they want to use.

Don't worry if you haven't already got a Drupal site with geotagged nodes in it, it's easy enough to put one together. I'll talk you through the steps below. I'm going to assume a little familiarity with Drupal, but once you've managed to get over the hurdle of installing Drupal, the rest is relatively easy.

  1. Download and install Drupal 4.7.3 on your web server if you don't already have it installed (check the manuals if you need)
  2. Download location.module, gmap.module and kml.module into your site's modules directory.

Drupal KML module released

Tonight saw the release of the KML module I've been working on for the Drupal content management system. The main features of the module currently include the ability to:

  • add a KML link to the bottom of all spatially enabled nodes
  • view all spatially enabled nodes in Google Earth
  • view nodes tagged with a certain term
  • view nodes from within a group
  • view search results
  • determine order of nodes that are displayed in Google Earth, allowing for alphabetical or time-based flythroughs of nodes for example.

If you are interested in this module, please feel free to try it out. You can see parts of the module in action over at geodan.org/kml-module.

It's been developed on Drupal 4.7 and the source is available in the CVS repository or as a package. If you come across bugs or things that aren't working as expected, please add them (along with any suggestions or feature requests) to the issue tracker on drupal.org.

It took me a while to get to grips with using CVS and specifically MacCVSClient (to add to SVN which I also recently got to grips with) but finally I managed to import the module source to the Drupal CVS repository. I think I still need to tag it to make sure it's packaged properly from the module description page and therefor easier to download, but that can wait until the morning.

Drupal geospatial testbed

It's been long enough that I've been working with Drupal and not had a site of my own that runs off it. I'd love to migrate dankarran.com to Drupal but it would take some time to migrate. So for now I will leave this site as it is and create a new site aimed at demonstrating Drupal as a Geospatial Content Management System.

geodan.org will be a testbed for geospatial functionality within Drupal. I'll be using existing modules such as the location module which gives a basis for handling geographic information about users and nodes in a site, gmap module which allows for Google Maps to be easily created, as well as a number of others. In addition to these I'll be adding the KML module I've been working on as part of my day job, and also the WFS Server module which still has a little way to go before it's ready.

Right now it's just a shell, but over time it will grow. And as it seems somebody over at the OGC recently picked up on my last post about Drupal as a WFS I should try and make that sooner rather than later...

Geo goodies announced by Google

A number of Where 2.0 attendees were invited to the Googleplex yesterday for a Geo Developer Day and to celebrate the 1 year anniversary of Google Maps. There were a number of new features announced, including

  • a new version of Google Earth
    (which I've only had a chance to try on my PC at work so far, and it has crashed every time I try to zoom into something)
  • the ability to pull display KML feeds in Google Maps
    (The feeds didn't refresh based on the area of map you're viewing though, as they would in Google Earth. Also, I wonder if they'll support GeoRSS anytime soon? The ability to pull geocoded RSS feeds into Google Maps would be great)
  • geocoding support for the US, Canada and a number of other places - including Germany
    (but not including the UK, presumably because of the tight rein the Royal Mail have over postcode data)

It's been a year since Google Maps was introduced and look at what's been done with them. I'm really looking forward to what's in store at the Where 2.0 conference this year - if only from the other side of the Atlantic.

Pages

Subscribe to RSS - kml