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
# instantiate ami-1ae33d07 as micro instace and then ssh to the instance | |
# install post-release updates | |
sudo yum -y update | |
# Network tools | |
sudo yum -y install ssh* | |
# Dev Tools | |
sudo yum groupinstall -y 'Development Tools' | |
# Python and spatial stuff | |
sudo yum -y install python-devel gdal gdal-python gdal-devel python-setuptools proj-epsg | |
# Mapnik and friends |
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
state_abbrev2fips = { | |
'WA': '53', 'DE': '10', 'DC': '11', 'WI': '55', 'WV': '54', 'HI': '15', | |
'FL': '12', 'WY': '56', 'PR': '72', 'NJ': '34', 'NM': '35', 'TX': '48', | |
'LA': '22', 'NC': '37', 'ND': '38', 'NE': '31', 'TN': '47', 'NY': '36', | |
'PA': '42', 'AK': '02', 'NV': '32', 'NH': '33', 'VA': '51', 'CO': '08', | |
'CA': '06', 'AL': '01', 'AR': '05', 'VT': '50', 'IL': '17', 'GA': '13', | |
'IN': '18', 'IA': '19', 'MA': '25', 'AZ': '04', 'ID': '16', 'CT': '09', | |
'ME': '23', 'MD': '24', 'OK': '40', 'OH': '39', 'UT': '49', 'MO': '29', | |
'MN': '27', 'MI': '26', 'RI': '44', 'KS': '20', 'MT': '30', 'MS': '28', | |
'SC': '45', 'KY': '21', 'OR': '41', 'SD': '46' |
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
import os,sys | |
import math | |
import json | |
# 3rd party libs | |
import fiona | |
def get_s_swaths(): | |
extent = 20037508.342789244 | |
s_swaths = [] | |
for cnt in range(30): |
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
import os,sys | |
import re | |
counties = [x.strip() for x in open("/mnt/tiger/counties_fips_list.txt").readlines()] | |
for county in counties: | |
of = open("/mnt/tiger/TIGER2011/wg_fips/tl_2011_{}/files_list.txt".format(county),"w") | |
for threetuple in os.walk("/mnt/tiger/TIGER2011/"): | |
for filename in threetuple[-1]: |
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
import os,sys | |
import glob | |
import json | |
# | |
import fiona | |
shps = glob.glob("./*/*.shp") | |
for shp in shps: | |
#head,tail = os.path.split(shp) |
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
{ | |
"type" : "FeatureCollection", | |
"name" : "NewFeatureType", | |
"features" : [{ | |
"geometry" : { | |
"type" : "Polygon", | |
"coordinates" : [[[-97.976886, 33.972862], [-97.48453699999999, 33.972862], [-97.48453699999999, 33.43381899999999], [-97.976886, 33.43381899999999], [-97.976886, 33.972862]]] | |
}, | |
"type" : "Feature", | |
"properties" : { |
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
import os,sys | |
import glob | |
from multiprocessing import Pool | |
def f(sh): | |
print sh | |
os.system(sh) | |
shs = glob.glob("/mnt/tiger/TIGER2011/wg_fips/tl_2011_*/state_render.sh") | |
cmds = [open(x).read() for x in shs] |
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
import gdal2tiles | |
for zoom in range(3): | |
west = -179.99 | |
north = 89.99 | |
print "---\nzoom %s" % zoom | |
gg = gdal2tiles.GlobalGeodetic() | |
sm = gdal2tiles.GlobalMercator() | |
tx,ty = gg.LatLonToTile(north, west, zoom) | |
print 'TMS tx,ty = %s, %s' % (str(tx),str(ty)) |
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
SCHEMA = {'geometry': 'Polygon', 'properties': {'name': 'str','token': 'str'}} | |
FEATURE = {'id': '1', | |
'geometry': | |
{'type': 'Polygon', | |
'coordinates': [[(-1.0, -1.0), | |
(-1.0, 1.0), | |
(1.0, 1.0), | |
(1.0, -1.0), | |
(-1.0, -1.0)]] | |
}, |
NewerOlder