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); |
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 MM.StamenTileLayer("toner"); | |
var map = new MM.Map("element_id", layer); | |
map.setCenterZoom(new MM.Location(37.7, -122.4), 12); |
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 L.StamenTileLayer("toner"); | |
var map = new L.Map("element_id", { | |
center: new L.LatLng(37.7, -122.4), | |
zoom: 12 | |
}); | |
map.addLayer(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
/* | |
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
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
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
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
#!/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
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
WITH RECURSIVE dims AS (SELECT 2*sqrt(sum(ST_Area(the_geom))) as d, sqrt(sum(ST_Area(the_geom)))/20 as w, count(*) as rows FROM osm_export_polygon WHERE the_geom IS NOT NULL), | |
geoms AS (SELECT the_geom, ST_YMax(the_geom)-ST_YMin(the_geom) as height FROM osm_export_polygon WHERE the_geom IS NOT NULL ORDER BY ST_YMax(the_geom)-ST_YMin(the_geom) DESC), | |
geomval AS (SELECT the_geom, row_number() OVER (ORDER BY height DESC) as id from geoms), | |
positions(the_geom,x_offset,y_offset,new_row,row_offset) AS ( | |
(SELECT the_geom, 0.0::float, 0.0::float, FALSE, 2 from geomval limit 1) | |
UNION ALL | |
( | |
SELECT | |
(SELECT the_geom FROM geomval WHERE id = p.row_offset), | |
CASE WHEN |
OlderNewer