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
from sys import argv | |
from shapely.ops import polygonize | |
from shapely.geometry import asShape, LineString | |
import json | |
if __name__ == '__main__': | |
input = argv[1] | |
input = json.load(open(input)) |
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
from glob import glob | |
from os.path import dirname, basename, join | |
print 'psql -U username -c "TRUNCATE roads_skeletron"' | |
all_filenames = glob('tmp/*/???????-roads-z12.shp') | |
for (overall_index, filename) in enumerate(sorted(all_filenames)): | |
quad = basename(filename)[:7] |
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
#!/bin/bash | |
# loop through all of the shapefiles in the directory and act on them | |
# http://trac.osgeo.org/gdal/wiki/FAQVector#HowcanImergehundredsofShapefiles | |
# http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash | |
#USAGE: | |
# sh list_dir_of_shps.sh in_dir_path out_dir_path | |
#Capture the shell arguments |
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
zips/packages/natural_earth_vector.sqlite.zip: | |
#SQL-Lite | |
for shp in 10m_cultural/*.shp 10m_physical/*.shp 50m_cultural/*.shp 50m_physical/*.shp 110m_cultural/*.shp 110m_physical/*.shp; \ | |
do \ | |
ogr2ogr -f SQLite -append zips/packages/natural_earth_vector.sqlite $$shp; \ | |
done | |
zip zips/packages/natural_earth_vector.sqlite.zip zips/packages/natural_earth_vector.sqlite VERSION README.md CHANGELOG |
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
UTF-8 + spherical mercator. | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_breakaway_disputed_areas_10m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_breakaway_disputed_areas_50m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_land_10m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_land_50m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_land_110m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_map_units_10m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_maritime_indicator_10m.zip | |
http://cascadenik.teczno.com/data/ne-1.4/900913/admin_0_boundary_lines_maritime_indicator_50m.zip |
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 python | |
# distance_from_shore.py: compute true distance between points | |
# and closest geometry. | |
# shaun walbridge, 2012.05.15 | |
# TODO: no indexing used currently, could stand if performance needs | |
# improving (currently runs in ~1.5hr for 13k points) | |
from geopy import distance |
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
legend: #PctHomesInNegEquityOfMortgage | |
<span style="color: #e73a43">▉</span> 0.4 – 1.0 <br /> | |
<span style="color: #ff7265">▉</span> 0.3 – 0.4 <br /> | |
<span style="color: #ffac8f">▉</span> 0.2 – 0.3 <br /> | |
<span style="color: #ffd8b0">▉</span> 0.1 – 0.2 <br /> | |
<span style="color: #fff4e5">▉</span> 0.0 – 0.1 <br /> | |
<span style="color: #cad8e5">▉</span> No data |
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
/* | |
Turns red dots on the Field Papers tiles into markers automatically | |
Write a description to save the marker | |
I don't understand the server-side installation or the QR-scanning, so I'm using a bookmarklet | |
Client-side HTML5 Canvas for tile inspection | |
*/ | |
// collect the most zoomed-in tiles from the scan | |
var zoomimgs = document.getElementsByTagName("img"); | |
var maxzoom = 0; |
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
// replace "toner" here with "terrain" or "watercolor" | |
var layer = "toner"; | |
var map = new google.maps.Map(document.getElementById("element_id"), { | |
center: new google.maps.LatLng(37.7, -122.4), | |
zoom: 12, | |
mapTypeId: layer, | |
mapTypeControlOptions: { | |
mapTypeIds: [layer] | |
} | |
}); |
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
// replace "toner" here with "terrain" or "watercolor" | |
var layer = new OpenLayers.Layer.Stamen("toner"); | |
var map = new OpenLayers.Map("element_id"); | |
map.addLayer(layer); |