How can i search the geonames using their API and get city name and coordinates?
Link to their API
How can i search the geonames using their API and get city name and
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Of course it depends entirely on the actual search you want to perform. Let’s say you want to find all locations in Great Britain that start with
Lon. The URL that will perform this search (as an example, much may change for a real search) is:You can pop that in your browser and see the results:
Note that you want the
latandlngelements under eachgeoname. With LINQ to XML (includeSystem.LinqandSystem.Linq.Xmlin your namespace declarations):Of course you may choose to use these values differently, and you may want to parse
LatandLonginto doubles.