Skip to content

Commit

Permalink
jsontogeojson: write meta file to disk
Browse files Browse the repository at this point in the history
Helpful for #6
  • Loading branch information
odscjames committed Nov 8, 2022
1 parent 20b1341 commit c7828f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cove_ofds/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@ def __init__(self, supplied_data):
self.spans_file_name = os.path.join(
self.supplied_data.data_dir(), "spans.geo.json"
)
self.meta_file_name = os.path.join(
self.supplied_data.data_dir(), "geojson.meta.json"
)

def process(self, process_data: dict) -> dict:
# TODO if original format this, don't bother
# TODO if original format is geojson, don't bother? or do bother?
# because maybe we'll need the meta files for the map?

if os.path.exists(self.nodes_file_name):
return process_data
Expand All @@ -250,6 +254,9 @@ def process(self, process_data: dict) -> dict:
with open(self.spans_file_name, "w") as fp:
json.dump(converter.get_spans_geojson(), fp, indent=4)

with open(self.meta_file_name, "w") as fp:
json.dump(converter.get_meta_json(), fp, indent=4)

return process_data

def get_context(self):
Expand Down

0 comments on commit c7828f3

Please sign in to comment.