Skip to content

Commit efbd41a

Browse files
committed
Added Output Geospatial Folder
The value specified for the output geospatial file can now be a folder. modified: scripts/spatial.py
1 parent 43dc2ba commit efbd41a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/spatial.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,17 @@ def export_results(self, img_lst, out_fn='results.geojson'):
162162
:type out_fn: str
163163
"""
164164

165+
fn = self.eod.fn_str
166+
165167
if out_fn is None or out_fn == '':
166168
return None
167169

168170
if out_fn.lower() in ['geojson', 'kml', 'gml', 'shp']:
169-
fn = self.eod.fn_str
170171
out_fn = f'{fn}_outlines.{out_fn.lower()}'
171172

173+
if os.path.isdir(out_fn):
174+
out_fn = os.path.join(os.sep, out_fn, f"{fn}_outlines.geojson")
175+
172176
# If the output GeoJSON exists, remove it
173177
if os.path.exists(out_fn):
174178
os.remove(out_fn)

0 commit comments

Comments
 (0)