All,As you can see below I have a method that extracts the location information from an ATOM feed. In this case it's all my FourSquare check ins. Anyway, would anyone mind lending a hand on this one? The error I get is that the Point does not fall within a valid range of the geographic coordinate system. I though I was reprojecting it (and the same method worked with my GeoRSS feed) but I still get the error. private static ESRI.ArcGIS.Client.Projection.WebMercator _mercator =
new ESRI.ArcGIS.Client.Projection.WebMercator();
#region Parse ATOM feed (Not Done Yet!)
private void ATOM(Stream s)
{
GraphicsLayer graphicsLayer = Map.Layers["GeoRSSFeed"] as GraphicsLayer;
graphicsLayer.ClearGraphics();
var document = XDocument.Load(s);
if (document.Root == null)
return;
var georss = XNamespace.Get("http://www.georss.org/georss");
var posts = from ev in document.Descendants("channel").Elements("item")
let values = ev.Element(georss + "point").Value.Split(' ')
select new
{
Latitude = double.Parse(values[0], System.Globalization.CultureInfo.InvariantCulture),
Longitude = double.Parse(values[1], System.Globalization.CultureInfo.InvariantCulture),
Title = (ev.Element("title").Value),
};
foreach (var ev in posts)
{
Graphic graphic = new Graphic()
{
Geometry = _mercator.FromGeographic(new MapPoint(ev.Latitude, ev.Longitude)),
Symbol = LayoutRoot.Resources["QuakePictureSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol,
//MapPoint point = new MapPoint(ev.Latitude, ev.Longitude,
// new SpatialReference(4326));
//graphic.Geometry = ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(point);
};
graphicsLayer.Graphics.Add(graphic);
}
}
#endregion
I know that 4326 is the EPSG code for for WGS84 but I've not had to mess with that in the past hence the reason its commented out.Thanks in advance,Adam