geohash — Logtalk 3.100.1

object

# `geohash`

Geohash encoder, decoder, adjacency, covering, hierarchy, integer conversion, bit-precision, and geometry covering predicates for `geographic(Latitude,Longitude)` coordinates.

Availability:
`logtalk_load(geohash(loader))`
Author: Paulo Moura
Version: 1:2:0
Date: 2026-05-11
Compilation flags:
`static, context_switching_calls`
Implements:
`public` geohash_protocol
Imports:
`public` options
Uses:
geospatial
list
type
Remarks:

> - Alphabet: Uses the standard geohash base-32 alphabet `0123456789bcdefghjkmnpqrstuvwxyz`.

> - Encoding canonicalization: Encoding canonicalizes longitudes to the `[-180.0,180.0[` range, treating `180.0` as `-180.0` so equivalent dateline coordinates map to the same geohash.

> - Bounding boxes: Decoded cells are represented using `bbox(geographic(MinLatitude,MinLongitude),geographic(MaxLatitude,MaxLongitude))`.

> - Coverage: Bounding-box coverage accepts antimeridian-crossing boxes where the minimum longitude is greater than the maximum longitude.

> - Adaptive covering: Adaptive covers use `max_precision/1` together with `compact/1` and `min_precision/1` options.

> - Integer representation: Integer geohashes are 5-bit packed base-32 values with an explicit precision argument preserving leading zero groups.

> - Geometry covering: Polygon and polyline covering predicates rely on generic `geospatial` geometry predicates and do not support antimeridian-crossing input geometries.

Inherited public predicates:
adjacent/3 adjacent_bits/4 adjacent_int/4 bounding_box/2 bounding_box_bits/3 bounding_box_int/3 cell_dimensions/3 check_option/1 check_options/1 children/2 common_prefix/3 compress/2 covering/3 covering/4 decode/2 decode_bits/3 decode_int/3 default_option/1 default_options/1 encode/3 encode_bits/3 encode_int/3 expand/2 expand_int/3 geohash_to_int/2 int_to_geohash/3 neighbors/2 neighbors_bits/3 neighbors_int/3 option/2 option/3 parent/2 polygon_covering/4 polyline_covering/4 precision/3 valid_geohash/1 valid_option/1 valid_options/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)

See also

geohash_protocol, geospatial