Class GeohashUtils
Utilities for encoding and decoding geohashes.
This class isn't used by any other part of Spatial4n; it's included largely for convenience of
software using Spatial4n. There are other open-source libraries that have more comprehensive
geohash utilities but providing this one avoids an additional dependency for what's a small
amount of code. If you're using Spatial4n just for this class, consider alternatives.
This code originally came from Apache Lucene, LUCENE-1512.
Inheritance
Inherited Members
Assembly: Spatial4n.dll
Syntax
public static class GeohashUtils
Fields
Name | Description |
---|---|
MAX_PRECISION |
Methods
Name | Description |
---|---|
Decode(String, SpatialContext) | Decodes the given geohash into a latitude and longitude |
DecodeBoundary(String, SpatialContext) | Returns min-max lat, min-max lon. |
EncodeLatLon(Double, Double) | Encodes the given latitude and longitude into a geohash |
EncodeLatLon(Double, Double, Int32) | Encodes the given latitude and longitude into a geohash |
GetSubGeohashes(String) | Array of geohashes 1 level below the baseGeohash. Sorted. |
LookupDegreesSizeForHashLen(Int32) | |
LookupHashLenForWidthHeight(Double, Double) | Return the shortest geohash length that will have a width & height >= specified arguments. |