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 / gist:5407740
Last active December 16, 2015 08:39
Twitter geolocation searches cheat sheet
-- search twitter for any tweets mentioning #gis within 100 miles of Figueroa Mountain Brewery
#gis geocode:34.609423,-120.202115,100mi
-- happening within a mile of my UCSB office
geocode:34.42028,-119.85260,1mi
@pdbartsch
pdbartsch / OpenRefine Nominatim Geocode
Last active January 14, 2024 12:43
open-refine geocoding using OpenStreetMap's Nominatim service. (previously called google-refine)
Step One - Starting with a single address field
Edit Column > Add Column by Fetching URLs
Nominatim has a limit of 1 geocode per second so make sure to set the throttle delay to greater than 1000 milliseconds
Fetch URL based on column (quotes needed):
"http://nominatim.openstreetmap.org/search?format=json&email=[YOUR_EMAIL_HERE].com&app=google-refine&q=' + escape(value, 'url')"
------------------------------------------------------------------------------------
Step Two - Extract lat/lon from newly created JSON blobs
@pdbartsch
pdbartsch / DataScienceToolkitOpenRefineTutorial
Last active December 20, 2015 00:09
Using the Data Science Toolkit with OpenRefine to make your data more interesting. Geocode. Coordinates to statistics.
##Data Science Toolkit & OpenRefine Tutorial
1. Download, Setup, and start up [OpenRefine][OpenRefine]
2. Get some data. I recommend starting with a small dataset. I'll be using [this sample data][sampledata]. Extract the zip file. You now have 500.csv.
3. Load the data into OpenRefine by clicking 'Create Project' and then 'Choose Files', navigate to 500.csv. Then click 'Next', stay with the defaults and then 'Create Project'.
4. We'll first need to concatenate the address data down into a single field. Click the dropdown arrow at the top of the existing 'Address' field, then select 'Edit column' > 'Add column based on this column'.
* Enter a name for your new column. I'll go with 'AddressCombined' in the 'New column name' box
@pdbartsch
pdbartsch / map.geojson
Last active December 21, 2015 13:29
MTB Locations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
Last active December 20, 2018 22:26
UCSB Campus Grids
Loading
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 20, 2015 03:48
UCSB "Johnny Ball" style pole lights
Loading
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
Loading
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 / .gitignore
Last active March 29, 2023 18:06
North America d3
data/*
*.zip
*.gzip
*.bu
*.paul
*.*~