Skip to content

Commit 96ea017

Browse files
committed
more osm logic added for new osm processing
1 parent 5c60d57 commit 96ea017

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ott/loader/osm/osm_cache.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,21 @@ def check_cached_osm(self, force_update=False):
8080
pbf_newer = file_utils.is_a_newer_than_b(self.pbf_path, self.osm_path)
8181
if force_update or pbf_newer or not fresh or not sized:
8282
self.clip_to_bbox(input_path=self.pbf_path, output_path=self.osm_path)
83+
fresh = True
84+
else:
85+
fresh = False
8386

8487
# step 3: .osm file check
8588
if not file_utils.is_min_sized(self.osm_path, min_size):
8689
e = "OSM file {} is not big enough".format(self.osm_path)
8790
raise Exception(e)
8891

89-
# step 4: other OSM processing steps
90-
OsmRename.rename(self.osm_path, do_bkup=False)
91-
OsmInfo.cache_stats(self.osm_path)
92-
self.osm_to_pbf()
93-
self.other_exports()
92+
# step 4: other OSM processing steps on a new (fresh) .osm file
93+
if fresh:
94+
OsmRename.rename(self.osm_path, do_bkup=False)
95+
OsmInfo.cache_stats(self.osm_path)
96+
self.osm_to_pbf()
97+
self.other_exports()
9498

9599
def get_osmosis_exe(self):
96100
""" get the path osmosis binary

0 commit comments

Comments
 (0)