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 sys, csv, simplejson | |
from optparse import OptionParser | |
parser = OptionParser(usage='usage: %prog [options] csv_file json_file\n' """ | |
Merges data from a comma- (or tab-, pipe-, etc.) separated file into the | |
properties of GeoJSON features by joining on a foreign key, and prints the | |
resulting GeoJSON feature collection to stdout.""") | |
parser.add_option('-f', '--fk', dest='fk', default='id', | |
help='The CSV column and GeoJSON feature property name on ' | |
'which to join. This may either be a single string, or ' |