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 arcpy | |
from arcpy import env | |
import os | |
# Set the workspace for the ListFeatureClass function | |
# | |
env.workspace = "C:\\data\\mydata" | |
# Use the ListFeatureClasses function to return a list of | |
# all shapefiles. |
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 |
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
#!/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
/* | |
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
#!/usr/bin/python | |
# README | |
# | |
# This script is from: https://gist.github.com/1953554 | |
# By Nathaniel Vaughn Kelso and Mike Migurski @ Stamen | |
# | |
# Based on script by andrewharvey: https://gist.github.com/1675606 | |
# | |
# This script should be considered CC0 licensed |