/// <summary>
 /// Get WeatherData object by geographic coordinations
 /// </summary>
 public WeatherData GetWeatherData(GeoCoordinations geoCoord)
 {
     double lat = geoCoord.Latitude;
     double lon = geoCoord.Longtitude;
     string url = "http://api.openweathermap.org/data/2.5/forecast?lat=" + lat + "&lon=" + lon + "&mode=xml";
     WeatherData wd = null;
     try
     {
         wd = ParseWeatherDataXml(url);
     }
     catch (WeatherDataServiceException e)
     {
         Console.WriteLine(e.ToString());
     }
     return wd;
 }
Example #2
0
        /// <summary>
        /// Get WeatherData object by geographic coordinations
        /// </summary>
        public WeatherData GetWeatherData(GeoCoordinations geoCoord)
        {
            double      lat = geoCoord.Latitude;
            double      lon = geoCoord.Longtitude;
            string      url = "http://api.openweathermap.org/data/2.5/forecast?lat=" + lat + "&lon=" + lon + "&mode=xml";
            WeatherData wd  = null;

            try
            {
                wd = ParseWeatherDataXml(url);
            }
            catch (WeatherDataServiceException e)
            {
                Console.WriteLine(e.ToString());
            }
            return(wd);
        }