Skip to content

Instantly share code, notes, and snippets.

View DanielJWood's full-sized avatar

Daniel Wood DanielJWood

View GitHub Profile
@DanielJWood
DanielJWood / index.html
Created November 7, 2013 20:56
test of no retina: Doesn't work!
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'>
<![endif]-->
@DanielJWood
DanielJWood / index.html
Last active December 26, 2015 11:39
index.html test of retina DOESN"T WORK
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'>
<![endif]-->
@DanielJWood
DanielJWood / index.html
Last active December 26, 2015 08:39
Retina: Does work!
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
<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]-->
@DanielJWood
DanielJWood / index.html
Created October 18, 2013 20:42
Working Disable Zooming and Panning example for Mapbox js
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet'>
<![endif]-->
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":["-82.821443","34.358034"]},"properties":{"Name":"Hartwell Dam","Initial Year":"1962","Generating Units":"5","Average Energy":"486,000 MWH","System Name":"GA-AL-SC"}},{"type":"Feature","geometry":{"type":"Point","coordinates":["-82.594035","34.02549"]},"properties":{"Name":"Richard B. Russell Dam","Initial Year":"1985","Generating Units":"8 (4 Turbine)","Average Energy":"756,000 MWH","System Name":"GA-AL-SC"}},{"type":"Feature","geometry":{"type":"Point","coordinates":["-82.199761","33.661175"]},"properties":{"Name":"J. Strom Thurmond Dam","Initial Year":"1953","Generating Units":"7","Average Energy":"731,000 MWH","System Name":"GA-AL-SC"}},{"type":"Feature","geometry":{"type":"Point","coordinates":["-84.67015","34.613714"]},"properties":{"Name":"Carters Dam","Initial Year":"1975","Generating Units":"4 (2 Turbine)","Average Energy":"398,000 MWH","System Name":"GA-AL-SC"}},{"type":"Feature","geometry":{"type":"Po
@DanielJWood
DanielJWood / cobaltapp.js
Last active December 13, 2015 22:59
javascript from https://github.com/DanielJWood/cobalt . see other files there.
//COULD CREATE THIS ARRAY WITH A FOR LOOP PULLING FROM THE INDEX
// TRASH! var breakdown = [{"DR":[]},{"DI":[]},{"MP":[]},{"LT":[]},{"DA":[]},{"FD":[]}]
var markers = [];
//build map elements
var map = mapbox.map('map');
map.addLayer(mapbox.layer().id('grassroots.map-lv8enaf8'));
map.addLayer(mapbox.layer().id('grassroots.africa-protraction'));
map.ui.zoomer.add();
@DanielJWood
DanielJWood / widget.js
Created July 2, 2012 19:46
Change in twitter widget
// twitter
new TWTR.Widget({
version: 2,
type: 'search',
search: '#ICC OR #demandjustice',
//The above was changed from 'amnesty' to '#ICC OR demandjustice'
interval: 30000,
title: 'Amnesty Tweets',
subject: '',
width: 250,
@DanielJWood
DanielJWood / omsdevlog.md
Created April 27, 2012 14:29
OSM sprint devlog

Over the last two months, the OSM data sprint has turned into the OSM data 5K and we've gotten some pretty awesome stuff accomplished. I'd like to supply some relevant links and talk a little bit about what we've accomplished and learned these last two months.

A long time ago in a galaxy far far away.... border tagging

Our major focus on OSM data quality stems from the use of OSM in MapBox Streets. In the early days of MB Streets we noticed major national and subnational boundaries missing from MB Streets at certain zoom levels. In OSM the borders are tagged inconsistently so it makes rendering them in tilemill a bit difficult. We tried to standardize this by adding appropriate boundary and admin level tags to areas where the boundaries existed but were tagged wrong.

We used Ian's map to identify places where there were missing boundaries in MB streets (yellow boundaries without green boundaries for subnational, purple without black for national).

@DanielJWood
DanielJWood / app.js
Created April 24, 2012 21:27
Crime map javascript
var map, interaction;
var mm = com.modestmaps;
var layer = 'danwood.crime10hex';
var urlBase ='http://api.tiles.mapbox.com/v3/mapbox.mapbox-light,';
var url = urlBase + layer + '.jsonp';
wax.tilejson (url, function(tilejson) {
tilejson.minzoom = 1;
tilejson.maxzoom = 16;
@DanielJWood
DanielJWood / UNOCHA-Documentation.md
Created April 18, 2012 20:58
UNOCHA data Processing notes

The UNOCHA data was mined from the UNOCHA website and saved locally as zipped Shp files. The following steps were taken for processing all admin and populated places files from raw data into tilemill.

  1. Unzip Shapefile
  2. Load into QGIS and save three versions of the file in different projections and file types; SQlite with WGS 84, Shapefile with WGS 84, and SQlite file Google Mercator. The first two are for data download purposes. The last one is for use in Tilemill.
  • Note: You can also reproject these files by using tools like the ogr2ogr tool in GDAL, but I decided that it was easier to view and save the data through a UI like QGIS.
  • Note: Not all files are named well in their raw forms. In general, admin 1 means the largest boundaries subnational boundaries, admin 2 means the next largest subnational boundaries, and so on.

For the following files, additional joins have to be made to create the final file:

Chad Population at the Admin 2 le