In case anyone is interested, I've been trying to use turf.js on both Mapbox and Mapzen vector tiles, and I've learned a few things I wish I'd known going in.
This thing I've been working on for a month or so here and there, to make maps like this:
In case anyone is interested, I've been trying to use turf.js on both Mapbox and Mapzen vector tiles, and I've learned a few things I wish I'd known going in.
This thing I've been working on for a month or so here and there, to make maps like this:
-- Functions to create and draw histograms with PostgreSQL. | |
-- psql> select * from show_histogram((select histogram(length(email), 0, 32, 6) FROM auth_user limit 100)); | |
-- bucket | range | count | bar | cumbar | cumsum | cumpct | |
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------ | |
-- 0 | [0,5.33333333333333) | 1 | | | 1 | 0.00273224043715846995 | |
-- 1 | [5.33333333333333,10.6666666666667) | 5 | = | | 6 | 0.01639344262295081967 | |
-- 2 | [10.6666666666667,16) | 149 | ============================== | ============= | 155 | 0.42349726775956284153 | |
-- 3 | [16,21.3333333333333) | 145 | ========= |
This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.
Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.
Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT
<?php | |
/** | |
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON | |
*/ | |
# Connect to MySQL database | |
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword'); | |
# However the User's Query will be passed to the DB: | |
$sql = 'SELECT * from GDA_database WHERE user_query = whatever'; |
// Adapted from CRS: http://www.surveysystem.com/sscalc.htm | |
conInt = 0; | |
conLev=1; | |
zVal=1.96; | |
zValC=3.8416; | |
ss=0; | |
pop=0; | |
perc=0; | |
pf = 0; |
Instructions for getting a [mostly] static website onto a custom domain, with https
encryption, for [mostly] free. I'm finally writing this down after getting stuck on step 10 way too many times. Godspeed.
index.html
.CNAME
to the repo, containing only a single line with your just-purchased domain in it. e.g. domain.com
.<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>D3 GeoJSON in Leaflet</title> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' /> | |
<!--[if lte IE 8]> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'> | |
<![endif]--><style> | |
html, body, #map { height: 100%;width:100%; background:#020B26;position:absolute;} | |
body { padding: 0; margin: 0; } | |
path { stroke-linejoin; round; stroke-linecap: round; fill: none} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' /> | |
<script src='http://geosprocket.com/assets/bootstrap/js/bootstrap.min.js'></script> | |
<link href='http://geosprocket.com/assets/bootstrap/css/bootstrap-spruce.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } |
Fiddling with Tristen's UI theme ideas for a revamped mapbox.js, repo'd here
Generating some points to approximate streetlight locations in Compton, L.A.
Loose homage to Kendrick Lamar, strong shouts to Snoop, Dre, Mary J., and the map underneath the 2022 Superbowl Halftime Show, and big respect to the L.A. county streetlight spacing guidelines.
(Yes, I know this isn't Compton. Bear with me here.)