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
* creating dev branch
* parsing MERIT-Hydro extents
* modifications on MERIT-Hydro script and validating its output
* adding .gitignore and details
* adding stats extraction feature without testing
* adding renv setup and files
* debuggin and adding stats and quantiles capabilities
* finalizing merit-hydro
* finalizing merit-hydro stats and subsetting
* Changing GDAL versin from 3.0.4 to 3.4.1
The change is due to complete compatibility with all
the datasets included in this tool, mainly the MODIS
MCDQ12A (land cover) dataset that works best with
the 3.0.4 version.
* Adding the capability to subset and implement efficient zonal statistics
on SoilGridsV1 GeoTIFFs
The file reads the .tif files, geographically subsets the files based on
the given latitude and longitude extents, and prints given input
`--stats` in a .csv file.
The users are expected to enter complete variable names taken from the
GitHub repository README page for this specific datasets.
Reported by: Kasra Keshavarz
Signed-off-by: Kasra Keshavarz <kasra.keshavarz@usask.ca>
* Debugging problems with zonal statistics and adding log date for errors
The zonal statistics were migrated from merit-hydro scripts without
modifications, so necessary editions were implemented to conform to the
SoilGridsV1 dataset and its nomenclature.
The log date has been prepended to the program-generated errors and
warnings which is useful for future debuggings, etc.
Reported by: Kasra Keshavarz
Signed-off-by: Kasra Keshavarz <kasra.keshavarz@usask.ca>
* initial README.md file for SoilGrids dataset
* README file created for MODIS dataset
* missing logDate from previous commit added now
* Adding MODIS zonal statistics and GeoTIFF Subsetting feature
MODIS landcover provides valuable information for setting up
hydrological models and therefore it has been added to the repository.
The zonal statistics using `exactextractr` is very efficient and
produces `frac` of each land cover class. Apart from that, all other
statistics that are available to other datasets, could be used with this
dataset as well.
Reported by: Kasra Keshavarz
Signed-off-by: Kasra Keshavarz <kasra.keshavarz@usask.ca>
* removing debugging lines
* adding initial information for the main README page
* renaming for better clarity of the tool
* adding few options to take into account shapefiles that does not have a CRS defined
* renaming
* initial example and README files
* initial README file
* merit-hydro example initialized
* adding the job submission option to the example
* initial soil grids example added
* modis example initialized
* typos corrected
* fixing typos
* Added description of README file for future reference
* adding license header
* relevant info added to the README file
* typos and corrections
* adding no verbose option to wget download
* adding missing backslashes for line continuation
* adding quiet option to wget
* typos
* correcting wget options orders
* fixing job submission cache path typos
* adding full path to the shapefile argument
* necessary technical details of the MERIT-Hydro dataset
* typos, correction, and adding file contents of one .tar file as an example
* Added necessary technical information to the READMEs
* necessary extra info added
* correcting soil_grids directory address typo
* fixing typos
Copy file name to clipboardExpand all lines: README.md
+43-32Lines changed: 43 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,68 +1,79 @@
1
1
# Description
2
-
This repository contains scripts to process necessary GeoTIFF datasets. The general usage of the script (i.e., `./extract-geotiff.sh`) is as follows:
2
+
This repository contains scripts to process necessary geospatial datasets and implement efficient zonal statistics on given ESRI Shapefiles. The general usage of the script (i.e., `./extract-gis.sh`) is as follows:
3
3
4
4
```console
5
5
Usage:
6
-
extract-geotiff [options...]
6
+
extract-gis [options...]
7
7
8
8
Script options:
9
-
-d, --dataset GeoTIFF dataset of interest,
10
-
currently available options are:
11
-
'MODIS';'MERIT-Hydro';'SoilGridsV1';
12
-
'SoilGridsV2';
9
+
-d, --dataset Geospatial dataset of interest, currently
10
+
available options are: 'MODIS';
11
+
'MERIT-Hydro';'SoilGridsV1'
13
12
-i, --dataset-dir=DIR The source path of the dataset file(s)
13
+
-r, --crs=INT The EPSG code of interest; optional
14
+
[defaults to 4326]
14
15
-v, --variable=var1[,var2[...]] If applicable, variables to process
15
16
-o, --output-dir=DIR Writes processed files to DIR
16
-
-s, --start-date=DATE If applicable, start date of the GeoTIFF
17
+
-s, --start-date=DATE If applicable, start date of the geospatial
17
18
data; optional
18
-
-e, --end-date=DATE If applicable, end date of the GeoTIFF
19
+
-e, --end-date=DATE If applicable, end date of the geospatial
19
20
data; optional
20
21
-l, --lat-lims=REAL,REAL Latitude's upper and lower bounds; optional
21
22
-n, --lon-lims=REAL,REAL Longitude's upper and lower bounds; optional
22
-
-p, --shape-file=PATH Path to the ESRI '.shp' file; optional
23
+
-f, --shape-file=PATH Path to the ESRI '.shp' file; optional
23
24
-j, --submit-job Submit the data extraction process as a job
24
25
on the SLURM system; optional
25
-
-t, --stats=stat1[,stat2[...]] If applicable, extract the statistics of
26
+
-t, --print-geotiff=BOOL Extract the subsetted GeoTIFF file; optional
27
+
[defaults to 'true']
28
+
-a, --stat=stat1[,stat2[...]] If applicable, extract the statistics of
26
29
interest, currently available options are:
27
30
'min';'max';'mean';'majority';'minority';
28
-
'median';'quantiles';'variety';'variance';
31
+
'median';'quantile';'variety';'variance';
29
32
'stdev';'coefficient_of_variation';'frac';
33
+
optional
34
+
-q, --quantile=q1[,q2[...]] Quantiles of interest to be produced if 'quantile'
35
+
is included in the '--stat' argument. The values
36
+
must be comma delimited float numbers between
37
+
0 and 1; optional [defaults to every 5th quantile]
30
38
-p, --prefix=STR Prefix prepended to the output files
31
39
-c, --cache=DIR Path of the cache directory; optional
As an example, follow the code block below. Please remember that you MUST have access to Graham cluster with Compute Canada (CC) and have access to `MERIT-Hydro` dataset. Also, remember to generate a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with GitHub in advance. Enter the following codes in your Graham shell as a test case:
50
57
51
58
```console
52
-
foo@bar:~$ git clone https://github.com/kasra-keshavarz/geotifftool # clone the repository
53
-
foo@bar:~$ cd ./geotifftool/ # always move to the repository's directory
54
-
foo@bar:~$ ./extract-geotiff.sh -h # view the usage message
This directory contains two main files: 1) `renv.lock` containing necessary meta-data for the R `renv` package to set up the environment/libraries necessary for running the [`exactextractr`](https://github.com/isciences/exactextractr) package that implements zonal statistics and 2) `stats.R` that calls [`exactextractr`](https://github.com/isciences/exactextractr) package after the R environment has been fully set up.
0 commit comments