Skip to content

Commit

Permalink
fix: json2osm calling via api
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Sep 7, 2023
1 parent 3041cc7 commit d2f9f9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions osm_fieldwork/json2osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def createOSM(self,
Returns:
(OsmFile): An instance of the OSM XML output file
"""
log.debug("Creating OSM XML file: %s" % filespec)
log.debug(f"Creating OSM XML file: {filespec}")
self.osm = OsmFile(filespec)
return self.osm

Expand Down Expand Up @@ -191,6 +191,7 @@ def parse(self,
Returns:
(list): A list of all the features in the input file
"""
log.debug(f"Parsing JSON file {filespec}")
all_tags = list()
if not data:
file = open(filespec, "r")
Expand Down Expand Up @@ -379,6 +380,7 @@ def json2osm(input_file, yaml_file=None):
Returns:
osmoutfile (str): Path to the converted OSM XML file.
"""
log.info(f"Converting JSON file to OSM: {input_file}")
if yaml_file:
jsonin = JsonDump(yaml_file)
else:
Expand All @@ -391,11 +393,9 @@ def json2osm(input_file, yaml_file=None):

base = Path(input_file).stem
osmoutfile = f"{base}-out.osm"
log.debug(f"Creating OSM XML file: {osmoutfile}")
jsonin.createOSM(osmoutfile)

log.debug(f"Parsing JSON file {args.infile}")
data = jsonin.parse(input_file.as_posix())
data = jsonin.parse(input_file)
# This OSM XML file only has OSM appropriate tags and values

for entry in data:
Expand Down

0 comments on commit d2f9f9b

Please sign in to comment.