Class GeoHashEncoder
Inheritance
System.Object
GeoHashEncoder
Assembly: Mars.Common.dll
Syntax
public class GeoHashEncoder : object
Constructors
GeoHashEncoder()
Creates a new instanceof of the
GeoHashEncoder class
with default bits precision and base32 character collection from
Mars.Common.SpatialHashHelper
Declaration
GeoHashEncoder(Int32[], Char[])
Declaration
public GeoHashEncoder(int[] bits, char[] base32Chars)
Parameters
Type |
Name |
Description |
System.Int32[] |
bits |
|
System.Char[] |
base32Chars |
|
Methods
Encode(Position, GeoHashPrecision)
Declaration
public string Encode(Position geoCoord, in GeoHashPrecision precision = default(GeoHashPrecision))
Parameters
Returns
Type |
Description |
System.String |
|
Encode(Double, Double, GeoHashPrecision)
Declaration
public string Encode(double latitude, double longitude, GeoHashPrecision precision = default(GeoHashPrecision))
Parameters
Type |
Name |
Description |
System.Double |
latitude |
|
System.Double |
longitude |
|
GeoHashPrecision |
precision |
|
Returns
Type |
Description |
System.String |
|
EncodeInt(Double, Double, GeoHashPrecision)
Encode a coordinate
Creates a GeoHash out of the latitude and longitude that is precise.
Declaration
public long EncodeInt(double latitude, double longitude, GeoHashPrecision bitDepth = default(GeoHashPrecision))
Parameters
Type |
Name |
Description |
System.Double |
latitude |
The latitude value of the coordinate. |
System.Double |
longitude |
The longitude value of the coordinate. |
GeoHashPrecision |
bitDepth |
The number of bits to use for the precision of the encoded coordinate.. |
Returns
Type |
Description |
System.Int64 |
Returns a hash string for the passed coordinate |
Extension Methods