Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################# | |
# title : Perform a Mann-Kendall trend test of satellite image time series | |
# purpose : Mann-Kendall test of monotonic trend and associated statistical significance | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Raster stack/brick comprising a time series of observations | |
# output : Raster object of monotoic trend (Kendall's tau), significance or both (i.e. brick) | |
# data : Test data: https://1drv.ms/u/s!AsHsKb_qtbkwg4ti8pJCxvUer9rMqg?e=BGcH1K | |
# notes : Depending on the time series, it is might be useful prewhiten the data to remove serial correlation | |
# : prior to extracting the trend. See blog post on www.hakimabdi.com for more information. | |
############################################################################################# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################################################################### | |
# title : Machine learning exercise for Sentinel-2 data | |
# purpose : Implementing a machine learning workflow in R | |
# author : Abdulhakim M. Abdi (Twitter: @HakimAbdi / www.hakimabdi.com) | |
# input : A multi-temporal raster stack of Sentinel-2 data comprising scenes from four dates | |
# output : One classified land cover map from each of three machine learning algorithms | |
# Note 1 : This brief tutorial assumes that you are already well-grounded in R concepts and are | |
# : familiar with image classification procedure and terminology | |
# Reference : Please cite Abdi (2020): "Land cover and land use classification performance of machine learning | |
# : algorithms in a boreal landscape using Sentinel-2 data" in GIScience & Remote Sensing if you find this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# title : mosaicGTiffs.R | |
# purpose : Takes in projected GeoTIFF outputs from projHDF2GTiff or | |
# : other GeoTIFFS and mosaics them into on larger file | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Individual GeoTIFF files | |
# output : A mosaicked GeoTIFF file with a larger extent | |
############################################################################## | |
mosaicGTiffs = function(proj.loc, gtiffs, mosaicName, overwrite){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# title : projHDF2GTiff.R | |
# purpose : Converts desired HDF layer to a GeoTIFF and projects it | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : HDF-EOS files | |
# output : Projected GeoTIFF files | |
############################################################################## | |
projHDF2GTiff = function(loc, hdfs, gtiffs, lyr, fromSRS, toSRS){ | |
if("gdalUtils" %in% rownames(installed.packages()) == FALSE){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################# | |
# title : Gridded Correlation of Time Series Raster Data (Gridcorts) | |
# purpose : Pixelwise time series correlation and significance based on Pearson's r, | |
# : Spearman's rho or Kendall's tau | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Raster brick comprising two time series of equal number of layers | |
# output : Raster object of pixelwise correlation, significance or both (i.e. brick) | |
# : based on the chosen method | |
# update : Minor based suggestion from Tao Xiong of Northeast Normal University in China. | |
# data : Test data: https://1drv.ms/u/s!AsHsKb_qtbkwgvoQuHnPaFazPr_XnA?e=fJ9fue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################# | |
# title : pload.R | |
# purpose : Install and load uninstalled packages, or load installed ones. | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Package name in quotes | |
# output : Installation and loading of uninstalled packages, or loading of installed ones. | |
################################################################################################# | |
pload <- function(x){ | |
if(x %in% rownames(installed.packages())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################### | |
# title : ManhattanLST.R | |
# purpose : Converts Landsat ETM+ thermal imagery to degrees Celsius | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Landsat TM / ETM+ band 6 | |
# output : Land surface temperature map in degrees Celsius | |
######################################################################################### | |
# Install and load the required packages | |
install.packages(c("rgdal" "sp", "raster"), repos='http://cran.r-project.org') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################### | |
# This code ingests binary GIMMS FAPAR and LAI data and converts them to GeoTIFFs. | |
# The data was produced by the Climate and Vegetation Research Group of Boston University. | |
# The GIMMS data are available from: http://cliveg.bu.edu/modismisr/lai3g-fpar3g.html | |
# title : GIMMS3g_LAI_FPAR_Binary2Geotiff.r | |
# purpose : Converts binary GIMMS FAPAR/LAI to GeoTIFFs | |
# author : Abdulhakim Abdi (@HakimAbdi) | |
# input : Binary 8-bit unsigned integer with ieee-be byte order | |
# output : Georeferenced TIFF, ArcGIS-ready files |