Compartilhar via


Fun with GeoRSS, Virtual Earth and WCF Syndication

WCF Syndication APIs are great. In just a couple of hours I wrote a simple GeoRSS feed, a fairly high level library to encapsulate the details of common entities (lines, points, polygons), all unit tests and a mashup with VE to test it.

I only encountered a couple of incompatibilities and problems (mainly related to XML namespaces) but everything was straight forward and easy. VE doesn't allow the RSS feed to come from a different server the map is hosted, so you need a proxy to walk around this limitation (Very well explained in this blog entry. A must read for anyone doing VE stuff. Thanks for the code!). 

Being fairly new to this is space, I was amazed at the power off all these infrastructure components, and the apps that could be built with this stuff; and I know I have just barely scratched the surface.

My library allows me to easily author a GeoRss feed:

image

GeoRssData is a simple object model for geo information. GeoRSSFeedBuilder translates the domain model into a RSS feed with the proper extensions. This is all quite easy with WCF Syndication classes. Finally this the result on IE:

image

Comments

  • Anonymous
    December 24, 2007
    PingBack from http://geeklectures.info/2007/12/24/fun-with-georss-virtual-earth-and-wcf-syndication/

  • Anonymous
    December 25, 2007
    Did you run into this problem? http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2293295&SiteID=1 Wondering if this was fixed the the Virtual Earth API, or if you found a way around the requirement for the geo namespace prefix?

  • Anonymous
    December 29, 2007
    Yes, I ran into that problem. VE likes the extension elements fully qualified and I also wanted to leverage WCF Syndication. Here's what I did (the line element as an exanple) which was teh fastest and easiest way I found, there might be others though: private static SyndicationElementExtension GetLineExtension(Point[] line)        {            StringBuilder extensionXml = new StringBuilder("<georss:line xmlns:georss="http://www.georss.org/georss">");            foreach (Point x in line)            {                extensionXml.Append(x.Latitude.ToString() + " " + x.Longitude.ToString() + " ");            }            extensionXml.Append("</georss:line>");            XmlTextReader tr = new XmlTextReader(extensionXml.ToString(), XmlNodeType.Element, null);            SyndicationElementExtension sext = new SyndicationElementExtension(tr);            tr.Close();            return sext;        }

  • Anonymous
    June 27, 2008
    Some time ago , I did some experiments with Virtual Earth control and its features. I especially liked