def read_locations(): home = '/home/bengolder/webapps/citydigits/' folder = 'citydigits/lottery/sample_data/' db = GeeseDB() table = 'lottery_location' path = os.path.join( home, folder, '%s.csv' % table ) db.csv_to_layer( table, path )
def read_locations(): home = '/home/bengolder/webapps/citydigits/' folder = 'citydigits/lottery/sample_data/' db = GeeseDB() table = 'lottery_location' path = os.path.join(home, folder, '%s.csv' % table) db.csv_to_layer(table, path)
def get_boroughs(): db = GeeseDB(dbinfo) boroughs = db.layer('boroughs').objects.all() borough_data = [ n.as_geojson_feature_dict(['boroname'], 4326) for n in boroughs ] with open(localpath, 'w') as f: f.write(pformat(borough_data))
def get_neighborhoods(): db = GeeseDB(dbinfo) nhoods = db.layer('neighborhoods') qset = nhoods.objects.all() with open(jspath, 'w') as f: f.write('var neighborhoods = [\n') for n in qset: d = n.as_geojson_feature_dict(fields,4326) f.write(json.dumps(d)) f.write(',\n') f.write('];\n')
def get_neighborhoods(): db = GeeseDB(dbinfo) nhoods = db.layer('neighborhoods') qset = nhoods.objects.all() with open(jspath, 'w') as f: f.write('var neighborhoods = [\n') for n in qset: d = n.as_geojson_feature_dict(fields, 4326) f.write(json.dumps(d)) f.write(',\n') f.write('];\n')
def dump_locations(): folder = 'lottery/sample_data/' db = GeeseDB() table = 'lottery_location' path = os.path.join( folder, '%s.csv' % table ) db.layer_to_csv( table, path, exclude=['id'] )
def get_boroughs(): db = GeeseDB(dbinfo) boroughs = db.layer('boroughs').objects.all() borough_data = [n.as_geojson_feature_dict(['boroname'],4326) for n in boroughs] with open(localpath, 'w') as f: f.write(pformat(borough_data))
def dump_locations(): folder = 'lottery/sample_data/' db = GeeseDB() table = 'lottery_location' path = os.path.join(folder, '%s.csv' % table) db.layer_to_csv(table, path, exclude=['id'])