You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
show_help "$(printf "%s\n ""Metadata directory not specified")"
183
192
elif [ $#-gt 1 ];then
184
193
show_help "$(printf "%s\n ""Too many arguments.""Only specify the metadata directory when using the update option (-u).""The only allowed optional argument is -s. Use it if you would like to only""update either the Landsat or Sentinel-2 metadata catalogue.")"
185
-
elif! [ -w"$METADIR" ];then
194
+
elif! [ -d"$METADIR" ];then
186
195
show_help "$(printf "%s\n ""Metadata directory does not exist, exiting")"
187
196
elif! [ -w"$METADIR" ];then
188
197
show_help "$(printf "%s\n ""Can not write to metadata directory, exiting")"
189
198
else
199
+
DOWNLOADSHP=0
190
200
which_satellite
191
201
if [ $LANDSAT-eq 1 ];then
192
202
update_meta landsat landsat
203
+
check_satellite_grid_files "$METADIR" landsat
193
204
fi
194
205
if [ $SENTINEL-eq 1 ];then
195
206
update_meta sentinel-2 sentinel2
207
+
check_satellite_grid_files "$METADIR" sentinel
208
+
fi
209
+
if [ $DOWNLOADSHP-gt 0 ];then
210
+
printf"%s\n""""Downloading and extracting tile / footprint shapefiles..."
printf"%s\n""""Done. You can run this script without option -u to download data now."""
@@ -281,7 +299,6 @@ if [ -f $AOI ]; then
281
299
# is AOI a GDAL readable file?
282
300
if ogrinfo $AOI>& /dev/null;then
283
301
AOITYPE=1
284
-
OGR=1
285
302
else
286
303
# Must be tile list or bounding box
287
304
# check if tile list / bounding box file contains whitespaces or non-unix eol
@@ -293,15 +310,13 @@ if [ -f $AOI ]; then
293
310
fi
294
311
295
312
AOI=$(cat $AOI| sed 's/,/./g')
296
-
OGR=0
297
313
fi
298
-
# if aoi is not a file, it's a point, polygon or tile list as cmd line input
299
314
else
315
+
# if aoi is not a file, it's a point, polygon or tile list as cmd line input
300
316
AOI=$(echo $AOI| sed 's/,/ /g')
301
-
OGR=0
302
317
fi
303
318
304
-
if [ $OGR-eq 0 ];then
319
+
if [ -z$AOITYPE ];then
305
320
# check if AOI input contains bounding box coordinates
306
321
if$(echo $AOI| grep -q "/");then
307
322
AOITYPE=2
@@ -382,36 +397,58 @@ get_data() {
382
397
printf"%s\n""""WARNING: The selected time window exceeds the last update of the $PRINTNAME metadata catalogue.""Results may be incomplete, please consider updating the metadata catalogue using the -u option."
383
398
fi
384
399
385
-
# AOI is shapefile, get tiles/footprints from WFS server
386
-
if [ "$AOITYPE"-eq 1 ];then
387
-
printf"%s\n""""Searching for footprints / tiles intersecting with geometries of AOI shapefile..."
400
+
if [ "$AOITYPE"-eq 1 ] || [ "$AOITYPE"-eq 2 ];then
401
+
402
+
# check if tiles / footprints shapefile is in metadata directory
printf"%s\n""""Error: $FILE not found""Shapefile for $PRINTNAME missing or incomplete.""Use the -u option to download the shapefile specifying $PRINTNAME tiles / footprints and update the metadata catalogue."""
0 commit comments