WolframExternalFunctions/ GeoHashLink

Provides geo-hashing functions, enabling the encoding and decoding of coordinates into hierarchical strings.

Contributed by: Arnoud Buzing

Geohashing is a technique that converts geographic coordinates (latitude and longitude) into a short string of letters and numbers. This string, the geohash, acts as a unique identifier representing a rectangular area on the Earth's surface. The system subdivides the world into a grid-like hierarchy, with each geohash defining one of the grid's cells. The longer the geohash string, the smaller and more precise the area it represents, allowing for location-based applications that need to track proximity or categorize items based on their geographic position.

Installation Instructions

To install this paclet in your Wolfram Language environment, evaluate this code:
PacletInstall["WolframExternalFunctions/GeoHashLink"]


To load the code after installation, evaluate this code:
Needs["WolframExternalFunctions`GeoHashLink`"]

Examples

Basic Examples (6) 

Calculate a 5-character "geo-hash" representing your current location:

In[1]:=
hash = GeoHashEncode[Here, 5]
Out[1]=

Decode the hash, returning the GeoPosition of the center point and the GeoBoundsRegion that the hash represents:

In[2]:=
assoc = GeoHashDecode[hash]
Out[2]=

Display the location on a map, marked with a GeoMarker and highlighting the surrounding area with a GeoBoundsRegion:

In[3]:=
GeoGraphics[{GeoMarker[assoc["GeoPosition"]], assoc["GeoBoundsRegion"]}]
Out[3]=

Find the geohashes of the regions directly surrounding the location represented by the given hash:

In[4]:=
hashes = GeoHashNeighbors[hash]
Out[4]=

And decode those:

In[5]:=
assocs = GeoHashDecode /@ hashes
Out[5]=

And visualize them:

In[6]:=
GeoGraphics[{GeoMarker[#["GeoPosition"]], #["GeoBoundsRegion"]} & /@ assocs]
Out[6]=

Publisher

WolframExternalFunctions

Compatibility

Wolfram Language Version 14.1

Version History

  • 1.0.0 – 12 March 2024

License Information

MIT License

Paclet Source