https://github.com/cschen1205/cs-geo-tools
.NET toolkit that provides the utility functions for performing various tasks such as geocoding, reverse coding, country code translation, geo distance calculation, etc.
https://github.com/cschen1205/cs-geo-tools
country-code geo-distance-calculation geocoding reverse-geocoding
Last synced: 11 months ago
JSON representation
.NET toolkit that provides the utility functions for performing various tasks such as geocoding, reverse coding, country code translation, geo distance calculation, etc.
- Host: GitHub
- URL: https://github.com/cschen1205/cs-geo-tools
- Owner: cschen1205
- License: mit
- Created: 2018-04-29T05:57:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-30T03:46:32.000Z (about 8 years ago)
- Last Synced: 2025-06-11T06:45:40.414Z (about 1 year ago)
- Topics: country-code, geo-distance-calculation, geocoding, reverse-geocoding
- Language: C#
- Size: 2.81 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cs-geo-tools
.NET toolkit that provides the utility functions for performing various tasks such as geocoding, reverse coding, country code translation, geo distance calculation, etc.
# Install
```bash
Install-Package cs-geo-tools
```
# Usage
```cs
using System;
namespace GeoTools
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine(CountryCodeManager.Instance.GetCountryNameByCode("us"));
string address = "NTU, Singapore";
double lat, lng;
GeoTool.FindLatLngByAddress(address, out lat, out lng);
Console.WriteLine("{0} is at ({1}, {2})", address, lat, lng);
string address2 = "NUS, Singapore";
double lat2, lng2;
GeoTool.FindLatLngByAddress(address2, out lat2, out lng2);
Console.WriteLine("{0} is at ({1}, {2})", address2, lat2, lng2);
Console.WriteLine("{0} is {1} away from {2}", address, GeoTool.GetDistance_km(lat, lng, lat2, lng2), address2);
}
}
}
```