geocode() public method

This servlet provides geocoding of place names to location coordinates and also reverse geocoding of location coordinates to place names.
public geocode ( IList places ) : Task
places IList List of place names
return Task
Esempio n. 1
0
 public async Task geocode()
 {
     Loklak loklak = new Loklak();
     var p = new List<string>();
     p.Add("Delhi");
     p.Add("Berlin");
     var result = await loklak.geocode(p);
     var d = JObject.Parse(result);
     Assert.IsNotNull(d.Property("locations"));
     Assert.AreEqual(((JObject)(((JObject)d.GetValue("locations")).GetValue("Delhi"))).GetValue("country_code").ToString(),"IN");
     Assert.AreEqual(((JObject)(((JObject)d.GetValue("locations")).GetValue("Berlin"))).GetValue("country_code").ToString(), "DE");
 }