georss

Pinpoint your OpenStreetMap diary entries

If you look back at the OpenStreetMap diary entries, the vast majority of them make reference to a place the poster has been mapping, but there was no way of actually specifying the location of that place. Now, if you're writing an entry in your OpenStreetMap diary (as any OSM user can) you can also specify a location for that entry.

When people view the diary entry they can now click through to view or edit that area of the map to see what you're writing about. Each pair of coordinates is wrapped in the geo microformat too, so if your browser knows how to handle them, it should be able to pick them out.

The feed of diary entries also includes the location information (currently only W3C geo, but should soon have actual GeoRSS too), allowing you to visualise them on Google Maps, for example, or any other geo-enabled feed reader.

Categories: Geographic

GeoRSS in the wild

I've been working today to try and get Drupal's GeoRSS module listening to more than just the deprecated Aggregator2 module to extract geographic locations from aggregated feed items.

The Feedparser module is the next on the list to support and as far as I'm aware is the only one of Drupal's aggregation modules to use an external parsing library, SimplePie. By using an external library it means that we don't need to deal with the sometimes complex task of parsing different types of feeds on the Drupal side, which is a bonus because efforts can be concentrated elsewhere whilst keeping the code nice and simple.

SimplePie is still in development stages but appears to have a good community around it as well as a couple of active developers. They're gearing up to their 1.0 release which includes functions to extract geodata from feeds using the W3C Geo and GeoRSS Simple encodings, the former being the most widespread of methods at present and the latter the one we should be moving towards using.

SimplePie's code is very much based around namespaces (e.g., xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"), which a lot of other aggregator systems will often disregard in favour of the simpler method of parsing out just the individual element names from that vocabulary (e.g., geo:lat or geo:long) to identify the tags. Now that namespaces have suddenly become important (at least for SimplePie's code to work), it's interesting to see how easily overlooked they have been in the past.

Take, for example, the Geograph GeoRSS feed of their latest photos: they had a trailing slash after the GeoRSS namespace URI (http://www.georss.org/georss/ instead of http://www.georss.org/georss as it's defined in the spec). It was there because many namespaces do have the trailing slash, and simply left in by mistake, but because that's not what SimplePie was expecting, it didn't pick up the geodata in the feed. It's been fixed now (Thanks for the quick fix Barry!). There is also the case of the Flickr GeoRSS feeds that use the wrong namespace URI (using the one for W3C Geo instead of the GeoRSS one). Hopefully Rev Dan Catt or someone else at Yahoo will be able to fix that one up.

Even besides namespaces, some elements are often misused, and possibly the most widespread of those is geo:lon which should in fact be geo:long according to the spec. SimplePie doesn't understand the non-standard one and so can't pull the location information out of the feed. In this case, because it is so widespread, the parsing code should probably be extended to look for the non-standard element if it can't find the standard one.

Anyway, just some random observations of GeoRSS in the wild and how what seem like the smallest of differences can mean that the embedded location information will simply be missed by feed consumers.

If you've got a GeoRSS feed from your site, please do the right thing and make sure it's sending out the right information :)

Categories: Geographic

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!

Categories: Geographic Drupal Work

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.

Categories: Geographic Drupal Work

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.

Categories: Geographic
Syndicate content