Exemplo n.º 1
0
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 )
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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')
Exemplo n.º 5
0
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')
Exemplo n.º 6
0
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))
Exemplo n.º 8
0
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'])