Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / decode_osrm.js
Created June 10, 2015 14:20
Get a GeoJSON-friendly linestring from a Valhalla/OSRM route request
// Get a GeoJSON-friendly linestring from a Valhalla/OSRM route request
// Adapted from
// https://github.com/DennisSchiefer/Project-OSRM-Web/blob/develop/WebContent/routing/OSRM.RoutingGeometry.js
// Usage: decode(<"shape" object>, 6) //(precision = 6 seems legit)
var decode = function(encoded, precision) {
var len = encoded.length,
index = 0,
lat = 0,
lng = 0,
array = [];
@wboykinm
wboykinm / README.md
Last active August 9, 2022 02:27 — forked from tmcw/README.md
-- Isolate building features and height attributes
WITH buildings AS (
SELECT
feature_type,
osm_id,
osm_timestamp,
ST_Centroid(geometry) AS centroid,
(
SELECT
value
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wboykinm
wboykinm / lastnames.csv
Created February 13, 2014 17:08
Last Names ranked by prevalence, provided by US SSA
We can't make this file beautiful and searchable because it's too large.
rank,name,count
1,SMITH,2376206
2,JOHNSON,1857160
3,WILLIAMS,1534042
4,BROWN,1380145
5,JONES,1362755
6,MILLER,1127803
7,DAVIS,1072335
8,GARCIA,858289
9,RODRIGUEZ,804240
{
"Arial Unicode MS": [
"Arial Unicode MS Regular",
"Arial Unicode MS Bold"
],
"Brokenscript OT": [
"Brokenscript OT Bold",
"Brokenscript OT Cond Bold"
],
"Brokenscript Rough OT": [
@wboykinm
wboykinm / index.html
Created December 24, 2013 04:30
Layers from Google Earth Engine
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Forest Cover, South Sudan</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.5.2/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.5.2/mapbox.css' rel='stylesheet' />
@wboykinm
wboykinm / .block
Last active February 25, 2021 01:51 — forked from michellechandra/README.md
Modular US State Choropleth
license: MIT
@wboykinm
wboykinm / index.html
Last active December 8, 2020 21:19
Mont Albert, QC
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../app/assets/scripts/mapbox-gl.css' />
<script src='../app/assets/scripts/mapbox-gl.js'></script>
<style>
body { margin: 0; padding: 0; }