Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / .block
Last active Feb 25, 2021 — forked from michellechandra/README.md
Modular US State Choropleth
View .block
license: MIT
@wboykinm
wboykinm / falsehoods.md
Last active Jan 27, 2021
Falsehoods programmers believe about addresses - by Michael Tandy
View falsehoods.md

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT

@wboykinm
wboykinm / geojson.php
Last active Jan 19, 2021
Sample PHP to Point GeoJSON
View geojson.php
<?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';
@wboykinm
wboykinm / index.html
Last active Dec 8, 2020
Mont Albert, QC
View index.html
<!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; }
@wboykinm
wboykinm / index.html
Last active Dec 4, 2020
BTV 1894 tiles: Sanborn-Perris Map Co. Burlington Vermont (Chittenden County) Nov. 1894. New York: Sanborn-Perris Map Co., Ltd., 1894. Courtesy of Special Collections, University of Vermont.
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>External map layers</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.js'></script>
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.css' rel='stylesheet' />
<style>
@wboykinm
wboykinm / README.md
Last active Nov 12, 2020 — forked from nkelner/README.md
A simple vector map of Vermont's Counties.
View README.md
@wboykinm
wboykinm / osm_height_anomalies.geojson
Created Sep 2, 2020
OSM building height anomalies, defined as > 5x the average local (w/in 1km) height - Calculated on Google BigQuery
View osm_height_anomalies.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View osm_building_anomalies.sql
-- Isolate building features and height attributes
WITH buildings AS (
SELECT
feature_type,
osm_id,
osm_timestamp,
ST_Centroid(geometry) AS centroid,
(
SELECT
value
@wboykinm
wboykinm / vt_knotweed_examples.geojson
Created Aug 30, 2020
A selection of known Asian Knotweed locations in riparian areas in Vermont
View vt_knotweed_examples.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wboykinm
wboykinm / compile_zillow_neighborhoods.sh
Last active Jul 9, 2020
Quickly compile all of Zillow's neighborhood geodata into a single national file
View compile_zillow_neighborhoods.sh
# Data courtesy of Zillow, attribution required: https://www.zillow.com/howto/api/neighborhood-boundaries.htm
# Requires GDAL/OGR: http://www.gdal.org/
STATES=("AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DC" "DE" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI")
rm -rf zillow_neighborhoods.*
for s in "${STATES[@]}"; do
echo "Processing $s"
wget -c https://www.zillowstatic.com/static/shp/ZillowNeighborhoods-$s.zip -O $s.zip
unzip $s.zip