Skip to content

Instantly share code, notes, and snippets.

View killerbees's full-sized avatar

Danny Angus killerbees

View GitHub Profile
@killerbees
killerbees / BigQueryGeohashEncode.sql
Last active May 27, 2020 12:42
Big Query STD SQL Gist for Geohash Encode
#standardSQL
CREATE TEMPORARY FUNCTION geohashEncode(latitude FLOAT64, logitude FLOAT64, precision FLOAT64)
RETURNS STRING
LANGUAGE js
AS """
var Geohash = {};
/* (Geohash-specific) Base32 map */
Geohash.base32 = '0123456789bcdefghjkmnpqrstuvwxyz';
lat = Number(latitude);