This file contains hidden or 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/sh -x | |
apt-get -y update | |
apt-get -y install htop osmosis git python-pip python-shapely python-pyproj python-networkx qhull-bin | |
git clone git://github.com/migurski/Skeletron.git ~/Skeletron | |
cd ~/Skeletron | |
python setup.py install |
This file contains hidden or 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
''' | |
ogr2ogr -overwrite -t_srs '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs' PG:"user=nhd dbname=nhd" NHDFlowline.shp | |
create table nhdflowline_snapped ( ogc_fid integer primary key ); | |
select addgeometrycolumn('', 'nhdflowline_snapped', 'geometry', 900914, 'LINESTRING', 2); | |
create index nhdflowline_snapped_geom_idx on nhdflowline_snapped using gist (geometry); | |
insert into nhdflowline_snapped |
This file contains hidden or 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
''' Extract route relations from osm2pgsql-generated database to CSV. | |
''' | |
from sys import argv | |
from csv import writer | |
from psycopg2 import connect | |
if __name__ == '__main__': | |
db = connect(database='raster_osm', user='osm').cursor() | |
This file contains hidden or 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 json import load, JSONEncoder | |
from optparse import OptionParser | |
from re import compile | |
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$') | |
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$') | |
parser = OptionParser(usage="""%prog [options] | |
Group multiple GeoJSON files into one output file. |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# ----------------------------------------------------------------------------- | |
# Copyright INRIA | |
# Contributors: Nicolas P. Rougier ([email protected]) | |
# | |
# DANA is a computing framework for the simulation of distributed, | |
# asynchronous, numerical and adaptive models. | |
# | |
# This software is governed by the CeCILL license under French law and abiding |
This file contains hidden or 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, stdout, stderr | |
from subprocess import Popen | |
from os import stat, unlink | |
from math import log, ceil | |
from stat import ST_SIZE | |
from time import time | |
from ModestMaps.OpenStreetMap import Provider | |
from ModestMaps.Core import Coordinate |
This file contains hidden or 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 time import time | |
from urlparse import urlparse | |
from httplib import HTTPConnection | |
from os.path import basename | |
from cStringIO import StringIO | |
from datetime import timedelta | |
from os import SEEK_SET, SEEK_CUR, SEEK_END | |
class RemoteFileObject: | |
""" Implement enough of this to be useful: |
This file contains hidden or 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
function ImageQueue() | |
{ | |
var closedRequests = {}, | |
queueList = [], | |
queueByHref = {}, | |
numOpenRequests = 0, | |
openRequests = {}; | |
function addImage(href, onload) | |
{ |
This file contains hidden or 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
""" | |
>>> usa = USA() | |
>>> loc = Location(48.38544, -124.72916) | |
>>> pt = usa.locationProj(loc) | |
>>> abs(-2109470 - pt.x) < 1 | |
True | |
>>> abs( 1532790 - pt.y) < 1 | |
True |
This file contains hidden or 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 time import time | |
from glob import glob | |
from os import stat, kill, getuid | |
from os.path import basename, dirname, join | |
from datetime import datetime | |
from random import choice | |
from signal import SIGTERM | |
if __name__ == '__main__': |