Discover Packages
github.com/pierrre/geohash
package
module
Version:
v1.2.1
Opens a new window with list of versions in this module.
Published: Aug 22, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 11 modules, 10 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
Geohash
A geohash library for Go (Golang)
Features
Encode latitude/longitude to geohash
Decode geohash to latitude/longitude
Round a geohash box to a single location
Command-line tool
Expand ▾
Collapse ▴
Documentation
¶
Encode encodes a location to a geohash.
The maximum supported precision is 32.
EncodeAuto encodes a location to a geohash using the most suitable precision.
type Box struct {
Lat, Lon Range
}
Box is a spatial data structure.
It is defined by 2 ranges of latitude/longitude.
Decode decodes a geohash to a Box .
An empty geohash returns the whole-world box (latitude -90 to 90, longitude -180 to 180) with a nil error.
Center returns the Box's center as a Point.
Round returns the Box's approximate location as a Point .
It uses decimal rounding and is in general more useful than Center.
Neighbors will contain the geohashes for the neighbors of the supplied geohash in each of the cardinal and intercardinal directions.
GetNeighbors returns a struct representing the Neighbors of the supplied geohash in each of the cardinal and intercardinal directions.
type Point struct {
Lat, Lon float64
}
Point represents a location (latitude and longitude).
type Range struct {
Min, Max float64
}
Range represents a range (min/max) on latitude or longitude.
Mid returns the middle value between Min and Max.
Round returns the rounded value between Min and Max.
It uses decimal rounding.
Val returns the difference between Min and Max.
Source Files
¶
Directories
¶
cmd
geohash
command
Geohash command-line.
Geohash command-line.
Click to show internal directories.
Click to hide internal directories.