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:
Imports:
public options
Uses:
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.

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)