Skip to content

Instantly share code, notes, and snippets.

View napo's full-sized avatar
💭
guru meditation

Maurizio Napolitano napo

💭
guru meditation
View GitHub Profile
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 '