|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Geospatial Dataset Processing Workflow |
| 4 | +# Copyright (C) 2022, University of Saskatchewan |
| 5 | +# |
| 6 | +# This file is part of the Geospatial Dataset Processing Workflow |
| 7 | +# |
| 8 | +# This program is free software: you can redistribute it and/or modify |
| 9 | +# it under the terms of the GNU General Public License as published by |
| 10 | +# the Free Software Foundation, either version 3 of the License, or |
| 11 | +# (at your option) any later version. |
| 12 | +# |
| 13 | +# This program is distributed in the hope that it will be useful, |
| 14 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +# GNU General Public License for more details. |
| 17 | +# |
| 18 | +# You should have received a copy of the GNU General Public License |
| 19 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | + |
| 21 | +# This is a simple example to extract common statistics for the |
| 22 | +# pfaf 71 - Saskatchewan-Nelson System Shapefiles of MERIT-Basins - |
| 23 | +# from the GSDE rasters. |
| 24 | + |
| 25 | +# Always call the script in the root directory of this repository |
| 26 | +cd .. |
| 27 | +echo "The current directory is: $(pwd)" |
| 28 | + |
| 29 | +# first download a sample shapefile - could be any shapefile |
| 30 | +wget -m -nd -nv -q -A "cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.*" \ |
| 31 | + "http://hydrology.princeton.edu/data/mpan/MERIT_Basins/MERIT_Hydro_v07_Basins_v01_bugfix1/pfaf_level_02/"; |
| 32 | + |
| 33 | +# implement subsetting and zonal statistics |
| 34 | +./extract-gis.sh --dataset="GSDE" \ |
| 35 | + --dataset-dir="/project/rpp-kshook/Model_Output/GSDE/download/gsde-30sec/" \ |
| 36 | + --variable="BD" \ |
| 37 | + --shape-file="$(pwd)/cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.shp" \ |
| 38 | + --print-geotiff=true \ |
| 39 | + --output-dir="$HOME/scratch/depth-to-bedrock-test/" \ |
| 40 | + --prefix="dtb_" \ |
| 41 | + --stat="mean,min,max" \ |
| 42 | + |
| 43 | + -j; |
| 44 | + |
0 commit comments