Skip to content

Commit 6323734

Browse files
authored
Merge pull request #43 from eodms-sgdot/development
Added Output Geospatial Folder
2 parents 64eacb9 + efbd41a commit 6323734

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)