Skip to content

Instantly share code, notes, and snippets.

Avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / geojson.php
Last active Jul 17, 2020
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 / 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
@wboykinm
wboykinm / .block
Last active Jul 1, 2020 — forked from michellechandra/README.md
Modular US State Choropleth
View .block
license: MIT
@wboykinm
wboykinm / index.html
Created Sep 22, 2014
Leaflet Swipe between OpenCycleMap and Stamen Watercolor
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Swipe between layers</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js'></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
body { margin:0; padding:0; }
@wboykinm
wboykinm / README.md
Last active Apr 6, 2020 — forked from simzou/README.md
US Map of Nielsen Media Markets
View README.md
@wboykinm
wboykinm / index.html
Last active Jan 12, 2020
Census Dotmap + Reference
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Census Dotmap</title>
<link rel="image_src" href="/dotmap/sample.png" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="description" content="This is a map of every person counted by the 2010 US and 2011 Canadian censuses. The map has 341,817,095 dots - one for each person." />
<meta name="og:description" content="This is a map of every person counted by the 2010 US and 2011 Canadian censuses. The map has 341,817,095 dots - one for each person." />
<meta name="og:image" content="/dotmap/sample.png" />
<meta name="og:url" content="http://bmander.com/dotmap/index.html" />
@wboykinm
wboykinm / .block
Last active Dec 16, 2019
Bivariate cartogram
View .block
license: mit
@wboykinm
wboykinm / turf_and_vts.md
Last active Dec 7, 2019
Learnings while geoprocessing vector tiles with turf.js
View turf_and_vts.md
@wboykinm
wboykinm / .block
Created Jun 29, 2016
Satellite Projection
View .block
license: gpl-3.0
View README.md

Playing around with the idea of snapping to a latlon grid, by rounding the latlon values of my mouse coordinates to 1 decimal place.

Not exactly sure how this will be useful, but it could be an interesting way to interact with a values binned to a grid on the globe.

Built with blockbuilder.org

forked from enjalot's block: geosnap

forked from anonymous's block: geosnap

You can’t perform that action at this time.