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 | |
""" | |
Generates a simple report showing matching schemas from a list of DBF files. | |
""" | |
import sys, os, glob | |
from dbfpy import dbf | |
files = [] |
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 | |
import csv | |
import simplejson as json | |
import sys, os | |
rows = {} | |
csvkey = "mun_code" | |
# csvkey is the CSV column that contains a unique ID |
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
CREATE TABLE lucode_crosswalk ( | |
lucode integer NOT NULL PRIMARY KEY, | |
ludesc varchar(100) NOT NULL, | |
hltype varchar(30) NOT NULL | |
); | |
COMMENT ON TABLE lucode_crosswalk IS 'All available Land Use/Land Cover codes used in the NJ LULC data.'; | |
COMMENT ON COLUMN lucode_crosswalk.lucode IS 'Anderson Level IV Code'; | |
COMMENT ON COLUMN lucode_crosswalk.ludesc IS 'Land use type description'; | |
COMMENT ON COLUMN lucode_crosswalk.hltype IS 'Hasse-Lathrop code classification'; |
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 urllib, os, sys, zipfile | |
def download(url,name=""): | |
if(name == ""): | |
name = url.split('/')[-1] | |
webFile = urllib.urlopen(url) | |
localFile = open(name, 'w') | |
fname = localFile.name | |
localFile.write(webFile.read()) | |
webFile.close() |
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 | |
# --------------------------------------------------------------------------- | |
# xapi_parser.py | |
# Created on: 8 May 2012 | |
# Created by: John Reiser <[email protected]> | |
# | |
# Script to merge and convert a series of OpenStreetMap XAPI results into a | |
# single tab-delimited file. Keys are retained as additional fields. OSM id, | |
# latitude, and longitude are always exported. | |
# |
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
def buildPAMS(mun, blk, lot, qua=None): | |
"""Returns a PAMS Pin from three or four cadastre fields.""" | |
if (qua == None) or (qua == ''): | |
return "%s_%s_%s" % (mun, blk, lot) | |
else: | |
return "%s_%s_%s_%s" % (mun, blk, lot, qua) |
NewerOlder