Tom MacWright's demonstration of jenks natural breaks implemented in simple-statistics.
Rendered by d3js, based on an example by Mike Bostock.
// 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 = []; |
Tom MacWright's demonstration of jenks natural breaks implemented in simple-statistics.
Rendered by d3js, based on an example by Mike Bostock.
-- Isolate building features and height attributes | |
WITH buildings AS ( | |
SELECT | |
feature_type, | |
osm_id, | |
osm_timestamp, | |
ST_Centroid(geometry) AS centroid, | |
( | |
SELECT | |
value |
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": [ |
<!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' /> | |
license: MIT |
<!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; } |