troubleshooting Question

C#: Getting started with Nuget Package nGeo

Avatar of trevor1940
trevor1940 asked on
.NET ProgrammingGIS/GPS ProgrammingC#* GIS/Mapping
9 Comments1 Solution84 ViewsLast Modified:
Hi
I'm Hopping someone can give me a clue where to start
Background
I have a bunch of coordinates (Latitude, Longitude in WGS84) I need to locate where they are specifically their Country Admin Subdivision ISO-3166-2 codes (ISO-3166-1 is country)
Unfortunately the gadm.org  data doesn't hold the ISO codes bellow level 0 probably because they may not exist for some regions nor dose Google Maps API

https://www.geonames.org/  have an API which Will return the information  I need

Example: (don't use demo)
http://api.geonames.org/countrySubdivision?lat=52.235&lng=-0.151&username=demo&level=2

returns:
<geonames>
<countrySubdivision>
<countryCode>GB</countryCode>
<countryName>United Kingdom</countryName>
<adminCode1>ENG</adminCode1>
<adminName1>England</adminName1>
<code level="1" type="ISO3166-2">ENG</code>
<adminCode2>C3</adminCode2>
<adminName2>Cambridgeshire</adminName2>
<code level="2" type="ISO3166-2">CAM</code>
<distance>0</distance>

</countrySubdivision>


</geonames>




Could someone show me how to do this using the Nuget Package nGeo
The documentation on the How can I use it? is limited

using (var geoNamesClient = new NGeo.GeoNames.GeoNamesClient()) {    var toponym = geoNamesClient.Get(6295630, "demo"); // replace with your own username    // do something with the data }
Or an alternative

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros