Skip to content

Instantly share code, notes, and snippets.

View pdbartsch's full-sized avatar

Paul Bartsch pdbartsch

  • UC Santa Barbara
  • 93455
View GitHub Profile
@pdbartsch
pdbartsch / list.php
Created March 15, 2015 22:11
List & link to contents of web directory PHP
<?php
$dir_open = opendir('.');
while(false !== ($filename = readdir($dir_open))){
if($filename != "." && $filename != ".."){
$link = "<a href='./$filename'> $filename </a><br />";
echo $link;
}
}
@pdbartsch
pdbartsch / map.geojson
Created March 20, 2015 03:48
UCSB "Johnny Ball" style pole lights
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pdbartsch
pdbartsch / map.geojson
Created March 25, 2015 21:48
UCSB buildings within 100ft of ESHA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pdbartsch
pdbartsch / index.html
Last active August 29, 2015 14:18
Working through a d3 map tutorial http://bost.ocks.org/mike/map/
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.subunit.SCT { fill: #ddc; }
.subunit.WLS { fill: #cdd; }
.subunit.NIR { fill: #cdc; }
.subunit.ENG { fill: #dcd; }
.subunit.IRL { display: none; }
@pdbartsch
pdbartsch / California_urban_water_supplier_tiers_PDF_to.csv
Last active August 29, 2015 14:19
California water/ drought data converted to usable formats
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
Supplier Name,Total water production 2013 (Jun - Feb),Total water production (June 2014 - Feb 2015),"Total water saved (June 2014 to Feb 2015), compared to 2013, gallons","Percent saved (June 2014 to Feb 2015), compared to 2013, gallons",Tier,Conservation standard,"Residential, gallons per capita per day (R-GPCD)"
Cambria Community Services District,"166,216,813","95,513,570","70,703,243",43%,1,10%,40.0
Vernon City of,"1,907,061,769","1,788,380,162","118,681,607",6%,1,10%,43.7
Santa Cruz City of,"2,527,700,000","1,933,400,000","594,300,000",24%,1,10%,44.9
Seal Beach City of,"905,215,264","856,337,550","48,877,714",5%,1,10%,45.3
San Francisco Public Utilities Commission,"20,365,410,000","18,717,900,000","1,647,510,000",8%,1,10%,45.7
California Water Service Company South San Francisco,"2,075,673,590","1,907,534,254","168,139,336",8%,1,10%,46.1
California Water Service Company East Los Angeles,"3,998,522,861","3,819,956,279","178,566,582",4%,1,10%,48.2
Coastside County Water District,"565,550,000","524,430,0
@pdbartsch
pdbartsch / ca_counties.geojson
Last active August 29, 2015 14:19
California Counties json formats
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pdbartsch
pdbartsch / util_export.md
Last active August 29, 2015 14:19
GIS UCSB Utility data from ArcSDE to shapefile to geojson to topojson

How I get esri gdb data ready for Leaflet maps

In my case, data source of truth lives in an ArcSDE geodatabase on PostgreSQL using EPSG:2229 projection

  • export from ArcCatalog to shapefile ... I filtered by utility type and left out the abandoned line info
  • a typical ogr2ogr command looked like this
    • ogr2ogr -f GeoJSON -t_srs EPSG:4326 ut_watr_node.geojson UT_watr_act_node.shp
  • then from geojson to topojson to reduce size and cleanup some unnecessary attributes
    • topojson -o ut_watr_link.topojson -p util_type,size,material,lat_main ut_watr_link.geojson
  • topojson -o ut_watr_node.topojson -p util_type,yr_insta,node_type,size ut_watr_node.geojson
@pdbartsch
pdbartsch / README.md
Last active August 29, 2015 14:19
Paul's Leaflet template
@pdbartsch
pdbartsch / README.md
Last active August 29, 2015 14:19
UCSB Emergency Assembly Points - DRAFT
  • a working example from Morgan Herlocker got me started
  • pulling external GeoJSON using jQuery at the moment - I've got it setup in this weird way where the request for one data source is nested inside of the other...not real clean looking but it works to avoid async problem I was having
  • would like to integrate Omnivore eventually
  • water color map obviously not the best for a real tool used during an emergency but I like it for testing/learning
  • I'm excited about the posibilities with this seemingly simple filtering using Turf.js
@pdbartsch
pdbartsch / .gitignore
Last active August 29, 2015 14:20
Learning d3 again/ still
# Build and Release Folders
bin/
bin-debug/
bin-release/
# Other files and folders
.settings/
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important