All Projects → Postlagerkarte → geohash-dotnet

Postlagerkarte / geohash-dotnet

Licence: MIT License
Easy-to-use and feature-rich geohash library written in C#

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to geohash-dotnet

geoh
Transform a geoJSON into a list of geohashes that intersect with it
Stars: ✭ 26 (-39.53%)
Mutual labels:  geohash
geohash
Geohash for Rust
Stars: ✭ 64 (+48.84%)
Mutual labels:  geohash
geohash
Go Geohash
Stars: ✭ 42 (-2.33%)
Mutual labels:  geohash
geohash
geohash http server
Stars: ✭ 32 (-25.58%)
Mutual labels:  geohash
mapzen-geohash
Python package containing simple tools for encoding and decoding geohashes
Stars: ✭ 52 (+20.93%)
Mutual labels:  geohash
leveldb-cli
CLI for LevelDB
Stars: ✭ 86 (+100%)
Mutual labels:  geohash

geohash-dotnet

Easy-to-use and feature-rich geohash library

NuGet version (blazor-dragdrop)

Build Status

Demo

https://geohash.azurewebsites.net/

Installation

To use the geohash library in your projects run the following command in the Package Manager Console:

 Install-Package geohash-dotnet

Usage Examples

Create a Geohasher object

var hasher = new Geohasher();

Encode a latitude and longitude to a geohash

   var hash  = hasher.Encode(52.5174, 13.409);  // default precision 6 
   var hash2 = hasher.Encode(52.5174, 13.409, 12);  // precision 12

Decode a geohash to latitude and longitude

    var decoded = hasher.Decode("u33dc0");
    var latitude = decoded.Item1;
    var longitude = decoded.Item2;

Get neighbors for a hash

    var neighbors         = hasher.GetNeighbors("m");
    var northNeighbor     = neighbors[Direction.North];
    var northEastNeighbor = neighbors[Direction.NorthEast]);
    var eastNeighbor      = neighbors[Direction.East]);
    var southEastNeighbor = neighbors[Direction.SouthEast]);
    var southNeighbor     = neighbors[Direction.South]);
    var southWestNeighbor = neighbors[Direction.SouthWest]);
    var westNeighbor      = neighbors[Direction.West]);
    var northWestNeighbor = neighbors[Direction.NorthWest]);

Get specific neighbor for a hash

var southEastNeighbor = hasher.GetNeighbor("u33dc0", Direction.SouthEast));

Get all 32 subhashes for a hash

var subhashes = hasher.GetSubhashes("u33dc0");

Get parent of a hash

var parentHash = hasher.GetParent("u33dbc")
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].