Calculates a geohash value given two fields representing latitude and longitude.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
as | string | optional[a] | _geohash | The name of the field that is produced by the function. |
lat | string | optional[a] | ip.lat | The field to use for latitude. |
lon | string | optional[a] | ip.lon | The field to use for longitude. |
precision | number | optional[a] | 12 | The precision to use in the calculation. Usually 12 is enough. |
[a] Optional parameters use their default value unless explicitly set. |
geohash()
Examples
Calculate the geohash value of a set of coordinates.
logscale
geohash(lat=myLatField, lon=myLonField)
This example computes the geohash for Greenwich:
logscale
lat:=51.477928
| lon:=0.0
| g:=geohash(lat=lat, lon=lon)
The result is gcpuzgrbxvrc
.