Trying to read data from Open Street Map webpage. I have Longitude and Latitude. Based on these web link is generated.
My target is to parse xml:
// Loading from a file, you can also load from a stream
XDocument xml = XDocument.Parse(result);
// Query the data and write out a subset of contacts
IEnumerable<string> query = from c in xml.Root.Descendants("addressparts")
select c.Element("road").Value " "
c.Element("house_number").Value;
CodePudding user response:
You'll have to provide a valid user-agent in your requests, otherwise the requests will be blocked. From the current Nominatim Usage Policy:
- Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do).
myRequest.UserAgent = "MyApp Version 1.2.3.4"