This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH ZIP_FILTER AS ( | |
SELECT * FROM UTAH_ZIP_CODES | |
WHERE NAME != 'MOTOQUA' --ZIPCODE FOR MOTOQUA WAS ADDED BY THE STATE OF UTAH AFTER OUR BASELINE'S VINTAGE | |
), | |
VALID_REFINE AS ( | |
SELECT | |
LISTING_ID, | |
YEAR_BUILT, | |
ZIPCODE, | |
PRICE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from fulcrum import Fulcrum | |
from fulcrum.exceptions import NotFoundException | |
api_key = '[API KEY]' | |
fulcrum = Fulcrum(key=api_key) | |
photos_list = csv.reader(open('photos.csv'), delimiter=',') | |
for row in photos_list: | |
# fetch existing record (first column must contain fulcrum_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
p.record_id, | |
p.photo_id, | |
p.latitude, | |
p.longitude | |
FROM | |
photos p | |
INNER JOIN "Photos test for Patrick" i ON p.record_id = i._record_id | |
WHERE p.latitude IS NULL and p.longitude IS NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
COUNT(1) AS video_count, | |
ROUND((AVG(v.duration)/60)::numeric,2) AS average_duration_minutes, | |
ROUND((MIN(v.duration)/60)::numeric,2) AS min_duration_minutes, | |
ROUND((MAX(v.duration)/60)::numeric,2) AS max_duration_minutes, | |
ROUND(SUM(v.duration)::numeric,2) AS total_duration_seconds, | |
ROUND((SUM(v.duration)/60)::numeric,2) AS total_duration_minutes, | |
ROUND(((SUM(v.duration)/60)/60)::numeric,2) AS total_duration_hours, | |
ROUND(AVG(ST_Length(v.geometry::geography))::numeric,2) AS average_track_length_meters, | |
ROUND(MIN(ST_Length(v.geometry::geography))::numeric,2) AS min_track_length_meters, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://web.fulcrumapp.com/shares/a03ee04e5a2b3dfa.geojson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
puts "Starting.." | |
Dir.glob("./*.mp4").each do |filename| | |
puts "Rotating Video: #{filename}" | |
puts `mkdir "#{File.join( File.dirname(filename), "mp4")}"` | |
newfilename = File.join( | |
File.dirname(filename), | |
"mp4", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import urllib2 | |
from fulcrum import Fulcrum | |
api_key = raw_input('api_key:') | |
form_id = raw_input('form_id:') | |
if api_key == '' or api_key == 'your_api_key' or form_id == '' or form_id == 'your_form_id': | |
sys.exit('api_key and form_id are required!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Creates osm-florida database and initializes postgis | |
osm2pgsql -c -d osm-florida florida.osm.bz2 -H localhost -P 5432 -U postgres | |
## Adds a new point geometry column in WGS_84 | |
SELECT AddGeometryColumn ('public','planet_osm_polygon', 'geom', '4326', 'POINT', 2) | |
## Populates the new 'geom' column with centroids of planet_osm_polygon in WGS84 | |
UPDATE planet_osm_polygon set geom = st_transform(st_centroid(way), 4326) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building GDAL 1.9 with MDB (PGeo) support on OS X Lion | |
- Download and install the "Java for Mac OS X 10.7 Update 1 Developer Package" from https://developer.apple.com/downloads/index.action | |
- Download jackcess-1.2.6.jar from http://sourceforge.net/projects/jackcess/files/jackcess/1.2.6/jackcess-1.2.6.jar/download | |
- Download http://mdb-sqlite.googlecode.com/files/mdb-sqlite-1.0.2.tar.bz2 to get commons-lang-2.4.jar and commons-logging-1.1.1.jar. They will go alongside jackcess in the $CLASSPATH after it builds. | |
- In the GDAL source root, edit the configure.in and replace it with https://gist.github.com/1975654 |