[intersections] Adding a read classmethod to intersections to read the intermediate JSON file

This commit is contained in:
Al
2016-08-17 15:29:59 -04:00
parent 96c753e8c6
commit a3ae1eb330

View File

@@ -156,6 +156,13 @@ class OSMIntersectionReader(object):
'ways': ways}
out.write(json.dumps(d) + six.u('\n'))
@classmethod
def read_intersections(cls, infile):
f = open(infile)
for line in f:
data = json.loads(line.rstrip())
yield data['id'], data['lat'], data['lon'], data['ways']
if __name__ == '__main__':
parser = argparse.ArgumentParser()