GeohashString class

Constructors

GeohashString()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
maxPrecision int
The maximum precision allowed for this method of hashing.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

adjacent(String geohash, Direction direction) String
Returns a single neighbour of the given geohash in the direction. For diagonal directions, runs the processing twice.
bounds(String geohash) BoundsRecord
Returns a bounding box for a geohash as an annotated record.
decode(String geohash) → ({double lat, double lon})
Decodes a geohash to a (latitude, longitude) record. The result is the exact center of the bounding box for the geohash, returned by bounds function.
inherited
encode(double lat, double lon, int precision) String
Encode a latitude and longitude to a geohash string of given precision (i.e. character length). To get a rough estimation on the required precision, the Movable Type blog offers this table ("note that the cell width reduces moving away from the equator"):
forBounds(double minLat, double minLon, double maxLat, double maxLon, int precision, {int limit = 10000}) List<String>
Returns a list of geohashes for the given bounding box. Those geohashes cover all four corners and everything inbetween. Adjust the limit to throw a TooManyGeohashesException when the bounds cover too many cells.
inherited
forCircle(double lat, double lon, double radius, int precision, {int limit = 10000, double latLimit = 86, bool asBox = false, bool precise = false}) List<String>
Returns a list of geohashes for a circle with a given centre location and a radius in meters. Assumes the latitude and longitude to be in EPSG:4326 projection. Will trim the circle if it goes outside the EPSG:3857 projection boundaries.
inherited
neighbours(String geohash) Map<Direction, String>
Returns all eight neighbours for the given geohash string. It does call adjacent eight times, so when you don't need every value, maybe you are better using that function. Although it's a little bit more efficient by not calculating an adjacent code twice for diagonal directions.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
precision(String geohash) int
Returns the precision of geohash.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited