R scripts
To reproduce full color plots and images used in various exercises in the book, please obtain these original scripts and adjust where needed. Avoid copying the code from the PDF file of the book. Note that the R code might not run on your machine, which could be due to various reasons. Most importantly, the examples in this book refer to the MS Windows operating systems mainly. There can be quite some difference between MS Windows, Linux and Mac OS X, although the same functionality should be available on both MS Windows and Linux machines. SAGA GIS is not available for Mac OS X, hence you will need to use a PC with a dual boot system to follow these exercises.
Daily Global Weather Measurements
Short title:
get GSOD data
Purpose and use:
Import, formating and binding of the Daily Global Weather Measurements, 1929-2009 (NCDC, GSOD)
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Description of files available via the NCDC website . This is an extensive dataset and requires substantial storage and processing capacities - each station is saved in a separate directory and needs to be processed separately. The attached example shows temperature and precipitation measurements for 1st of May 2006.
Download MODIS images
Short title:
MODIS_download_HR
Purpose and use:
Download and resampling of MODIS LST images for Croatia;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
First steps (meuse)
Purpose and use:
demonstration of geostatistical tools (first steps in): gstat, geoR, SAGA GIS;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Geomorphological units (fishcamp)
Purpose and use:
Pre-processing of elevation data, extraction of landform units and predictive mapping of soil mapping units;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Heavy metal concentrations (NGS)
Purpose and use:
Spatial prediction of heavy metal concentrations using the National Geochemical Survey dataset;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Attachment | Size |
NGS.R | 26.24 KB |
Land surface temperature (HRtemp)
Purpose and use:
Interpolation of temperatures using spatio-temporal regression-kriging (MODIS LST images as predictors);
Status of work:
Tested on a MS Windows machine only
HRtemp.R
Modelling population change (jablpchinja)
Purpose and use:
Modelling population dynamics as a function of environmental factors in the south Serbia (Jablanica/Pchinja district)
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
inputs: admin_poly.shp - administrative boundaries for Jablanica/Pchinja district; populated_poly.shp - polygon map showing populated areas; environmental gridded maps dist1.asc - distance to main roads, dist2.asc - distance to secondary roads, srtm_dem.tif - SRTM DEM (100 m), evi_2002.tif - MODIS EVI index for year 2002 (summer); igbp_2002.tif - MODIS (MCD12Q1) estimated Land Cover Type 1 (IGBP)
outputs: predicted population dynamics;
Soil Organic Carbon (WISE_SOC)
Purpose and use:
Estimation of the global soil organic carbon stock using the ISRIC WISE soil profile data;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
The maps presented in this exercise were created for demonstration purposes only. The true accuracy/consistency of these maps has not been evaluated and is heavily controlled by the representativeness of the sampling pattern and accuracy of individual measurements (refer to the ISRIC WISE general disclaimer ). To run this script, you first need to register and obtain the MS Access file from the ISRIC website. Note that this is a relatively large data set and computations can become time-consuming. It is not recommended to run this exercise using a PC without at least 4 GB of RAM and at least 5 GB of hard disk memory.
Spatial prediction of rainfall
Short title:
rainfall_mapping
Purpose and use:
Rainfall mapping (from rain gauge data) exercises
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Spatial predictors
Short title:
spatial_predictors
Purpose and use:
Comparison of spatial predictors implemented in gstat
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Species’ occurrence records (bei)
Purpose and use:
Species distribution modelling - some theorerical considerations with examples;
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Attachment | Size |
bei.R | 20.56 KB |
Stream networks (baranjahill)
Purpose and use:
Extraction of stream networks from a DEM using error propagation
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
getStaticGoogleMaps
Short title:
getStaticGoogleMaps
Purpose and use:
Download of static Google Maps and import to a GIS
Programming environment:
R / S language
Status of work:
Tested on a MS Windows machine only
Links:
[1] http://spatial-analyst.net/book/node/389
[2] http://spatial-analyst.net/book/system/files/GSOD20080501.zip
[3] http://spatial-analyst.net/book/system/files/getGSOD.R
[4] http://www7.ncdc.noaa.gov/CDO/GSOD_DESC.txt
[5] http://spatial-analyst.net/book/node/439
[6] http://spatial-analyst.net/book/system/files/MODIS_download_HR.R
[7] http://spatial-analyst.net/book/system/files/meuse.R
[8] http://spatial-analyst.net/book/system/files/fishcamp.R
[9] http://spatial-analyst.net/book/system/files/NGS.R
[10] http://spatial-analyst.net/book/system/files/HRtemp2008.R
[11] http://spatial-analyst.net/book/system/files/HRtemp.R
[12] http://spatial-analyst.net/book/node/456
[13] http://spatial-analyst.net/book/system/files/jablpchinja.R
[14] http://spatial-analyst.net/book/system/files/WISE_SOC_0.R
[15] http://www.isric.org/isric/webdocs/Docs/ISRIC_Report_2008_02.pdf
[16] http://www.isric.org/isric/CheckRegistration.aspx?dataset=9
[17] http://spatial-analyst.net/book/node/460
[18] http://spatial-analyst.net/book/system/files/rainfall_mapping.R
[19] http://spatial-analyst.net/book/system/files/spatial_predictors.R
[20] http://spatial-analyst.net/book/node/165
[21] http://spatial-analyst.net/book/system/files/bei.R
[22] http://spatial-analyst.net/book/node/163
[23] http://spatial-analyst.net/book/system/files/baranjahill.R
[24] http://spatial-analyst.net/book/system/files/getStaticGoogleMaps.R