SlideShare une entreprise Scribd logo
1  sur  68
Télécharger pour lire hors ligne
Auxiliary maps for Digital Soil Mapping
FOSS software (R+SAGA+FWTools)
T. Hengl
Internationaal Bodemreferentie en Informatie Centrum - ISRIC
Wageningen UR
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Programme
9:00–10:15 Importance of auxiliary maps for DSM;
10:30–12:00 Overview of publicly available global data sets;
12:00–14:00 lunch break
14:00–15:15 Data exploration (exporting maps to KML)
Software installation and customization.
Opening and processing worldmaps using R+SAGA/FWTools.
Exercises.
15:30–17:00 Preparing auxiliary maps for continental-scale
DSM project;
Optional: preparation of worldmaps and metadata for your
own case study;
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Literature
Bivand, R., Pebesma, E., Rubio, V., 2008. Applied Spatial
Data Analysis with R. Use R Series, Springer, Heidelberg, 378
p.
Conrad, O., 2007. SAGA — Entwurf, Funktionsumfang und
Anwendung eines Systems f¨ur Automatisierte
Geowissenschaftliche Analysen. PhD thesis, University of
G¨ottingen.
Hengl, T., 2009. A Practical Guide to Geostatistical Mapping,
2nd edition. University of Amsterdam, 291 p. ISBN
978-90-9024981-0.
McBratney, A. B., Santos, M. L. M., Minasny, B., 2003. On
digital soil mapping. Geoderma, 117(1–2): 3–52.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
The ASDA(R)-book.org
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
The ASDA(R) team
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
A Practical Guide to Geostatistical Mapping
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
DSM: the main steps (analysis)
1. Import and organize soil lab data (site/horizon).
2. Filter gross errors (outliers), harmonize data coming from
various sources.
3. Fit splines to parameterize soil-depth relationships.
4. Prepare auxiliary maps (grid definition, projection system,
data format, . . .).
5. Generate spatial predictions (predictive mapping) and assess
accuracy.
6. Prepare and distribute final maps (with metadata) and reports.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Objectives
Where to obtain auxiliary environmental maps for DSM?
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Objectives
Where to obtain auxiliary environmental maps for DSM?
Where to obtain and how to use the R+OSGeo software?
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Objectives
Where to obtain auxiliary environmental maps for DSM?
Where to obtain and how to use the R+OSGeo software?
How to combine GIS and DSM operations?
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Objectives
Where to obtain auxiliary environmental maps for DSM?
Where to obtain and how to use the R+OSGeo software?
How to combine GIS and DSM operations?
How to visualize maps using Google Earth/Maps?
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
The main input to DSM is a map; the main output is a map;
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
The main input to DSM is a map; the main output is a map;
There are three main types of auxiliary maps:
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
The main input to DSM is a map; the main output is a map;
There are three main types of auxiliary maps:
1. DEM-derivatives (morphometric, hydrological, climatic, . . .)
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
The main input to DSM is a map; the main output is a map;
There are three main types of auxiliary maps:
1. DEM-derivatives (morphometric, hydrological, climatic, . . .)
2. Remote sensing images (thermal images, radar images, gamma
radiometrics, vegetation indices, . . .)
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Definitions
Digital Soil Mapping: Analytical production of soil property
and soil type maps using quantitative techniques, ground
records (soil profiles), auxiliary maps (covariates) and expert
knowledge.
The main input to DSM is a map; the main output is a map;
There are three main types of auxiliary maps:
1. DEM-derivatives (morphometric, hydrological, climatic, . . .)
2. Remote sensing images (thermal images, radar images, gamma
radiometrics, vegetation indices, . . .)
3. Thematic maps (geological strata, geomorphological units, . . .)
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Auxiliary maps
Auxiliary maps (environmental predictors or covariates) are
equally important input to DSM as the point data.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Auxiliary maps
Auxiliary maps (environmental predictors or covariates) are
equally important input to DSM as the point data.
If we are lucky, we will be able to explain distribution of soil
properties by using a small sample of species
occurrence/attributes.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Auxiliary maps
Auxiliary maps (environmental predictors or covariates) are
equally important input to DSM as the point data.
If we are lucky, we will be able to explain distribution of soil
properties by using a small sample of species
occurrence/attributes.
Environmental data can come in different resolutions (support
size), accuracy, coverage, formats etc.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Auxiliary maps
Auxiliary maps (environmental predictors or covariates) are
equally important input to DSM as the point data.
If we are lucky, we will be able to explain distribution of soil
properties by using a small sample of species
occurrence/attributes.
Environmental data can come in different resolutions (support
size), accuracy, coverage, formats etc.
The publicly available global data sets are in general
under-used.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Auxiliary maps
Auxiliary maps (environmental predictors or covariates) are
equally important input to DSM as the point data.
If we are lucky, we will be able to explain distribution of soil
properties by using a small sample of species
occurrence/attributes.
Environmental data can come in different resolutions (support
size), accuracy, coverage, formats etc.
The publicly available global data sets are in general
under-used.
. . . for various reasons (unpopular formats, missing metadata,
significant processing required to put it to a usable format
etc.).
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Universal model of spatial variation
In statistical terms, spatial variability of some soil variable Z
consists of three components:
Z(s) = Z∗
(s) + ε (s) + ε (1)
where Z∗(s) is the deterministic component, ε (s) is the spatially
correlated random component and ε is the pure noise — partially
micro-scale variation, partially the measurement error. This model
is, in the literature, often referred to as the universal model of
variation
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
SCORPAN
A well accepted formulation of the soil–environment correlation
model is the so-called SCORPAN model McBratney at al. (2003),
which is based on the general soil–vegetation formulation:
V × S[x, y,˜t] = f
s[x, y,˜t] c[x, y,˜t] o[x, y,˜t]
r[x, y,˜t] p[x, y,˜t] a[x, y,˜t]
(2)
where V stands for vegetation, S for soil, c stands for climate, o
for organisms (including humans), r is relief, p is parent material
or geology, a is age of the system, x, y are the coordinates and t is
time dimension.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Global repository of publicly available maps
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
worldmaps
I’ve been collecting and sorting/processing various publicly
available data sets over the years (at 1–5 km resolution, there
is a lot of free data!).
The result is a repository with cca 100 unique rasters, that
can be obtained directly from
http://spatial-analyst.net/worldmaps/.
Each gridded map consists of 7200 columns and 3600 rows;
the cell size is 0.05 arcdegrees, which corresponds to about
5.6 km; all maps fall on the same grid.
Maps are projected in the Latitude-Longitude WGS84 system
+proj=longlat +ellps=WGS84.
These maps are ideal for various mapping applications at
continental and national levels.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
The happy triangle guy
GIS analysis
Storage and
browsing of
geo-data
Statistical
computing
KML
GDAL
ground
overlays,
time-series
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Software we will use
R v2.11 (Windows OS) including a list of packages;
Tinn-R v2.3 (code editor);
Optional: FWTools v2.4.7 — a list of utilities to handle
spatial data; SAGA GIS v2.0.4 — a light GIS excellent for
educational purposes.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Installing the add-on packages
> install.packages("ctv")
> library(ctv)
> install.views("Spatial")
This will install all connected packages listed at R views Spatial.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Check your installation
> Sys.getenv(c("OS", "COMPUTERNAME", "R_HOME", "R_LIBS_USER",
+ "PROCESSOR_IDENTIFIER"))
OS
"Windows_NT"
COMPUTERNAME
"PC-IBED193"
R_HOME
"C:PROGRA~1RR-210~1.1"
R_LIBS_USER
"n:/R/win-library/2.10"
PROCESSOR_IDENTIFIER
"x86 Family 6 Model 15 Stepping 6, GenuineIntel"
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Tinn-R
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Customizing link between R and Tinn-R:
1. Open Tinn-R select“Options”→“R”→ Path and check that
the path is correct;
2. Tinn-R requires R to run either Rterm or Rgui in SDI mode:
In Rgui, select“Edit”→“GUI preferences”and set SDI and
click on Save.
3. To add the CRTL+R shortcut to Tinn-R:
First open“Options”→“Shortcuts”and replace the existing
CRTL+R shortcut to e.g.CRTL+M;
Then, open“R”menu and select“Hotkeys”; add a CRTL+R
shortcut to“Send line”;
To send blocks of text you will need to edit your Rprofile.site
file under“R/etc/”directory;
4. To learn more about how to customize Tinn-R, read the
user_guide.html file under the
“Tinn-R/doc/English/user guide/”directory.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Spatial objects
An advantage of R (as compared to e.g.Matlab) is that you can
create your own formats and structures for data. But if there are
too many formats you can easily get lots. In addition, we want to
have smooth links to external formats (R is open!).
To reduce this problem, Bivand et al.(2008) developed new-style
classes to represent spatial data.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Spatial class
The foundation object is the Spatial class, with just two basic slots
(new-style S classes have pre-defined components called slots):
a bounding box — mostly used for setting up plots;
a CRS class object — defining the coordinate reference
system, and may be set to CRS(as.character(NA));
Operations on Spatial* objects should update or copy these
values to the new Spatial* objects being created. The most basic
spatial data object is a point, which may have 2 or 3 dimensions.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Spatial classes
for point features: SpatialPoints;
SpatialPointsDataFrame;
for line features: SpatialLines, SpatialLinesDataFrame;
polygons: SpatialPolygons, SpatialPolygonsDataFrame;
rasters: SpatialPixels, SpatialPixelsDataFrame,
SpatialGrid, SpatialGridDataFrame;
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
SpatialPoints
> library(sp)
> data(meuse)
> coords <- SpatialPoints(meuse[, c("x", "y")])
> summary(coords)
Object of class SpatialPoints
Coordinates:
min max
x 178605 181390
y 329714 333611
Is projected: NA
proj4string : [NA]
Number of points: 155
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
SpatialPointsDataFrame
We can add the tabular data to make a
SpatialPointsDataFrame object:
> meuse1 <- SpatialPointsDataFrame(coords, meuse)
> str(meuse1, max.level = 2)
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
..@ data :'data.frame': 155 obs. of 14 variables:
..@ coords.nrs : num(0)
..@ coords : num [1:155, 1:2] 181072 181025 181165 ...
.. ..- attr(*, "dimnames")=List of 2
..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611
.. ..- attr(*, "dimnames")=List of 2
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Basic methods
spplot — plotting of spatial objects (maps);
spsample — sample points from a set of polygons, on a set
of lines or from a gridded area;
bbox — get the bounding box;
proj4string — get or set the projection (coordinate
reference system);
coordinates — set or retrieve coordinates;
spTransform — transform coordinates from one CRS to
another (PROJ.4);
overlay — combine two different spatial objects;
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Plotting a SpatialPoints object
> plot(as(meuse1, "Spatial"), axes = TRUE)
> plot(meuse1, add = TRUE)
> plot(meuse1[meuse1$ffreq == 1, ], col = "green", add = TRUE)
178000 179000 180000 181000 182000
330000331000332000333000
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Combining statistical and GIS operations
Because the Spatial*DataFrame family objects behave in
most cases like data frames, most of what we are used to
doing with standard data frames just works (but no merge,
etc., yet).
These objects are very similar to typical representations of the
same kinds of objects in geographical information systems, so
they do not suit spatial data that is not geographical (like
medical imaging) as such.
Because now sp classes for GIS data exits, this opens the door
for fusing GIS and statistical operations (this has not been
possible in e.g.2002).
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Spatial packages
R now offers a range of contributed packages in spatial statistics
and increasing awareness of the importance of spatial data analysis
in the broader community. Current contributed packages with
spatial applications:
point patterns: spatstat, VR:spatial, splancs;
geostatistics: gstat, geoR, geoRglm, fields, spBayes,
RandomFields, VR:spatial, sgeostat, vardiag;
lattice/area data: spdep, DCluster, spgwr, ade4;
links to GIS: rgdal, spgrass, RPy, RSAGA;
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Let’s create spatial objects!
We can create spatial objects from scratch! For example a DEM:
> dem <- expand.grid(x = seq(100, 600, 100), y = seq(100,
+ 600, 100))
> dem$Z <- as.vector(c(23, 24, 34, 38, 45, 51, 24, 20,
+ 20, 28, 18, 49, 22, 20, 19, 14, 38, 45, 19, 15, 13,
+ 21, 23, 25, 14, 11, 18, 11, 18, 19, 10, 16, 23, 16,
+ 9, 6))
> gridded(dem) <- ~x + y
> dem <- as(dem, "SpatialGridDataFrame")
> str(dem)
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Controlling SAGA from R
> library(RSAGA)
> rsaga.env()
$workspace
[1] "."
$cmd
[1] "saga_cmd.exe"
$path
[1] "C:/PROGRA~1/R/R-210~1.1/library/RSAGA/saga_vc"
$modules
[1] "C:/PROGRA~1/R/R-210~1.1/library/RSAGA/saga_vc/modules"
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Getting list of modules
> rsaga.get.modules("ta_channels")
$ta_channels
code name interactive
1 0 Channel Network FALSE
2 1 Watershed Basins FALSE
3 2 Watershed Basins (extended) FALSE
4 3 Vertical Distance to Channel Network FALSE
5 4 Overland Flow Distance to Channel Network FALSE
6 5 D8 Flow Analysis FALSE
7 6 Strahler Order FALSE
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Run stream extraction
> rsaga.geoprocessor(lib = "ta_channels", module = 5,
+ param = list(DEM = "dem6.sgrd",
+ DIRECTION = "channels.sgrd", CONNECTION = "route.sgrd",
+ NETWORK = "channels.shp"))
SAGA CMD 2.0.4
library path: C:/PROGRA~1/R/R-210~1.1/library/RSAGA/...
library name: ta_channels
module name : D8 Flow Analysis
author : (c) 2003 by O.Conrad
Load grid: dem6.sgrd...
ready
Parameters
Grid system: 100; 6x 6y; 100x 100y
DEM: dem6
Flow Direction: Flow Direction
Flow Connectivity: Flow Connectivity
Flow Network: Flow Network
Minimum Connectivity: 0
...
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Read back to R
> dem$route <- readGDAL("route.sdat")$band1
route.sdat has GDAL driver SAGA
and has 6 rows and 6 columns
> channels <- readOGR("channels.shp", "channels")
OGR data source with driver: ESRI Shapefile
Source: "channels.shp", layer: "channels"
with 32 features and 2 fields
Feature type: wkbLineString with 2 dimensions
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Plot the final result
> dem.plt <- spplot(dem[1], main = "DEM", col.regions = topo.colors(25))
> channels.plt <- spplot(dem[2], col.regions = rev(gray(0:20/20)),
+ main = "Flow connectivity", sp.layout = list("sp.lines",
+ channels, col = "red"))
> print(dem.plt, split = c(1, 1, 2, 1), more = T)
> print(channels.plt, split = c(2, 1, 2, 1), more = F)
DEM
10
20
30
40
50
Flow connectivity
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 1
Create a working directory called NL, then download the
makeRDC.R script.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 1
Create a working directory called NL, then download the
makeRDC.R script.
Open new session in R and run the script from Tinn-R.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 1
Create a working directory called NL, then download the
makeRDC.R script.
Open new session in R and run the script from Tinn-R.
This will download a land cover map of NL and resample it to
the Dutch coordinate system.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
FWTools
Created and maintained by Frank Warmerdam (director and
active contributor to OSGeo).
includes OpenEV, GDAL, MapServer, PROJ.4 and OGDI.
“it is intended to give folks a chance to use the latest and
greatest”.
FWTools contain a number of (highly efficient!!) utilities
excellent for processing large datasets.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Preparing FWTools
There is still no package to control FWTools from R, but we can
simply send command lines using the system command.
Before we can use FWTools from R, we need to locate it on our
PC:
> gdalwarp <- gsub("/", "", dir(path="C:/PROGRA~2/FWTOOL~1.7",
+ pattern="gdalwarp.exe", recursive=TRUE, full.names=TRUE))
> gdalwarp
[1] "C:PROGRA~2FWTOOL~1.7bingdalwarp.exe"
> workd <- paste(gsub("/", "", getwd()), "", sep="")
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
MODIS data
Now we can download some GIS data from web:
> MOD12Q1 <- "ftp://anonymous:test@e4ftl01u.ecs.nasa.gov/
+ MOLT/MOD12Q1.004/2004.01.01/"
> download.file(paste(MOD12Q1,
+ "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf", sep=""),
+ destfile=paste(getwd(),
+ "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf", sep="/"),
+ mode='wb', method='wget')
Resolving e4ftl01u.ecs.nasa.gov... 152.61.4.83
Connecting to e4ftl01u.ecs.nasa.gov|152.61.4.83|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /MOLT/MOD12Q1.004/2004.01.01 ... done.
==> SIZE MOD12Q1.A2004001.h18v03.004.2006117173748.hdf ... 23165983
==> PASV ... done. ==> RETR MOD12Q1.A2004... done.
Length: 23165983 (22M)
0K .......... .......... 0% 64.9K 5m48s
...
22550K .......... .......... 99% 501K 0s
22600K .......... 100% 503K=65s
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Reprojecting grids
We can reproject/resample the map to our local coordinate system
using the gdalwarp functionality (this combines several processing
steps in one function):
> NL.prj <- "+proj=sterea +lat_0=52.15616055555555
+ +lon_0=5.38763888888889 +k=0.999908 +x_0=155000
+ +y_0=463000 +ellps=bessel +units=m +no_defs
+ +towgs84=565.237,50.0087,465.658,
+ -0.406857,0.350733,-1.87035,4.0812"
> system(paste(gdalwarp, " HDF4_EOS:EOS_GRID:"", workd,
+ "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf"
+ :MOD12Q1:Land_Cover_Type_1 -t_srs "", NL.prj, ""
+ IGBP2004NL.tif -r near -te 0 300000 280000 625000
+ -tr 500 500", sep=""))
Creating output file that is 560P x 650L.
Processing input file HDF4_EOS:EOS_GRID:MOD12Q1.A2004001...
Using internal nodata values (eg. 255) for image HDF4_EOS:EOS_...
0...10...20...30...40...50...60...70...80...90...100 - done.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Plot the final result
In this case we have produced a MODIS-based land cover map for
the whole Netherlands in resolution of 500 m (in local coordinate
system).
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 2 & 3
Create a working directory called worldmaps, then download
a selection of worldmaps from the repository (or get a copy
from the USB stick) and unzip the maps that you need to
complete the exercises.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 2 & 3
Create a working directory called worldmaps, then download
a selection of worldmaps from the repository (or get a copy
from the USB stick) and unzip the maps that you need to
complete the exercises.
Use any GIS that you find suitable to answer the questions.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 2 & 3
Create a working directory called worldmaps, then download
a selection of worldmaps from the repository (or get a copy
from the USB stick) and unzip the maps that you need to
complete the exercises.
Use any GIS that you find suitable to answer the questions.
I recommend first testing SAGA GIS, then running the
analysis in R. These maps are Large so it could take time until
you import/open a map.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Exercise 4
We focus on extracting land surface parameters (or
geomorphometric parameters) using a DEM.
First create a new working directory on your computer, then
Download the map of world countries (countries) and the
global Digital Elevation Model at 5.6 km resolution
(globedem).
Resample and subset the DEMs to local coordinate systems
— for Germany use the European ETRS89 coordinate system
(EPSG:3035), and for Bolivia use the South America Albers
Equal Area Conic coordinate system (ESRI:102033).
Try also to derive these parameters using the RSAGA
package, i.e.by sending the commands to SAGA from R.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Outline
Introduction
Literature
DSM and env maps
Worldmaps
Software
R code editors
Working with spatial data
R+SAGA
Exercises
R+FWTools
Export to Google Earth
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
Writing spatial data to KML
There are two possibilities to export maps to KML: (a) using
existing packages, and (b) by writing KML files“by-hand”.
To export point or line features to KML, use the writeOGR
method that is available in R package rgdal.
More flexible way to writing KML files is by using loops.
Digital Soil Mapping training, Sept 3, 2010, JRC Ispra

Contenu connexe

Tendances

Dan Zeh Gis Portfolio
Dan Zeh Gis PortfolioDan Zeh Gis Portfolio
Dan Zeh Gis PortfolioDan Zeh
 
wasteland mapping
wasteland mappingwasteland mapping
wasteland mappingjosnarajp
 
Operational Remote sensing Applications
Operational Remote sensing ApplicationsOperational Remote sensing Applications
Operational Remote sensing ApplicationsTushar Dholakia
 
2. Technical introduction to the GSOC Map
2. Technical introduction to the GSOC Map2. Technical introduction to the GSOC Map
2. Technical introduction to the GSOC MapFAO
 
Introduction to DSM
Introduction to DSMIntroduction to DSM
Introduction to DSMFAO
 
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratney
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratneySoil mapping goes digital - the GlobalSoilMap experience by Alex. McBratney
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratneyFAO
 
Remote Sensing And GIS Application In Wetland Mapping
Remote Sensing And GIS Application In Wetland MappingRemote Sensing And GIS Application In Wetland Mapping
Remote Sensing And GIS Application In Wetland MappingSwetha A
 
IRJET- Classification of Agricultural Land’s Capability
IRJET-  	  Classification of Agricultural Land’s CapabilityIRJET-  	  Classification of Agricultural Land’s Capability
IRJET- Classification of Agricultural Land’s CapabilityIRJET Journal
 
Applications of Remote Sensing
Applications of Remote SensingApplications of Remote Sensing
Applications of Remote SensingAbhiram Kanigolla
 
Soil mapping , remote sensing and use of sensors in precision farming
Soil mapping , remote sensing and use of  sensors in precision farmingSoil mapping , remote sensing and use of  sensors in precision farming
Soil mapping , remote sensing and use of sensors in precision farmingDr. M. Kumaresan Hort.
 
Data preparation for Digital Soil Mapping
Data preparation for Digital Soil MappingData preparation for Digital Soil Mapping
Data preparation for Digital Soil MappingExternalEvents
 
Methods & types of soil survey
Methods & types of soil surveyMethods & types of soil survey
Methods & types of soil surveysethupathi siva
 
2 rangeland-suitability-evaluation(1)
2 rangeland-suitability-evaluation(1)2 rangeland-suitability-evaluation(1)
2 rangeland-suitability-evaluation(1)AderawTsegaye
 
7th euregeo volume_1 164_165
7th euregeo volume_1 164_1657th euregeo volume_1 164_165
7th euregeo volume_1 164_165Ricardo Brasil
 
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...ijsrd.com
 
5. Introduction to Digital Soil Mapping
5. Introduction to Digital Soil Mapping5. Introduction to Digital Soil Mapping
5. Introduction to Digital Soil MappingExternalEvents
 

Tendances (20)

Dan Zeh Gis Portfolio
Dan Zeh Gis PortfolioDan Zeh Gis Portfolio
Dan Zeh Gis Portfolio
 
wasteland mapping
wasteland mappingwasteland mapping
wasteland mapping
 
Wetland mapping
Wetland mappingWetland mapping
Wetland mapping
 
Operational Remote sensing Applications
Operational Remote sensing ApplicationsOperational Remote sensing Applications
Operational Remote sensing Applications
 
2. Technical introduction to the GSOC Map
2. Technical introduction to the GSOC Map2. Technical introduction to the GSOC Map
2. Technical introduction to the GSOC Map
 
Introduction to DSM
Introduction to DSMIntroduction to DSM
Introduction to DSM
 
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratney
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratneySoil mapping goes digital - the GlobalSoilMap experience by Alex. McBratney
Soil mapping goes digital - the GlobalSoilMap experience by Alex. McBratney
 
Nachtergaele Available soil databases Nov 10 2014
Nachtergaele Available soil databases Nov 10 2014Nachtergaele Available soil databases Nov 10 2014
Nachtergaele Available soil databases Nov 10 2014
 
Remote Sensing And GIS Application In Wetland Mapping
Remote Sensing And GIS Application In Wetland MappingRemote Sensing And GIS Application In Wetland Mapping
Remote Sensing And GIS Application In Wetland Mapping
 
IRJET- Classification of Agricultural Land’s Capability
IRJET-  	  Classification of Agricultural Land’s CapabilityIRJET-  	  Classification of Agricultural Land’s Capability
IRJET- Classification of Agricultural Land’s Capability
 
Applications of Remote Sensing
Applications of Remote SensingApplications of Remote Sensing
Applications of Remote Sensing
 
Soil mapping , remote sensing and use of sensors in precision farming
Soil mapping , remote sensing and use of  sensors in precision farmingSoil mapping , remote sensing and use of  sensors in precision farming
Soil mapping , remote sensing and use of sensors in precision farming
 
Data preparation for Digital Soil Mapping
Data preparation for Digital Soil MappingData preparation for Digital Soil Mapping
Data preparation for Digital Soil Mapping
 
Application of rs and gis
Application of rs and gisApplication of rs and gis
Application of rs and gis
 
Hawaii Pacific GIS Conference 2012: Water Resources - Online Rainfall Atlas o...
Hawaii Pacific GIS Conference 2012: Water Resources - Online Rainfall Atlas o...Hawaii Pacific GIS Conference 2012: Water Resources - Online Rainfall Atlas o...
Hawaii Pacific GIS Conference 2012: Water Resources - Online Rainfall Atlas o...
 
Methods & types of soil survey
Methods & types of soil surveyMethods & types of soil survey
Methods & types of soil survey
 
2 rangeland-suitability-evaluation(1)
2 rangeland-suitability-evaluation(1)2 rangeland-suitability-evaluation(1)
2 rangeland-suitability-evaluation(1)
 
7th euregeo volume_1 164_165
7th euregeo volume_1 164_1657th euregeo volume_1 164_165
7th euregeo volume_1 164_165
 
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...
Land Use Land Cover Change Detection of Gulbarga City Using Remote Sensing an...
 
5. Introduction to Digital Soil Mapping
5. Introduction to Digital Soil Mapping5. Introduction to Digital Soil Mapping
5. Introduction to Digital Soil Mapping
 

En vedette

Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil Partnership
Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil PartnershipReport on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil Partnership
Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil PartnershipFAO
 
Digital soil mapping
Digital soil mappingDigital soil mapping
Digital soil mappingCIAT
 
Digital Soil Mapping–Capacity Building Course- Introduction
Digital Soil Mapping–Capacity Building Course- IntroductionDigital Soil Mapping–Capacity Building Course- Introduction
Digital Soil Mapping–Capacity Building Course- IntroductionFAO
 
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...FAO
 
Status of global soil information, Adopting new technology and rebuilding ins...
Status of global soil information, Adopting new technology and rebuilding ins...Status of global soil information, Adopting new technology and rebuilding ins...
Status of global soil information, Adopting new technology and rebuilding ins...FAO
 
Digital Soil Mapping–Capacity Building Course- Lecture1
Digital Soil Mapping–Capacity Building Course- Lecture1Digital Soil Mapping–Capacity Building Course- Lecture1
Digital Soil Mapping–Capacity Building Course- Lecture1FAO
 
Review of Digital Soil Mapping steps
Review of Digital Soil Mapping stepsReview of Digital Soil Mapping steps
Review of Digital Soil Mapping stepsFAO
 
Digital Soil Mapping by Ronald Vargas Rojas
Digital Soil Mapping by Ronald Vargas RojasDigital Soil Mapping by Ronald Vargas Rojas
Digital Soil Mapping by Ronald Vargas RojasFAO
 

En vedette (9)

Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil Partnership
Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil PartnershipReport on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil Partnership
Report on the CENTRAL AMERICA, MEXICO AND THE CARIBBEAN Soil Partnership
 
Digital soil mapping
Digital soil mappingDigital soil mapping
Digital soil mapping
 
Digital Soil Mapping–Capacity Building Course- Introduction
Digital Soil Mapping–Capacity Building Course- IntroductionDigital Soil Mapping–Capacity Building Course- Introduction
Digital Soil Mapping–Capacity Building Course- Introduction
 
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...
Status of digiatal soil mapping in BSWM by Silvino Q. Tejada and Rodelio B. C...
 
Status of global soil information, Adopting new technology and rebuilding ins...
Status of global soil information, Adopting new technology and rebuilding ins...Status of global soil information, Adopting new technology and rebuilding ins...
Status of global soil information, Adopting new technology and rebuilding ins...
 
Digital Soil Mapping–Capacity Building Course- Lecture1
Digital Soil Mapping–Capacity Building Course- Lecture1Digital Soil Mapping–Capacity Building Course- Lecture1
Digital Soil Mapping–Capacity Building Course- Lecture1
 
SAGA GIS 2.0.7
SAGA GIS 2.0.7SAGA GIS 2.0.7
SAGA GIS 2.0.7
 
Review of Digital Soil Mapping steps
Review of Digital Soil Mapping stepsReview of Digital Soil Mapping steps
Review of Digital Soil Mapping steps
 
Digital Soil Mapping by Ronald Vargas Rojas
Digital Soil Mapping by Ronald Vargas RojasDigital Soil Mapping by Ronald Vargas Rojas
Digital Soil Mapping by Ronald Vargas Rojas
 

Similaire à DSM training - preparing auxiliary data

Building capacities for digital soil organic carbon mapping
Building capacities for digital soil organic carbon mappingBuilding capacities for digital soil organic carbon mapping
Building capacities for digital soil organic carbon mappingExternalEvents
 
Application of gis and gps in civil engineering
Application of gis and gps in civil engineeringApplication of gis and gps in civil engineering
Application of gis and gps in civil engineeringAvinash Anand
 
Digital Soil Mapping/ Pedomterics
Digital Soil Mapping/ Pedomterics Digital Soil Mapping/ Pedomterics
Digital Soil Mapping/ Pedomterics Soils FAO-GSP
 
Geographical information system and its application in horticulture
Geographical information system and its application in horticultureGeographical information system and its application in horticulture
Geographical information system and its application in horticultureAparna Veluru
 
revisedseminar-190807104447.pdf
revisedseminar-190807104447.pdfrevisedseminar-190807104447.pdf
revisedseminar-190807104447.pdfambika bhandari
 
3. Technical introduction to the Digital Soil Mapping
3. Technical introduction to the Digital Soil Mapping3. Technical introduction to the Digital Soil Mapping
3. Technical introduction to the Digital Soil MappingFAO
 
Fundamentals of gis
Fundamentals of gisFundamentals of gis
Fundamentals of gisJessy Mol
 
eMerges - Terra Cognita 2006 Workshop (ISWC)
eMerges - Terra Cognita 2006 Workshop (ISWC)eMerges - Terra Cognita 2006 Workshop (ISWC)
eMerges - Terra Cognita 2006 Workshop (ISWC)Vlad Tanasescu
 
Fundamentals of geo processing techniques
Fundamentals of geo processing techniquesFundamentals of geo processing techniques
Fundamentals of geo processing techniquesTejaReddy453140
 
Geo processing techniques and applications
Geo processing techniques and applicationsGeo processing techniques and applications
Geo processing techniques and applicationsTejaReddy453140
 
F:\Work\Gps &amp; Gis\Gps
F:\Work\Gps &amp; Gis\GpsF:\Work\Gps &amp; Gis\Gps
F:\Work\Gps &amp; Gis\Gpsguestf48f25
 
Gis Geographical Information System Fundamentals
Gis Geographical Information System FundamentalsGis Geographical Information System Fundamentals
Gis Geographical Information System FundamentalsUroosa Samman
 
GIS Lecture Note.ppt
GIS Lecture Note.pptGIS Lecture Note.ppt
GIS Lecture Note.pptwarkisafile1
 
Intern report final
Intern report finalIntern report final
Intern report finalFazlul wahid
 
Augmenting physical 3 d models with projected information to support environm...
Augmenting physical 3 d models with projected information to support environm...Augmenting physical 3 d models with projected information to support environm...
Augmenting physical 3 d models with projected information to support environm...José María
 
A quick overview of geospatial analysis
A quick overview of geospatial analysisA quick overview of geospatial analysis
A quick overview of geospatial analysisMd.Farhad Hossen
 

Similaire à DSM training - preparing auxiliary data (20)

Building capacities for digital soil organic carbon mapping
Building capacities for digital soil organic carbon mappingBuilding capacities for digital soil organic carbon mapping
Building capacities for digital soil organic carbon mapping
 
Lect 4
Lect 4Lect 4
Lect 4
 
Application of gis and gps in civil engineering
Application of gis and gps in civil engineeringApplication of gis and gps in civil engineering
Application of gis and gps in civil engineering
 
Digital Soil Mapping/ Pedomterics
Digital Soil Mapping/ Pedomterics Digital Soil Mapping/ Pedomterics
Digital Soil Mapping/ Pedomterics
 
Geographical information system and its application in horticulture
Geographical information system and its application in horticultureGeographical information system and its application in horticulture
Geographical information system and its application in horticulture
 
revisedseminar-190807104447.pdf
revisedseminar-190807104447.pdfrevisedseminar-190807104447.pdf
revisedseminar-190807104447.pdf
 
3. Technical introduction to the Digital Soil Mapping
3. Technical introduction to the Digital Soil Mapping3. Technical introduction to the Digital Soil Mapping
3. Technical introduction to the Digital Soil Mapping
 
Fundamentals of gis
Fundamentals of gisFundamentals of gis
Fundamentals of gis
 
eMerges - Terra Cognita 2006 Workshop (ISWC)
eMerges - Terra Cognita 2006 Workshop (ISWC)eMerges - Terra Cognita 2006 Workshop (ISWC)
eMerges - Terra Cognita 2006 Workshop (ISWC)
 
Fundamentals of geo processing techniques
Fundamentals of geo processing techniquesFundamentals of geo processing techniques
Fundamentals of geo processing techniques
 
Geo processing techniques and applications
Geo processing techniques and applicationsGeo processing techniques and applications
Geo processing techniques and applications
 
Chandan bhattacharya
Chandan bhattacharyaChandan bhattacharya
Chandan bhattacharya
 
F:\Work\Gps &amp; Gis\Gps
F:\Work\Gps &amp; Gis\GpsF:\Work\Gps &amp; Gis\Gps
F:\Work\Gps &amp; Gis\Gps
 
Gps
GpsGps
Gps
 
Gis Geographical Information System Fundamentals
Gis Geographical Information System FundamentalsGis Geographical Information System Fundamentals
Gis Geographical Information System Fundamentals
 
GIS
GISGIS
GIS
 
GIS Lecture Note.ppt
GIS Lecture Note.pptGIS Lecture Note.ppt
GIS Lecture Note.ppt
 
Intern report final
Intern report finalIntern report final
Intern report final
 
Augmenting physical 3 d models with projected information to support environm...
Augmenting physical 3 d models with projected information to support environm...Augmenting physical 3 d models with projected information to support environm...
Augmenting physical 3 d models with projected information to support environm...
 
A quick overview of geospatial analysis
A quick overview of geospatial analysisA quick overview of geospatial analysis
A quick overview of geospatial analysis
 

Plus de Tomislav Hengl

Poster "Global Soil Information Facilities"
Poster "Global Soil Information Facilities"Poster "Global Soil Information Facilities"
Poster "Global Soil Information Facilities"Tomislav Hengl
 
A statistical assessment of GDEM using LiDAR data
A statistical assessment of GDEM using LiDAR dataA statistical assessment of GDEM using LiDAR data
A statistical assessment of GDEM using LiDAR dataTomislav Hengl
 
Hengl & Reuter poster at Geomorphometry.org/2011
Hengl & Reuter poster at Geomorphometry.org/2011Hengl & Reuter poster at Geomorphometry.org/2011
Hengl & Reuter poster at Geomorphometry.org/2011Tomislav Hengl
 
Space-time data workshop at IfGI
Space-time data workshop at IfGISpace-time data workshop at IfGI
Space-time data workshop at IfGITomislav Hengl
 
Spatial interpolation comparison
Spatial interpolation comparisonSpatial interpolation comparison
Spatial interpolation comparisonTomislav Hengl
 

Plus de Tomislav Hengl (9)

Poster "Global Soil Information Facilities"
Poster "Global Soil Information Facilities"Poster "Global Soil Information Facilities"
Poster "Global Soil Information Facilities"
 
A statistical assessment of GDEM using LiDAR data
A statistical assessment of GDEM using LiDAR dataA statistical assessment of GDEM using LiDAR data
A statistical assessment of GDEM using LiDAR data
 
Hengl & Reuter poster at Geomorphometry.org/2011
Hengl & Reuter poster at Geomorphometry.org/2011Hengl & Reuter poster at Geomorphometry.org/2011
Hengl & Reuter poster at Geomorphometry.org/2011
 
GSIF utilities
GSIF utilitiesGSIF utilities
GSIF utilities
 
Drupal course hengl
Drupal course henglDrupal course hengl
Drupal course hengl
 
Space-time data workshop at IfGI
Space-time data workshop at IfGISpace-time data workshop at IfGI
Space-time data workshop at IfGI
 
Spatial interpolation comparison
Spatial interpolation comparisonSpatial interpolation comparison
Spatial interpolation comparison
 
R crash course
R crash courseR crash course
R crash course
 
Latex crash course
Latex crash courseLatex crash course
Latex crash course
 

Dernier

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Dernier (20)

Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

DSM training - preparing auxiliary data

  • 1. Auxiliary maps for Digital Soil Mapping FOSS software (R+SAGA+FWTools) T. Hengl Internationaal Bodemreferentie en Informatie Centrum - ISRIC Wageningen UR Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 2. Programme 9:00–10:15 Importance of auxiliary maps for DSM; 10:30–12:00 Overview of publicly available global data sets; 12:00–14:00 lunch break 14:00–15:15 Data exploration (exporting maps to KML) Software installation and customization. Opening and processing worldmaps using R+SAGA/FWTools. Exercises. 15:30–17:00 Preparing auxiliary maps for continental-scale DSM project; Optional: preparation of worldmaps and metadata for your own case study; Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 3. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 4. Literature Bivand, R., Pebesma, E., Rubio, V., 2008. Applied Spatial Data Analysis with R. Use R Series, Springer, Heidelberg, 378 p. Conrad, O., 2007. SAGA — Entwurf, Funktionsumfang und Anwendung eines Systems f¨ur Automatisierte Geowissenschaftliche Analysen. PhD thesis, University of G¨ottingen. Hengl, T., 2009. A Practical Guide to Geostatistical Mapping, 2nd edition. University of Amsterdam, 291 p. ISBN 978-90-9024981-0. McBratney, A. B., Santos, M. L. M., Minasny, B., 2003. On digital soil mapping. Geoderma, 117(1–2): 3–52. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 5. The ASDA(R)-book.org Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 6. The ASDA(R) team Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 7. A Practical Guide to Geostatistical Mapping Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 8. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 9. DSM: the main steps (analysis) 1. Import and organize soil lab data (site/horizon). 2. Filter gross errors (outliers), harmonize data coming from various sources. 3. Fit splines to parameterize soil-depth relationships. 4. Prepare auxiliary maps (grid definition, projection system, data format, . . .). 5. Generate spatial predictions (predictive mapping) and assess accuracy. 6. Prepare and distribute final maps (with metadata) and reports. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 10. Objectives Where to obtain auxiliary environmental maps for DSM? Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 11. Objectives Where to obtain auxiliary environmental maps for DSM? Where to obtain and how to use the R+OSGeo software? Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 12. Objectives Where to obtain auxiliary environmental maps for DSM? Where to obtain and how to use the R+OSGeo software? How to combine GIS and DSM operations? Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 13. Objectives Where to obtain auxiliary environmental maps for DSM? Where to obtain and how to use the R+OSGeo software? How to combine GIS and DSM operations? How to visualize maps using Google Earth/Maps? Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 14. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 15. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. The main input to DSM is a map; the main output is a map; Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 16. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. The main input to DSM is a map; the main output is a map; There are three main types of auxiliary maps: Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 17. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. The main input to DSM is a map; the main output is a map; There are three main types of auxiliary maps: 1. DEM-derivatives (morphometric, hydrological, climatic, . . .) Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 18. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. The main input to DSM is a map; the main output is a map; There are three main types of auxiliary maps: 1. DEM-derivatives (morphometric, hydrological, climatic, . . .) 2. Remote sensing images (thermal images, radar images, gamma radiometrics, vegetation indices, . . .) Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 19. Definitions Digital Soil Mapping: Analytical production of soil property and soil type maps using quantitative techniques, ground records (soil profiles), auxiliary maps (covariates) and expert knowledge. The main input to DSM is a map; the main output is a map; There are three main types of auxiliary maps: 1. DEM-derivatives (morphometric, hydrological, climatic, . . .) 2. Remote sensing images (thermal images, radar images, gamma radiometrics, vegetation indices, . . .) 3. Thematic maps (geological strata, geomorphological units, . . .) Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 20. Auxiliary maps Auxiliary maps (environmental predictors or covariates) are equally important input to DSM as the point data. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 21. Auxiliary maps Auxiliary maps (environmental predictors or covariates) are equally important input to DSM as the point data. If we are lucky, we will be able to explain distribution of soil properties by using a small sample of species occurrence/attributes. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 22. Auxiliary maps Auxiliary maps (environmental predictors or covariates) are equally important input to DSM as the point data. If we are lucky, we will be able to explain distribution of soil properties by using a small sample of species occurrence/attributes. Environmental data can come in different resolutions (support size), accuracy, coverage, formats etc. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 23. Auxiliary maps Auxiliary maps (environmental predictors or covariates) are equally important input to DSM as the point data. If we are lucky, we will be able to explain distribution of soil properties by using a small sample of species occurrence/attributes. Environmental data can come in different resolutions (support size), accuracy, coverage, formats etc. The publicly available global data sets are in general under-used. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 24. Auxiliary maps Auxiliary maps (environmental predictors or covariates) are equally important input to DSM as the point data. If we are lucky, we will be able to explain distribution of soil properties by using a small sample of species occurrence/attributes. Environmental data can come in different resolutions (support size), accuracy, coverage, formats etc. The publicly available global data sets are in general under-used. . . . for various reasons (unpopular formats, missing metadata, significant processing required to put it to a usable format etc.). Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 25. Universal model of spatial variation In statistical terms, spatial variability of some soil variable Z consists of three components: Z(s) = Z∗ (s) + ε (s) + ε (1) where Z∗(s) is the deterministic component, ε (s) is the spatially correlated random component and ε is the pure noise — partially micro-scale variation, partially the measurement error. This model is, in the literature, often referred to as the universal model of variation Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 26. SCORPAN A well accepted formulation of the soil–environment correlation model is the so-called SCORPAN model McBratney at al. (2003), which is based on the general soil–vegetation formulation: V × S[x, y,˜t] = f s[x, y,˜t] c[x, y,˜t] o[x, y,˜t] r[x, y,˜t] p[x, y,˜t] a[x, y,˜t] (2) where V stands for vegetation, S for soil, c stands for climate, o for organisms (including humans), r is relief, p is parent material or geology, a is age of the system, x, y are the coordinates and t is time dimension. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 27. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 28. Global repository of publicly available maps Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 29. worldmaps I’ve been collecting and sorting/processing various publicly available data sets over the years (at 1–5 km resolution, there is a lot of free data!). The result is a repository with cca 100 unique rasters, that can be obtained directly from http://spatial-analyst.net/worldmaps/. Each gridded map consists of 7200 columns and 3600 rows; the cell size is 0.05 arcdegrees, which corresponds to about 5.6 km; all maps fall on the same grid. Maps are projected in the Latitude-Longitude WGS84 system +proj=longlat +ellps=WGS84. These maps are ideal for various mapping applications at continental and national levels. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 30. The happy triangle guy GIS analysis Storage and browsing of geo-data Statistical computing KML GDAL ground overlays, time-series Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 31. Software we will use R v2.11 (Windows OS) including a list of packages; Tinn-R v2.3 (code editor); Optional: FWTools v2.4.7 — a list of utilities to handle spatial data; SAGA GIS v2.0.4 — a light GIS excellent for educational purposes. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 32. Installing the add-on packages > install.packages("ctv") > library(ctv) > install.views("Spatial") This will install all connected packages listed at R views Spatial. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 33. Check your installation > Sys.getenv(c("OS", "COMPUTERNAME", "R_HOME", "R_LIBS_USER", + "PROCESSOR_IDENTIFIER")) OS "Windows_NT" COMPUTERNAME "PC-IBED193" R_HOME "C:PROGRA~1RR-210~1.1" R_LIBS_USER "n:/R/win-library/2.10" PROCESSOR_IDENTIFIER "x86 Family 6 Model 15 Stepping 6, GenuineIntel" Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 34. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 35. Tinn-R Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 36. Customizing link between R and Tinn-R: 1. Open Tinn-R select“Options”→“R”→ Path and check that the path is correct; 2. Tinn-R requires R to run either Rterm or Rgui in SDI mode: In Rgui, select“Edit”→“GUI preferences”and set SDI and click on Save. 3. To add the CRTL+R shortcut to Tinn-R: First open“Options”→“Shortcuts”and replace the existing CRTL+R shortcut to e.g.CRTL+M; Then, open“R”menu and select“Hotkeys”; add a CRTL+R shortcut to“Send line”; To send blocks of text you will need to edit your Rprofile.site file under“R/etc/”directory; 4. To learn more about how to customize Tinn-R, read the user_guide.html file under the “Tinn-R/doc/English/user guide/”directory. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 37. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 38. Spatial objects An advantage of R (as compared to e.g.Matlab) is that you can create your own formats and structures for data. But if there are too many formats you can easily get lots. In addition, we want to have smooth links to external formats (R is open!). To reduce this problem, Bivand et al.(2008) developed new-style classes to represent spatial data. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 39. Spatial class The foundation object is the Spatial class, with just two basic slots (new-style S classes have pre-defined components called slots): a bounding box — mostly used for setting up plots; a CRS class object — defining the coordinate reference system, and may be set to CRS(as.character(NA)); Operations on Spatial* objects should update or copy these values to the new Spatial* objects being created. The most basic spatial data object is a point, which may have 2 or 3 dimensions. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 40. Spatial classes for point features: SpatialPoints; SpatialPointsDataFrame; for line features: SpatialLines, SpatialLinesDataFrame; polygons: SpatialPolygons, SpatialPolygonsDataFrame; rasters: SpatialPixels, SpatialPixelsDataFrame, SpatialGrid, SpatialGridDataFrame; Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 41. SpatialPoints > library(sp) > data(meuse) > coords <- SpatialPoints(meuse[, c("x", "y")]) > summary(coords) Object of class SpatialPoints Coordinates: min max x 178605 181390 y 329714 333611 Is projected: NA proj4string : [NA] Number of points: 155 Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 42. SpatialPointsDataFrame We can add the tabular data to make a SpatialPointsDataFrame object: > meuse1 <- SpatialPointsDataFrame(coords, meuse) > str(meuse1, max.level = 2) Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 155 obs. of 14 variables: ..@ coords.nrs : num(0) ..@ coords : num [1:155, 1:2] 181072 181025 181165 ... .. ..- attr(*, "dimnames")=List of 2 ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. ..- attr(*, "dimnames")=List of 2 ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 43. Basic methods spplot — plotting of spatial objects (maps); spsample — sample points from a set of polygons, on a set of lines or from a gridded area; bbox — get the bounding box; proj4string — get or set the projection (coordinate reference system); coordinates — set or retrieve coordinates; spTransform — transform coordinates from one CRS to another (PROJ.4); overlay — combine two different spatial objects; Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 44. Plotting a SpatialPoints object > plot(as(meuse1, "Spatial"), axes = TRUE) > plot(meuse1, add = TRUE) > plot(meuse1[meuse1$ffreq == 1, ], col = "green", add = TRUE) 178000 179000 180000 181000 182000 330000331000332000333000 Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 45. Combining statistical and GIS operations Because the Spatial*DataFrame family objects behave in most cases like data frames, most of what we are used to doing with standard data frames just works (but no merge, etc., yet). These objects are very similar to typical representations of the same kinds of objects in geographical information systems, so they do not suit spatial data that is not geographical (like medical imaging) as such. Because now sp classes for GIS data exits, this opens the door for fusing GIS and statistical operations (this has not been possible in e.g.2002). Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 46. Spatial packages R now offers a range of contributed packages in spatial statistics and increasing awareness of the importance of spatial data analysis in the broader community. Current contributed packages with spatial applications: point patterns: spatstat, VR:spatial, splancs; geostatistics: gstat, geoR, geoRglm, fields, spBayes, RandomFields, VR:spatial, sgeostat, vardiag; lattice/area data: spdep, DCluster, spgwr, ade4; links to GIS: rgdal, spgrass, RPy, RSAGA; Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 47. Let’s create spatial objects! We can create spatial objects from scratch! For example a DEM: > dem <- expand.grid(x = seq(100, 600, 100), y = seq(100, + 600, 100)) > dem$Z <- as.vector(c(23, 24, 34, 38, 45, 51, 24, 20, + 20, 28, 18, 49, 22, 20, 19, 14, 38, 45, 19, 15, 13, + 21, 23, 25, 14, 11, 18, 11, 18, 19, 10, 16, 23, 16, + 9, 6)) > gridded(dem) <- ~x + y > dem <- as(dem, "SpatialGridDataFrame") > str(dem) Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 48. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 49. Controlling SAGA from R > library(RSAGA) > rsaga.env() $workspace [1] "." $cmd [1] "saga_cmd.exe" $path [1] "C:/PROGRA~1/R/R-210~1.1/library/RSAGA/saga_vc" $modules [1] "C:/PROGRA~1/R/R-210~1.1/library/RSAGA/saga_vc/modules" Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 50. Getting list of modules > rsaga.get.modules("ta_channels") $ta_channels code name interactive 1 0 Channel Network FALSE 2 1 Watershed Basins FALSE 3 2 Watershed Basins (extended) FALSE 4 3 Vertical Distance to Channel Network FALSE 5 4 Overland Flow Distance to Channel Network FALSE 6 5 D8 Flow Analysis FALSE 7 6 Strahler Order FALSE Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 51. Run stream extraction > rsaga.geoprocessor(lib = "ta_channels", module = 5, + param = list(DEM = "dem6.sgrd", + DIRECTION = "channels.sgrd", CONNECTION = "route.sgrd", + NETWORK = "channels.shp")) SAGA CMD 2.0.4 library path: C:/PROGRA~1/R/R-210~1.1/library/RSAGA/... library name: ta_channels module name : D8 Flow Analysis author : (c) 2003 by O.Conrad Load grid: dem6.sgrd... ready Parameters Grid system: 100; 6x 6y; 100x 100y DEM: dem6 Flow Direction: Flow Direction Flow Connectivity: Flow Connectivity Flow Network: Flow Network Minimum Connectivity: 0 ... Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 52. Read back to R > dem$route <- readGDAL("route.sdat")$band1 route.sdat has GDAL driver SAGA and has 6 rows and 6 columns > channels <- readOGR("channels.shp", "channels") OGR data source with driver: ESRI Shapefile Source: "channels.shp", layer: "channels" with 32 features and 2 fields Feature type: wkbLineString with 2 dimensions Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 53. Plot the final result > dem.plt <- spplot(dem[1], main = "DEM", col.regions = topo.colors(25)) > channels.plt <- spplot(dem[2], col.regions = rev(gray(0:20/20)), + main = "Flow connectivity", sp.layout = list("sp.lines", + channels, col = "red")) > print(dem.plt, split = c(1, 1, 2, 1), more = T) > print(channels.plt, split = c(2, 1, 2, 1), more = F) DEM 10 20 30 40 50 Flow connectivity 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 54. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 55. Exercise 1 Create a working directory called NL, then download the makeRDC.R script. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 56. Exercise 1 Create a working directory called NL, then download the makeRDC.R script. Open new session in R and run the script from Tinn-R. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 57. Exercise 1 Create a working directory called NL, then download the makeRDC.R script. Open new session in R and run the script from Tinn-R. This will download a land cover map of NL and resample it to the Dutch coordinate system. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 58. FWTools Created and maintained by Frank Warmerdam (director and active contributor to OSGeo). includes OpenEV, GDAL, MapServer, PROJ.4 and OGDI. “it is intended to give folks a chance to use the latest and greatest”. FWTools contain a number of (highly efficient!!) utilities excellent for processing large datasets. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 59. Preparing FWTools There is still no package to control FWTools from R, but we can simply send command lines using the system command. Before we can use FWTools from R, we need to locate it on our PC: > gdalwarp <- gsub("/", "", dir(path="C:/PROGRA~2/FWTOOL~1.7", + pattern="gdalwarp.exe", recursive=TRUE, full.names=TRUE)) > gdalwarp [1] "C:PROGRA~2FWTOOL~1.7bingdalwarp.exe" > workd <- paste(gsub("/", "", getwd()), "", sep="") Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 60. MODIS data Now we can download some GIS data from web: > MOD12Q1 <- "ftp://anonymous:test@e4ftl01u.ecs.nasa.gov/ + MOLT/MOD12Q1.004/2004.01.01/" > download.file(paste(MOD12Q1, + "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf", sep=""), + destfile=paste(getwd(), + "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf", sep="/"), + mode='wb', method='wget') Resolving e4ftl01u.ecs.nasa.gov... 152.61.4.83 Connecting to e4ftl01u.ecs.nasa.gov|152.61.4.83|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /MOLT/MOD12Q1.004/2004.01.01 ... done. ==> SIZE MOD12Q1.A2004001.h18v03.004.2006117173748.hdf ... 23165983 ==> PASV ... done. ==> RETR MOD12Q1.A2004... done. Length: 23165983 (22M) 0K .......... .......... 0% 64.9K 5m48s ... 22550K .......... .......... 99% 501K 0s 22600K .......... 100% 503K=65s Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 61. Reprojecting grids We can reproject/resample the map to our local coordinate system using the gdalwarp functionality (this combines several processing steps in one function): > NL.prj <- "+proj=sterea +lat_0=52.15616055555555 + +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 + +y_0=463000 +ellps=bessel +units=m +no_defs + +towgs84=565.237,50.0087,465.658, + -0.406857,0.350733,-1.87035,4.0812" > system(paste(gdalwarp, " HDF4_EOS:EOS_GRID:"", workd, + "MOD12Q1.A2004001.h18v03.004.2006117173748.hdf" + :MOD12Q1:Land_Cover_Type_1 -t_srs "", NL.prj, "" + IGBP2004NL.tif -r near -te 0 300000 280000 625000 + -tr 500 500", sep="")) Creating output file that is 560P x 650L. Processing input file HDF4_EOS:EOS_GRID:MOD12Q1.A2004001... Using internal nodata values (eg. 255) for image HDF4_EOS:EOS_... 0...10...20...30...40...50...60...70...80...90...100 - done. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 62. Plot the final result In this case we have produced a MODIS-based land cover map for the whole Netherlands in resolution of 500 m (in local coordinate system). Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 63. Exercise 2 & 3 Create a working directory called worldmaps, then download a selection of worldmaps from the repository (or get a copy from the USB stick) and unzip the maps that you need to complete the exercises. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 64. Exercise 2 & 3 Create a working directory called worldmaps, then download a selection of worldmaps from the repository (or get a copy from the USB stick) and unzip the maps that you need to complete the exercises. Use any GIS that you find suitable to answer the questions. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 65. Exercise 2 & 3 Create a working directory called worldmaps, then download a selection of worldmaps from the repository (or get a copy from the USB stick) and unzip the maps that you need to complete the exercises. Use any GIS that you find suitable to answer the questions. I recommend first testing SAGA GIS, then running the analysis in R. These maps are Large so it could take time until you import/open a map. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 66. Exercise 4 We focus on extracting land surface parameters (or geomorphometric parameters) using a DEM. First create a new working directory on your computer, then Download the map of world countries (countries) and the global Digital Elevation Model at 5.6 km resolution (globedem). Resample and subset the DEMs to local coordinate systems — for Germany use the European ETRS89 coordinate system (EPSG:3035), and for Bolivia use the South America Albers Equal Area Conic coordinate system (ESRI:102033). Try also to derive these parameters using the RSAGA package, i.e.by sending the commands to SAGA from R. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 67. Outline Introduction Literature DSM and env maps Worldmaps Software R code editors Working with spatial data R+SAGA Exercises R+FWTools Export to Google Earth Digital Soil Mapping training, Sept 3, 2010, JRC Ispra
  • 68. Writing spatial data to KML There are two possibilities to export maps to KML: (a) using existing packages, and (b) by writing KML files“by-hand”. To export point or line features to KML, use the writeOGR method that is available in R package rgdal. More flexible way to writing KML files is by using loops. Digital Soil Mapping training, Sept 3, 2010, JRC Ispra