Skip to content

Instantly share code, notes, and snippets.

View stvno's full-sized avatar

Steven Ottens stvno

View GitHub Profile
create or replace function pointToTileFraction(float, float, integer) returns int[3] as $$
declare
lon ALIAS FOR $1;
lat ALIAS FOR $2;
z ALIAS FOR $3;
result int[];
BEGIN
result := array_append(result, floor(pow(2,z) * (lon / 360 + 0.5))::int);
result := array_append(result, floor(pow(2,z) * (0.5-0.25 *(log((1 + sin(lat*pi()/180))/(1 - sin(lat*pi()/180)))/pi())))::int);
@stvno
stvno / airport.json
Last active December 4, 2015 21:17
Flighttime to all airports from London
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NEDERLAND
CARLISLE BAY BARBADOS
THE DOWNS
BARBADOS
SPITHEAD
PLYMOUTH
NOVA SCOTIA
CRUISING OFF GRAND BANKS
SPITHEAD (VIA FYAL)
ST JOHNS NEWFOUNDLAND
@stvno
stvno / gist:65419080b4274010f1d43fac408144a7
Created October 7, 2018 16:21
VoyageFrom of the CLIWOC dataset
BATAVIA
CORK
ROAD TORN TORTOLA
MADEIRA
JAMAICA
BOSTON
NEW YORK
JERSEY
ST JOHNS
ST JOHNS, NEWFOUNDLAND