geo.geohash

Working with geohashes.

(bbox geohash)

bbox-geom

(bbox-geom geohash)

character-precision

(character-precision geohash)

concentric-square-rings

(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.

eastern-neighbor

(eastern-neighbor h)

geohash

(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.

geohash-center

(geohash-center geohash)
Returns the center point of a geohash.

geohash-error

(geohash-error geohash)
Returns the error (i.e. the distance in meters between opposite corners) of
the given geohash.

geohash-max-error

(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.

geohash-midline-area

(geohash-midline-area geohash)
An estimate of a geohash's area, in square meters, based on its midline
dimensions.

geohash-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.

geohashes-intersecting

(geohashes-intersecting shape desired-level)(geohashes-intersecting shape min-level max-level)

geohashes-near

(geohashes-near point radius precision)
Returns a list of geohashes of the given precision within radius meters of
the given point.

least-upper-bound-index

(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.

(neighbors h)

northern-neighbor

(northern-neighbor h)

shape->precision

(shape->precision shape)
Estimates the precision which generates geohash regions on the scale of the
given shape.

significant-bits

(significant-bits geohash)

southern-neighbor

(southern-neighbor h)

square-ring

(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.

string

(string geohash)
Returns the base32 encoded string value of a geohash.

subdivide

(subdivide geohash)(subdivide geohash precision)
Given a geohash, returns all geohashes inside it, of a given precision.

subdivide-levels

(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

western-neighbor

(western-neighbor h)