Working with geohashes.
Working with geohashes.
(concentric-square-rings origin)
(concentric-square-rings origin n)
Given a single geohash, returns a lazy sequence of concentric square rings of geohashes around it. The first element is [hash], the second element is [northern-neighbor, northwest-neighbor, west-neighbor, ...], the third element is the list of all geohashes around those, and so on.
Given a single geohash, returns a lazy sequence of concentric square rings of geohashes around it. The first element is [hash], the second element is [northern-neighbor, northwest-neighbor, west-neighbor, ...], the third element is the list of all geohashes around *those*, and so on.
(geohash string)
(geohash point precision)
(geohash lat long precision)
Creates a geohash from a string, or at the given point with the given bit precision.
Creates a geohash from a string, or at the given point with the given bit precision.
(geohash-center geohash)
Returns the center point of a geohash.
Returns the center point of a geohash.
(geohash-error geohash)
Returns the error (i.e. the distance in meters between opposite corners) of the given geohash.
Returns the error (i.e. the distance in meters between opposite corners) of the given geohash.
(geohash-max-error bits)
Returns the maximum error (i.e. the distance between opposite corners of the geohash bounding box) for a given number of geohash bits. Geohashes are least precise at the equator.
Returns the maximum error (i.e. the distance between opposite corners of the geohash bounding box) for a given number of geohash bits. Geohashes are least precise at the equator.
(geohash-midline-area geohash)
An estimate of a geohash's area, in square meters, based on its midline dimensions.
An estimate of a geohash's area, in square meters, based on its midline dimensions.
(geohash-midline-dimensions geohash)
Returns a vector of [lat-extent long-extent], where lat-extent is the length of the geohash through the midpoint of top and bottom, and long-extent is the length of the geohash through the midpoint of left and right sides. All figures in meters.
Returns a vector of [lat-extent long-extent], where lat-extent is the length of the geohash through the midpoint of top and bottom, and long-extent is the length of the geohash through the midpoint of left and right sides. All figures in meters.
(geohashes-intersecting shape desired-level)
(geohashes-intersecting shape min-level max-level)
(geohashes-near point radius precision)
Returns a list of geohashes of the given precision within radius meters of the given point.
Returns a list of geohashes of the given precision within radius meters of the given point.
(least-upper-bound-index numbers target)
Given a sequence of numbers in descending order, finds the index of the largest number which is just greater than the target.
Given a sequence of numbers in descending order, finds the index of the largest number which is just greater than the target.
(shape->precision shape)
Estimates the precision which generates geohash regions on the scale of the given shape.
Estimates the precision which generates geohash regions on the scale of the given shape.
(square-ring origin n)
Given a geohash at the northeast corner of a square (n-2) geohashes on a side, returns a list of geohashes in a path around the square, such that the first entry in the list is the northeast corner of a square (n) geohashes on a side.
O is the origin argument F is the first hash in the returned sequence L is the last hash in the returned sequence E represents the last and first in the sequence
n=1 3 5 7 +----LF +--LF | O| +LF | O| | | E |O| | | | | +-+ | | | | +---+ | | +-----+
If n is one, returns [origin].
This algorithm is undefined at the poles.
Given a geohash at the northeast corner of a square (n-2) geohashes on a side, returns a list of geohashes in a path around the square, such that the first entry in the list is the northeast corner of a square (n) geohashes on a side. O is the origin argument F is the first hash in the returned sequence L is the last hash in the returned sequence E represents the last *and* first in the sequence n=1 3 5 7 +----LF +--LF | O| +LF | O| | | E |O| | | | | +-+ | | | | +---+ | | +-----+ If n is one, returns [origin]. This algorithm is undefined at the poles.
(string geohash)
Returns the base32 encoded string value of a geohash.
Returns the base32 encoded string value of a geohash.
(subdivide geohash)
(subdivide geohash precision)
Given a geohash, returns all geohashes inside it, of a given precision.
Given a geohash, returns all geohashes inside it, of a given precision.
(subdivide-levels geohash min-precision max-precision)
Given a geohash and a range of levels, return all geohashes inside the given geohash at all the levels in the range
Given a geohash and a range of levels, return all geohashes inside the given geohash at all the levels in the range
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close