Skip to content

Instantly share code, notes, and snippets.

View rishibarve's full-sized avatar

Rishi Barve rishibarve

  • Hike Limited
  • Bangalore
View GitHub Profile
@rishibarve
rishibarve / BigQueryGeohashEncode.sql
Created October 15, 2018 06:08 — forked from killerbees/BigQueryGeohashEncode.sql
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);