Skip to content

Instantly share code, notes, and snippets.

View jonahadkins's full-sized avatar
🌎
hi!

Jonah Adkins jonahadkins

🌎
hi!
View GitHub Profile
@jonahadkins
jonahadkins / gisi_slack
Last active August 29, 2015 14:06
GISi Company Themed Slack Colors
#20396D,#20396D,#3D66C8,#FFFFFF,#3D66C8,#FFFFFF,#F05521,#F05521
#converts DMS lat/long format columns like '89444400','89444400' to decimal degrees
#Author: Alex Kappel
import pandas as pd
#assigns file location
input_path = '~/Documents/temp/nbi_2014.csv'
#imports csv
df = pd.read_csv(input_path, low_memory=False, dtype=float, sep=',', encoding='ISO-8859-1')
@jonahadkins
jonahadkins / nbi_sample.csv
Created March 18, 2016 21:27
nbi sample data
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 22 columns, instead of 4 in line 6.
STATE_CODE_001,STRUCTURE_NUMBER_008,COUNTY_CODE_003,FEATURES_DESC_006A,latitude,longitude,OWNER_022,FUNCTIONAL_CLASS_026,YEAR_BUILT_027,ADT_029,YEAR_ADT_030,OPEN_CLOSED_POSTED_041,STRUCTURE_TYPE_043B,OPR_RATING_METH_063,OPERATING_RATING_064,INV_RATING_METH_065,INVENTORY_RATING_066,YEAR_RECONSTRUCTED_106,PERCENT_ADT_TRUCK_109,FUTURE_ADT_114,YEAR_OF_FUTURE_ADT_115,SUFFICIENCY_RATING
22,AFLAAWUB06103 ,15,Macks Bayou ,32313200,934032238,72,14,1998,2000,2008,P,1,0,32.4,0,32.4,0,5,6500,2030,92.5
55,P48005000000000,95,APPLE RIVER ,45272460,921849800,3,9,1978,440,1998,P,1,1,34,1,22.7,0,0,440,2031,84.2
26,13699,3,WERNERS CREEK ,46095980,870402900,21,9,1922,5,2013,A,2,8,55.7,8,43.1,1980,0,6,2033,48
18, 1IN3365,101,Turkey Creek ,38510620,867475990,73,9,2003,600,2008,A,19,1,54.4,1,32.6,0,10,650,2029,98.6
24,200000F-0701010,21,BENNETT CREEK ,39175100,772433000,2,8,1965,1031,2007,A,2,1,55.3,1,32.7,,5,1532,2027,90.2
24,200000F-2604010,21,MONOCACY RIVER
'use strict';
var tileReduce = require('tile-reduce');
var path = require('path');
var numFeatures = 0;
tileReduce({
//test bbox area
bbox: [-77.033, 36.855, -76.073, 37.468],
'use strict';
module.exports = function(data, tile, writeData, done) {
var count = 0;
if (data.osm.roads) count += data.osm.roads.length;
if (data.osm.buildings) count += data.osm.buildings.length;
console.log(data.osm.roads);
console.log(data.osm.buildings);
done(null, count);
};
http://bboxfinder.com
- bbox = left,bottom,right,top
brew install osmosis (requires java dev kit)
osmosis --rx input.osm --bb left=-78.49152 top=38.07326 right=-78.48426 bottom=38.06788 clipIncompleteEntities=true --wx ouput.osm
@jonahadkins
jonahadkins / .block
Last active November 16, 2016 03:54 — forked from mbostock/.block
Waterman Butterfly
license: gpl-3.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
col a format a15 heading 'snapshot|date'
col b format a25 heading 'table|name'
col c format 999,999,999 'space|used|total'
select
to_char(begin_interval_time, 'yy/mm/dd hh24:mm') a,
object_name b,
space_used_total c
from

24 : 70.53107625
23 : 141.0621525
22 : 282.124305
21 : 564.24861
20 : 1128.497220
19 : 2256.994440
18 : 4513.988880
17 : 9027.977761
16 : 18055.955520
15 : 36111.911040