Skip to content

jesseemerick/NGeoHash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGeoHash

========

NuGet Version and Downloads count

C# Port of Node-Geohash

This is a line for line port to C# of Node-Geohash https://github.com/sunng87/node-geohash

The project is available in nuget - https://www.nuget.org/packages/ngeohash/

Usage

// Fort Worth
var location = new
{
	latitude = 32.768799,
	longitude = -97.309341,
};
var encoded = GeoHash.Encode(location.latitude, location.longitude); // "9vff3tms0"

var decoded = GeoHash.Decode("9vff3tms0");
var latitude = decoded.Coordinates.Lat;		// 32.768805027008057
var longitude = decoded.Coordinates.Lon;	// -97.309319972991943

var errorMarginLat = decoded.Error.Lat //	2.1457672119140625E-05
var errorMarginLon = decoded.Error.Lon //	2.1457672119140625E-05

Invalid Usage

var bad = GeoHash.Decode("happy times"); // Throws exception

About

C# Port of Node-Geohash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages