Commit 7b9af64d authored by Eliot Blennerhassett's avatar Eliot Blennerhassett

save list of places in file_list.csv

parent 97865158
......@@ -43,6 +43,9 @@ def generate_osmchange(dbfile, outdir,
q = 'select * from places'
places = list(cur.execute(q))
with open(outdir + '/file_list.csv', 'w') as f:
f.write('place, num_addresses, uploader, date\n')
for place in places:
generate_osmchange_place(place, cur, outdir,
changeset, include_location)
......@@ -75,9 +78,6 @@ def generate_osmchange_place(place, dbcursor, outdir,
rows = dbcursor.execute(q)
lrows = list(rows)
if not len(lrows):
print("No addresses in %s!?" % str(place))
return
city, suburb = place[0:2]
......@@ -88,7 +88,14 @@ def generate_osmchange_place(place, dbcursor, outdir,
fn = fn.replace(' ', '_')
fn = fn.replace('/', '_')
path = outdir + "/linz_addr_%s.osc" % fn
with open(outdir + '/file_list.csv', 'a') as f:
f.write('%s,%d\n' % (fn, len(lrows)))
# keep track of empty (complete) places too
if not len(lrows):
print("No addresses in %s!?" % str(place))
return
print("%s : %d nodes" % (fn, len(lrows)))
generate_changeset_place(place, fn, outdir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment