Skip to content

Iss19 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Script options:
|**1**|MODIS |2000 - 2021 | |10.5067/MODIS/MCD12Q1.006 |[link](modis) |
|**2**|MERIT Hydro |Not Applicable (N/A) |4326 |10.1029/2019WR024873 |[link](merit_hydro) |
|**3**|Soil Grids (v1) |Not Applicable (N/A) |4326 |10.1371/journal.pone.0169748 |[link](soil_grids) |
|**4**|Landsat NALCMS (2010, 30m) |Not Applicable (N/A) |4326 |10.3390/rs9111098 |[link](landsat) |
|**4**|Landsat NALCMS |2010 and 2015 |4326 |10.3390/rs9111098 |[link](landsat) |
|**5**|Global Depth to Bedrock |Not Applicable (N/A) | |10.1002/2016MS000686 |[link](depth_to_bedrock) |


Expand Down
18 changes: 16 additions & 2 deletions example/landsat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,29 @@ wget -m -nd -nv -q -A "cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.*" \
"http://hydrology.princeton.edu/data/mpan/MERIT_Basins/MERIT_Hydro_v07_Basins_v01_bugfix1/pfaf_level_02/";


# implement subsetting and zonal statistics
# Example 1: implement subsetting and zonal statistics on 2010 and 2015 landcover datasets
./extract-gis.sh --dataset="landsat" \
--dataset-dir="/project/rpp-kshook/Model_Output/Landsat/" \
--variable="NA_NALCMS_2010_v2_land_cover_30m" \
--variable="land-cover" \
--shape-file="$(pwd)/cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.shp" \
--print-geotiff=true \
--output-dir="$HOME/scratch/landsat-test/" \
--prefix="landsat_test_" \
--start-date=2010 \
--end-date=2015 \
--stat="majority,minority,frac" \
--email=your-email@company.ca \
-j;

# Example 2: implement zonal statistics for the 2010-2015 differences
# GeoTIFFs (see relevant landsat directory of this repository)
./extract-gis.sh --dataset="landsat" \
--dataset-dir="/project/rpp-kshook/Model_Output/Landsat/" \
--variable="land-cover-change" \
--shape-file="$(pwd)/cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.shp" \
--print-geotiff=false \
--output-dir="$HOME/scratch/landsat-test/" \
--prefix="landsat_test_" \
--stat="majority,minority,frac" \
--email=your-email@company.ca \
-j;
5 changes: 5 additions & 0 deletions extract-gis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ case "${geotiff,,}" in
call_processing_func "$(dirname $0)/landsat/landsat.sh"
;;

# soil_class
"soil_class" )
call_processing_func "$(dirname $0)/soil_class/soil_class.sh"
;;

# dataset not included above
*)
echo "$(basename $0): missing/unknown dataset";
Expand Down
65 changes: 57 additions & 8 deletions landsat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ And the structure of the files is as following:

```console
/project/rpp-kshook/Model_Output/Landsat/
├── NA_NALCMS_2010_v2_land_cover_30m.zip
├── .
├── .
└── .
├── land_change_2010v2_2015v2_30m_tif.zip
├── land_cover_2010v2_30m_tif.zip
├── land_cover_2015v2_30m_tif.zip
└── dl-landcover.sh
```

## Spatial and Temporal Extents

The spatial extent of this dataset (so far only `NALCMS` that is a land cover dataset) covers longitudes from approximately `-180` to `-50` degress and latitudes from approximately `+14` to `+84` degress. This dataset is static and does not vary with time.
The spatial extent of this dataset (so far only `NALCMS` that is a land cover dataset) covers longitudes from approximately `-180` to `-50` degress and latitudes from approximately `+14` to `+84` degress. This dataset is available for 2010 and 2015. Furthermore, one static dataset variable is also included demonstrating the gains and losses of various land covers between 2010 and 2015. Please see the list of variables for more information.

## Dataset Variables
This variables of this dataset are detailed in the table below:

|# |Variable Name (used in `gistool`) |Description |Comments |
|-------|---------------------------------------|---------------------------------------|---------------|
|1 |NA_NALCMS_2010_v2_land_cover_30m |Land cover classes |[link](http://www.cec.org/north-american-environmental-atlas/land-cover-2010-landsat-30m/)|
|# |Variable Name (used in `gistool`) |Description |Comments |
|-------|---------------------------------------|-----------------------------------------------|---------------|
|1 |land-cover |Land cover classes for 2010 and 2015 |[2010 dataset info](http://www.cec.org/north-american-environmental-atlas/land-cover-2010-landsat-30m/) and [2015 dataset info](http://www.cec.org/north-american-environmental-atlas/land-cover-30m-2015-landsat-and-rapideye/)|
|2 |land-cover-change |Land cover change (between 2010 and 2015) |[2010-2015 difference info](http://www.cec.org/north-american-environmental-atlas/land-cover-change-30m-2010-2015-landsat/)|


# Other relevant information
Expand Down Expand Up @@ -58,3 +59,51 @@ Below the land cover types for each values of the `.tif` files is detailed based

Also, the details of the above table has been included in the following files: [landsat_classes.csv](./landsat_classes.csv).

## Land Cover Changes between 2010 and 2015
The following file contains the following GeoTIFF data:
```console
/project/rpp-kshook/Model_Output/Landsat/land_change_2010v2_2015v2_30m_tif.zip
├── NA_NALCMS_2010v2_2015v2_30m_barren_land_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_cropland_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_forest_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_grassland_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_shrubland_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_snow_ice_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_urban_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_water_loss_and_gain.tif
├── NA_NALCMS_2010v2_2015v2_30m_wetland_loss_and_gain.tif
└── NA_NALCMS_land_change_2010v2_2015v2_30m.tif
```

Based on the metadata also available in the mentioned .zip file, the GeoTIFF data containing the `*_land_loss_and_gain.tif` phrase in their file name contain "[g]eneral land cover gains an losses [...] at the North American scale [...] for the following land cover class groups:"
```
1. Forest
2. Shrubland
3. Grassland
4. Wetland
5. Cropland
6. Barren Land
7. Urban and Built-up
8. Water
9. Snow and Ice
```

And, the pixel values of the mentioned `.tif` files are as following:

|# |Pixel Value |Value Description |
|-------|------------|------------------|
|1 |1 |Gain |
|2 |2 |Loss |

Furthermore, the GeoTIFF data named `NA_NALCMS_land_change_2010v2_2015v2_30m.tif` also contains the landcover change data. Each pixel value of the GeoTIFF file contains information regarding transformations between different landcover classes of the dataset at the North American scale. Each pixel values of the file contains three or four digits, with "[t]he first one or two digits in each pixel value show the land cover class in 2010, while the third and four digits show the land cover class in 2015." An example of digit values are given in the following:

```
105 = Class 1 to 5 "Temperate or sub-polar needleleaf forest" to "Temperate or sub-polar broadleaf deciduous forest"
206 = Class 2 to 6 "Sub-polar taiga needleleaf forest" to "Mixed forest"
814 = Class 8 to 14 "Temperate or sub-polar shrubland" to "Wetland"
915 = Class 9 to 15 "Tropical or sub-tropical grassland" to "Cropland"
1018 = Class 10 to 18 "Temperate or sub-polar grassland" to "Water"
1502 = Class 15 to 02 "Cropland" to "Sub-polar taiga needleleaf forest"
1716 = Class 17 to 16 "Urban and built-up" to "Barren land"
1913 = Class 19 to 01 "Snow and ice" to "Sub-polar or polar barren-lichen-moss"
```
Loading