public void GeoRssFromAtomFeed() { Terradue.ServiceModel.Syndication.Atom10FeedFormatter atomf = new Terradue.ServiceModel.Syndication.Atom10FeedFormatter(); atomf.ReadFrom(XmlReader.Create(new FileStream(TestContext.CurrentContext.TestPath("../Samples/landsat8.xml"), FileMode.Open, FileAccess.Read))); GeometryObject geom; foreach (var ext in atomf.Feed.Items.First().ElementExtensions) { XmlReader xr = ext.GetReader(); switch (xr.NamespaceURI) { // 1) search for georss case "http://www.georss.org/georss": geom = GeoRssHelper.Deserialize(xr).ToGeometry(); break; // 2) search for georss10 case "http://www.georss.org/georss/10": geom = GeoRss10Helper.Deserialize(xr).ToGeometry(); break; // 3) search for dct:spatial case "http://purl.org/dc/terms/": if (xr.LocalName == "spatial") { geom = WktExtensions.WktToGeometry(xr.ReadContentAsString()); } break; default: continue; } } }
public void GeoRssFromFile1() { var xr = XmlReader.Create(new FileStream(TestContext.CurrentContext.TestPath("../Samples/georsswhere.xml"), FileMode.Open, FileAccess.Read)); var geom = GeoRss10Helper.Deserialize(xr).ToGeometry(); }