February 07, 2008

A "Google MyMaps RSS editor" (plus a Was Not Quite Working but Now Fixed Google Maps to Google Maps Round Trip Via Yahoo Pipes)

One of the handy things about Google MyMaps is that you can use the map to add markers to particular locations on a map, save the markers to a named MyMap, and obtain a link to "View [the markers] in Google Earth".

The Google Earth link is actually a link to a KML file that in turn points to a second, network linked KML feed that contains the markers you have plotted on the particular MyMap.

If you want to use a Google map to generate an RSS feed (or more specifically, a geoRSS feed, that contains the latitude and longitude of each marker/item in the RSS feed) which can then be displayed in a generic feed reading application (albeit without making using of the geo information), then I don't Google maps can offer you that...

...but a little Yahoo pipes mashup can...

So for example, take the World of Hello World map. We can grab the "View in Google Earth" feed and pop it into a Yahoo Pipe that will firstly extract the Network Link URL that actually points to the KML feed that contains the individual map items:

2008-02-07_0058

Secondly, you should notice that the above pipe itself calls a second, nested custom pipe, KML2geoRSS. This embedded pipe actually converts the KML feed that contains the individual map items to a geoRSS feed:

2008-02-07_0104

The location extractor appears to pull the lat/long info out of the KML feed (and maybe just propagate it for the KML output?) However, for some reason, the Yahoo map display when you run the pipe doesn't appear to plot the markers properly (at least it didn't in my browser; and the same buggy result happens if you try to view the geoRSS feed in a google map:-(

[UPDATE: ok, the lat/long cordinates were being pulled out in the wrong order. I must have tested it one way to get the good map, then changed it and broke it... so it now works fine, but some of the screenshots in this post may be a little misleading; check the actual pipe to see how it's *really* built ;-)]

At one point, I did manage to grab the KML output from the pipe, paste it back in to the Google map search box, hit 'Search' to load in the KML file output from the Yahoo pipe, and display it once again in the Google map:

2008-02-07_0107

(This time, the 'View in Google Earth' link actually points directly to the Yahoo pipes KML output.)

BUT - this seems to have stopped working now:-( and I get the same broken display the Yahoo map pipe output gives event though the feed looks right in the Pipes debugger?

2008-02-07_0137

(The geocoder/location extractor adds the y:location info, the Point is a remnant of the KML feed.)

So this form of round tripping is all pretty pointless, right? {Especially as it appears to keep breaking in the geocoding stakes:-(] We get a KML file containing a netwrok link from a Google MyMap, stick it into a pipe that pulls out the network link URL and converts the KML file it points to to a geoRSS feed, and then use the Yahoo pipes output filter to get a KML file (which should be pretty similar to the KML file that the network link pointed to...) which can then plot back on the Googlr map...

Hmmm...

But, and here's the possibly useful point, the pipe will also give you an RSS feed that you can display in an RSS display widget, such as Grazr:

Along with the Plotting Google Calendar Events on a Google Map hack, which lets you use a calendar as a natural editing enviroment for generating date based feeds (that may additionally contain location information that can be exploited to give you a map view of the calendar feed), this current map2rss hack lets you use a map as an editor for creating location enhanced RSS feeds (that appear to be broken in wrt the geo bit:-( that can also be displayed in any old feed reader...

...which may be useful?

PS if you can spot why the geo bit seems to break in the pipe, please let me know :-) [The problem was lat and long getting switched by mistake... oops]

PPS here's a version that does work, though it is a little more involved: http://pipes.yahoo.com/ouseful/mymap2georss.

In particular, it embeds a pipe that calls the KML2geoRSS service to Microsoft that I cloned off Barry Hunter. It uses this rather handy call: http://maps.live.com/GeoCommunity.asjx?mkt=en-gb&mapurl=KMLfileURL to get a geoRSS feed.

So now if you pass a Google MyMaps "View in Google Earth" URL to the http://pipes.yahoo.com/ouseful/mymap2georss Yahoo pipe, the live network linked KML url will be extracted, the KML feed passed through a Microsoft KML2RSS service, and you'll get a valid (and working) geoRSS feed out as a result which can be viewed in any feed reader, and also plotted on any map that accepts a geoRSS feed :-)

Blogged with Flock

Tags: , , ,

Posted by ajh59 at February 7, 2008 01:42 AM
Comments