Skip to content

Commit 28df5ea

Browse files
adding landsat exmaple
1 parent c5aee2d commit 28df5ea

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

example/landsat.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 Landsat landcover
23+
# from the MERIT-Hydro 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+
34+
# implement subsetting and zonal statistics
35+
./extract-gis.sh --dataset="landsat" \
36+
--dataset-dir="/project/rpp-kshook/Model_Output/Landsat/" \
37+
--variable="NA_NALCMS_2010_v2_land_cover_30m" \
38+
--shape-file="$(pwd)/cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.shp" \
39+
--print-geotiff=true \
40+
--output-dir="$HOME/scratch/landsat-test/" \
41+
--prefix="landsat_test_" \
42+
--stat="majority,minority,frac" \
43+
44+
-j;
45+

0 commit comments

Comments
 (0)