Closed lyricnz closed 1 year ago
Sort by... address? locID? gnaf_pid? I think one of the latter two probably makes sense - new addresses will tend to be added at the end.
Hmmmm, I think gnaf_pid would probably work best but locID could also work.
for state in data.STATES:
for file in glob.glob(f"results/{state}/*.geojson"):
print(file)
result = geojson.read_json_file(file)
result["features"] = sorted(result["features"], key=lambda x: x["properties"]["gnaf_pid"])
geojson.write_json_file(file, result, indent=1)
At the moment the ordering of results in the output file is unpredictable because it depends on the ordering of the multiple threads querying the NBN API. It would be better if this was stable, so reprocessing files generates less diffs.