コード例 #1
0
        public void GeoCountryInfo_ListByLocation()
        {
            var c = GeoCountryInfo.ListByLocation(new GeoPosition(39.0, -67.0));

            Assert.AreEqual(1, c.Count());
            Assert.AreEqual("USA", c.First().ISO3);
        }
コード例 #2
0
        // --------------------------------------------------
        // Country
        public GeoCountryInfo NearestCountry(IGeoLatLon point)
        {
            var countries = GeoCountryInfo.ListByLocation(point).OrderBy(x => GeoDistance.BetweenPoints(x.Center, point).Meters);

            return(countries.FirstOrDefault());
        }