File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -82,14 +82,19 @@ def cli():
8282 valid = v .validate (config )
8383 if not valid :
8484 raise Exception (v .errors )
85-
85+
86+ # for aoi, overwrite bounding_box config key to correct labelling
87+ if 'aoi' in config .keys :
88+ config ['bounding_box' ] = get_bounds (json .load (open (config .get ('aoi' ), 'r' )))
89+
8690 # custom validation for top level keys
8791 # require either: country & bounding_box or geojson
88- if not ( 'country' in config . keys () and ' geojson' in config .keys ()) and not ('country' in config .keys () and 'bounding_box' in config .keys ()):
89- raise Exception ('either "country" and " geojson" or "country" and "bounding_box" must be present in the configuration JSON' )
92+ if ' geojson' not in config .keys ()) and not ('country' in config .keys () and 'bounding_box' in config .keys ()):
93+ raise Exception ('either "geojson" or "country" and "bounding_box" must be present in the configuration JSON' )
9094
9195 # for geojson, overwrite other config keys to correct labeling
9296 if 'geojson' in config .keys ():
97+ config ['country' ] = op .splitext (op .basename (config .get ('geojson' )))[0 ]
9398 config ['bounding_box' ] = get_bounds (json .load (open (config .get ('geojson' ), 'r' )))
9499
95100 if cmd == 'download' :
You can’t perform that action at this time.
0 commit comments