SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
FAO- Global Soil
Partnership
Training on
Digital Soil Organic Carbon
Mapping
20-24 January 2018
Tehran/Iran
Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL)
Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
DATA PREPARATION
COVARIATES
COVARIATES
The example covariates from this chapter were
prepared by ISRIC (ISRIC, 2017).
COVARIATES
The example covariates from this chapter were prepared by
ISRIC (ISRIC, 2017).
#For handling raster data, we load raster package
library(raster)
#load DEM from tif file
DEM <- raster("covs/DEMENV5.tif")
plot(DEM)
The example covariates from this chapter were prepared by
ISRIC (ISRIC, 2017).
DEM
#For handling raster data, we load raster package
library(raster)
#load DEM from tif file
DEM <- raster("covs/DEMENV5.tif")
plot(DEM)
The example covariates from this chapter were prepared by
ISRIC (ISRIC, 2017).
Soil Maps
Soil maps play a crucial role for upscaling soil property data from point
locations. They can be the spatial layer for conventional upscaling, they
can also serve as a covariate in digital soil mapping.
Predicted soil property maps have lower quality in areas where the
covariates such as relief, geology and climate so not correlate well with
the dependent variable, here soil carbon stocks. This is especially true
for soils groundwater or stagnic water influence. This information is
well-represented in soil maps.
FAO, IIASA, ISRIC, ISS CAS and JRC produced a gridded 1 km soil
class map (HWSD).
Soil Maps
# load the soil map from a shapefile file
soilmap <- shapefile("MK_soilmap_simple.shp")
# plot the DEM together with the soil types
plot(DEM)
lines(soilmap)
Digitized small-scale national soil maps are the most important
spatial layer for soil property mapping. The higher its resolution,
the better soil maps contribute to high quality soil property maps -
considering that the map should cover the target area/full country
coverage.
DEM
#For handling raster data, we load raster package
library(raster)
#load DEM from tif file
DEM <- raster("covs/DEMENV5.tif")
plot(DEM)
The example covariates from this chapter were prepared by
ISRIC (ISRIC, 2017).
DEM
# the "Symbol" attribute from the vector layer will be used for the
# rasterization process. It has to be a factor
soilmap@data$Symbol <- as.factor(soilmap@data$Symbol)
#save the levels names in a character vector
Symbol.levels <- levels(soilmap$Symbol)
# The rasterization process needs a layer with the target grd
# system: spatial extent and cell size.
soilmap.r <- rasterize(x = soilmap, y = DEM, field = "Symbol")
# The DEM raster layer could be used for this.
plot(soilmap.r, col=rainbow(21))
legend("bottomright",legend = Symbol.levels, fill=rainbow(21),
cex=0.5)
Technical Steps - Rasterizing a vector layer in R
DEM
# the "Symbol" attribute from the vector layer will be used for the
# rasterization process. It has to be a factor
soilmap@data$Symbol <- as.factor(soilmap@data$Symbol)
#save the levels names in a character vector
Symbol.levels <- levels(soilmap$Symbol)
# The rasterization process needs a layer with the target grd
# system: spatial extent and cell size.
soilmap.r <- rasterize(x = soilmap, y = DEM, field = "Symbol")
# The DEM raster layer could be used for this.
plot(soilmap.r, col=rainbow(21))
legend("bottomright",legend = Symbol.levels, fill=rainbow(21),
cex=0.5)
Technical Steps - Rasterizing a vector layer in R
LAND COVER
landcover <- raster("covs/LCEE10.tif")
# Land cover is a categorical covariate, this has to be made
# explicit using function as.factor()
landcover <- as.factor(landcover)
landcover
## class : RasterLayer
## dimensions : 182, 310, 56420 (nrow, ncol, ncell)
## resolution : 0.008327968, 0.008353187 (x, y)
## extent : 20.45242, 23.03409, 40.8542, 42.37448 (xmin, xmax,
ymin, ymax)
## coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0
plot(landcover)
LAND COVER
landcover <- raster("covs/LCEE10.tif")
# Land cover is a categorical covariate, this has to be made
# explicit using function as.factor()
landcover <- as.factor(landcover)
landcover
## class : RasterLayer
## dimensions : 182, 310, 56420 (nrow, ncol, ncell)
## resolution : 0.008327968, 0.008353187 (x, y)
## extent : 20.45242, 23.03409, 40.8542, 42.37448 (xmin, xmax,
ymin, ymax)
## coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0
plot(landcover)
CLIMATE
WorldClim Climate Data are available at: www.worldclim.org
(WorldClim 1.4 (current conditions) by www.worldclim.org;
Hijmans et al., 2005. Int. J. of Clim. 25: 1965-1978. Is licensed
under a Creative Commons Attribution-ShareAlike 4.0
International License).
CLIMATE
# load the climate covariates from the raster tif files
files <- list.files(path = "covs/", pattern = "CHE3.tif",
full.names = TRUE)
# stack all the files in one RasterStack
climate <- stack(files)
# plot the first 2 layers
plot(climate[[1:2]])
CLIMATE
# load the climate covariates from the raster tif files
files <- list.files(path = "covs/", pattern = "CHE3.tif",
full.names = TRUE)
# stack all the files in one RasterStack
climate <- stack(files)
# plot the first 2 layers
plot(climate[[1:2]])
OVERLAYING SOIL DATA AND COVARIATES
# Load the processed data. This table was prepared in the previous
# chapter.
dat <- read.csv("dataproc.csv")
files <- list.files(path = "covs", pattern = "tif$",
full.names = TRUE)
covs <- stack(files)
OVERLAYING SOIL DATA AND COVARIATES
covs <- stack(covs, soilmap.r)
# correct the name for layer 14
names(covs)[14] <- "soilmap"
#mask the covariates with the country mask from the data repository
mask <- raster("data/mask.tif")
covs <- mask(x = covs, mask = mask)
plot(covs)
OVERLAYING SOIL DATA AND COVARIATES
covs <- stack(covs, soilmap.r)
# correct the name for layer 14
names(covs)[14] <- "soilmap"
#mask the covariates with the country mask from the data repository
mask <- raster("data/mask.tif")
covs <- mask(x = covs, mask = mask)
plot(covs)
OVERLAYING SOIL DATA AND COVARIATES
#upgrade points data frame to SpatialPointsDataFrame
coordinates(dat) <- ~ X + Y
# extract values from covariates to the soil points
dat <- extract(x = covs, y = dat, sp = TRUE)
# LCEE10 and soilmap are categorical variables
dat@data$LCEE10 <- as.factor(dat@data$LCEE10)
dat@data$soilmap <- as.factor(dat@data$soilmap)
#levels(soilmap) <- Symbol.levels
summary(dat@data)
OVERLAYING SOIL DATA AND COVARIATES
dat <- as.data.frame(dat)
# The points with NA values has to be removed
dat <- dat[complete.cases(dat),]
# export as a csv table
write.csv(dat, "data/MKD_RegMatrix.csv", row.names = FALSE)
OVERLAYING SOIL DATA AND COVARIATES
dat <- as.data.frame(dat)
# The points with NA values has to be removed
dat <- dat[complete.cases(dat),]
# export as a csv table
write.csv(dat, "data/MKD_RegMatrix.csv", row.names = FALSE)
NEXT >> Mapping, Modelling

Más contenido relacionado

La actualidad más candente

Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Ram Narasimhan
 
5 R Tutorial Data Visualization
5 R Tutorial Data Visualization5 R Tutorial Data Visualization
5 R Tutorial Data VisualizationSakthi Dasans
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in RPaul Richards
 
3 R Tutorial Data Structure
3 R Tutorial Data Structure3 R Tutorial Data Structure
3 R Tutorial Data StructureSakthi Dasans
 
Regression kriging
Regression krigingRegression kriging
Regression krigingFAO
 
7. Data Import – Data Export
7. Data Import – Data Export7. Data Import – Data Export
7. Data Import – Data ExportFAO
 
Scaling PostreSQL with Stado
Scaling PostreSQL with StadoScaling PostreSQL with Stado
Scaling PostreSQL with StadoJim Mlodgenski
 
Fun with click house window functions webinar slides 2021-08-19
Fun with click house window functions webinar slides  2021-08-19Fun with click house window functions webinar slides  2021-08-19
Fun with click house window functions webinar slides 2021-08-19Altinity Ltd
 
Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data Con LA
 
Cubist
CubistCubist
CubistFAO
 
Introduction to spatial data analysis in r
Introduction to spatial data analysis in rIntroduction to spatial data analysis in r
Introduction to spatial data analysis in rRichard Wamalwa
 
Data Profiling in Apache Calcite
Data Profiling in Apache CalciteData Profiling in Apache Calcite
Data Profiling in Apache CalciteJulian Hyde
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLJim Mlodgenski
 
H base introduction & development
H base introduction & developmentH base introduction & development
H base introduction & developmentShashwat Shriparv
 
Efficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesEfficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesJulian Hyde
 

La actualidad más candente (20)

Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
 
5 R Tutorial Data Visualization
5 R Tutorial Data Visualization5 R Tutorial Data Visualization
5 R Tutorial Data Visualization
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in R
 
Rsplit apply combine
Rsplit apply combineRsplit apply combine
Rsplit apply combine
 
3 R Tutorial Data Structure
3 R Tutorial Data Structure3 R Tutorial Data Structure
3 R Tutorial Data Structure
 
Regression kriging
Regression krigingRegression kriging
Regression kriging
 
7. Data Import – Data Export
7. Data Import – Data Export7. Data Import – Data Export
7. Data Import – Data Export
 
Scaling PostreSQL with Stado
Scaling PostreSQL with StadoScaling PostreSQL with Stado
Scaling PostreSQL with Stado
 
Fun with click house window functions webinar slides 2021-08-19
Fun with click house window functions webinar slides  2021-08-19Fun with click house window functions webinar slides  2021-08-19
Fun with click house window functions webinar slides 2021-08-19
 
Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?
 
Raster package jacob
Raster package jacobRaster package jacob
Raster package jacob
 
R factors
R   factorsR   factors
R factors
 
Cubist
CubistCubist
Cubist
 
Introduction to spatial data analysis in r
Introduction to spatial data analysis in rIntroduction to spatial data analysis in r
Introduction to spatial data analysis in r
 
Geospatial Data in R
Geospatial Data in RGeospatial Data in R
Geospatial Data in R
 
Data Profiling in Apache Calcite
Data Profiling in Apache CalciteData Profiling in Apache Calcite
Data Profiling in Apache Calcite
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQL
 
R seminar dplyr package
R seminar dplyr packageR seminar dplyr package
R seminar dplyr package
 
H base introduction & development
H base introduction & developmentH base introduction & development
H base introduction & development
 
Efficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databasesEfficient spatial queries on vanilla databases
Efficient spatial queries on vanilla databases
 

Similar a Data preparation covariates

Support Vector Machines (SVM)
Support Vector Machines (SVM)Support Vector Machines (SVM)
Support Vector Machines (SVM)FAO
 
Transformations and actions a visual guide training
Transformations and actions a visual guide trainingTransformations and actions a visual guide training
Transformations and actions a visual guide trainingSpark Summit
 
ACADILD:: HADOOP LESSON
ACADILD:: HADOOP LESSON ACADILD:: HADOOP LESSON
ACADILD:: HADOOP LESSON Padma shree. T
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SPtjagger
 
2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factorskrishna singh
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4Andrea Antonello
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...InfluxData
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster packageAlberto Labarga
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingNesreen K. Ahmed
 
Presentation on use of r statistics
Presentation on use of r statisticsPresentation on use of r statistics
Presentation on use of r statisticsKrishna Dhakal
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkZalando Technology
 

Similar a Data preparation covariates (20)

Support Vector Machines (SVM)
Support Vector Machines (SVM)Support Vector Machines (SVM)
Support Vector Machines (SVM)
 
Transformations and actions a visual guide training
Transformations and actions a visual guide trainingTransformations and actions a visual guide training
Transformations and actions a visual guide training
 
Floodplain Modeling with LiDAR-Derived Terrain
Floodplain Modeling with LiDAR-Derived TerrainFloodplain Modeling with LiDAR-Derived Terrain
Floodplain Modeling with LiDAR-Derived Terrain
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
ACADILD:: HADOOP LESSON
ACADILD:: HADOOP LESSON ACADILD:: HADOOP LESSON
ACADILD:: HADOOP LESSON
 
Georastutorial
GeorastutorialGeorastutorial
Georastutorial
 
Spark training-in-bangalore
Spark training-in-bangaloreSpark training-in-bangalore
Spark training-in-bangalore
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SP
 
Hadoop I/O Analysis
Hadoop I/O AnalysisHadoop I/O Analysis
Hadoop I/O Analysis
 
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
NCCU: Statistics in the Criminal Justice System, R basics and Simulation - Pr...
 
Unit 2
Unit 2Unit 2
Unit 2
 
2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors2. R-basics, Vectors, Arrays, Matrices, Factors
2. R-basics, Vectors, Arrays, Matrices, Factors
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster package
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Presentation on use of r statistics
Presentation on use of r statisticsPresentation on use of r statistics
Presentation on use of r statistics
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
 
ClusterAnalysis
ClusterAnalysisClusterAnalysis
ClusterAnalysis
 

Más de FAO

Nigeria
NigeriaNigeria
NigeriaFAO
 
Niger
NigerNiger
NigerFAO
 
Namibia
NamibiaNamibia
NamibiaFAO
 
Mozambique
MozambiqueMozambique
MozambiqueFAO
 
Zimbabwe takesure
Zimbabwe takesureZimbabwe takesure
Zimbabwe takesureFAO
 
Zimbabwe
ZimbabweZimbabwe
ZimbabweFAO
 
Zambia
ZambiaZambia
ZambiaFAO
 
Togo
TogoTogo
TogoFAO
 
Tanzania
TanzaniaTanzania
TanzaniaFAO
 
Spal presentation
Spal presentationSpal presentation
Spal presentationFAO
 
Rwanda
RwandaRwanda
RwandaFAO
 
Nigeria uponi
Nigeria uponiNigeria uponi
Nigeria uponiFAO
 
The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)FAO
 
The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)FAO
 
Agenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water DaysAgenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water DaysFAO
 
Agenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meetingAgenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meetingFAO
 
The Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil ManagementThe Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil ManagementFAO
 
GLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forwardGLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forwardFAO
 
Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)FAO
 
GSP developments of regional interest in 2019
GSP developments of regional interest in 2019GSP developments of regional interest in 2019
GSP developments of regional interest in 2019FAO
 

Más de FAO (20)

Nigeria
NigeriaNigeria
Nigeria
 
Niger
NigerNiger
Niger
 
Namibia
NamibiaNamibia
Namibia
 
Mozambique
MozambiqueMozambique
Mozambique
 
Zimbabwe takesure
Zimbabwe takesureZimbabwe takesure
Zimbabwe takesure
 
Zimbabwe
ZimbabweZimbabwe
Zimbabwe
 
Zambia
ZambiaZambia
Zambia
 
Togo
TogoTogo
Togo
 
Tanzania
TanzaniaTanzania
Tanzania
 
Spal presentation
Spal presentationSpal presentation
Spal presentation
 
Rwanda
RwandaRwanda
Rwanda
 
Nigeria uponi
Nigeria uponiNigeria uponi
Nigeria uponi
 
The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)
 
The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)
 
Agenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water DaysAgenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water Days
 
Agenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meetingAgenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meeting
 
The Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil ManagementThe Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil Management
 
GLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forwardGLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forward
 
Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)
 
GSP developments of regional interest in 2019
GSP developments of regional interest in 2019GSP developments of regional interest in 2019
GSP developments of regional interest in 2019
 

Último

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Último (20)

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Data preparation covariates

  • 1. FAO- Global Soil Partnership Training on Digital Soil Organic Carbon Mapping 20-24 January 2018 Tehran/Iran Yusuf YIGINI, PhD - FAO, Land and Water Division (CBL) Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
  • 4. COVARIATES The example covariates from this chapter were prepared by ISRIC (ISRIC, 2017).
  • 5. COVARIATES The example covariates from this chapter were prepared by ISRIC (ISRIC, 2017).
  • 6. #For handling raster data, we load raster package library(raster) #load DEM from tif file DEM <- raster("covs/DEMENV5.tif") plot(DEM) The example covariates from this chapter were prepared by ISRIC (ISRIC, 2017).
  • 7. DEM #For handling raster data, we load raster package library(raster) #load DEM from tif file DEM <- raster("covs/DEMENV5.tif") plot(DEM) The example covariates from this chapter were prepared by ISRIC (ISRIC, 2017).
  • 8. Soil Maps Soil maps play a crucial role for upscaling soil property data from point locations. They can be the spatial layer for conventional upscaling, they can also serve as a covariate in digital soil mapping. Predicted soil property maps have lower quality in areas where the covariates such as relief, geology and climate so not correlate well with the dependent variable, here soil carbon stocks. This is especially true for soils groundwater or stagnic water influence. This information is well-represented in soil maps. FAO, IIASA, ISRIC, ISS CAS and JRC produced a gridded 1 km soil class map (HWSD).
  • 9. Soil Maps # load the soil map from a shapefile file soilmap <- shapefile("MK_soilmap_simple.shp") # plot the DEM together with the soil types plot(DEM) lines(soilmap) Digitized small-scale national soil maps are the most important spatial layer for soil property mapping. The higher its resolution, the better soil maps contribute to high quality soil property maps - considering that the map should cover the target area/full country coverage.
  • 10. DEM #For handling raster data, we load raster package library(raster) #load DEM from tif file DEM <- raster("covs/DEMENV5.tif") plot(DEM) The example covariates from this chapter were prepared by ISRIC (ISRIC, 2017).
  • 11. DEM # the "Symbol" attribute from the vector layer will be used for the # rasterization process. It has to be a factor soilmap@data$Symbol <- as.factor(soilmap@data$Symbol) #save the levels names in a character vector Symbol.levels <- levels(soilmap$Symbol) # The rasterization process needs a layer with the target grd # system: spatial extent and cell size. soilmap.r <- rasterize(x = soilmap, y = DEM, field = "Symbol") # The DEM raster layer could be used for this. plot(soilmap.r, col=rainbow(21)) legend("bottomright",legend = Symbol.levels, fill=rainbow(21), cex=0.5) Technical Steps - Rasterizing a vector layer in R
  • 12. DEM # the "Symbol" attribute from the vector layer will be used for the # rasterization process. It has to be a factor soilmap@data$Symbol <- as.factor(soilmap@data$Symbol) #save the levels names in a character vector Symbol.levels <- levels(soilmap$Symbol) # The rasterization process needs a layer with the target grd # system: spatial extent and cell size. soilmap.r <- rasterize(x = soilmap, y = DEM, field = "Symbol") # The DEM raster layer could be used for this. plot(soilmap.r, col=rainbow(21)) legend("bottomright",legend = Symbol.levels, fill=rainbow(21), cex=0.5) Technical Steps - Rasterizing a vector layer in R
  • 13. LAND COVER landcover <- raster("covs/LCEE10.tif") # Land cover is a categorical covariate, this has to be made # explicit using function as.factor() landcover <- as.factor(landcover) landcover ## class : RasterLayer ## dimensions : 182, 310, 56420 (nrow, ncol, ncell) ## resolution : 0.008327968, 0.008353187 (x, y) ## extent : 20.45242, 23.03409, 40.8542, 42.37448 (xmin, xmax, ymin, ymax) ## coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 plot(landcover)
  • 14. LAND COVER landcover <- raster("covs/LCEE10.tif") # Land cover is a categorical covariate, this has to be made # explicit using function as.factor() landcover <- as.factor(landcover) landcover ## class : RasterLayer ## dimensions : 182, 310, 56420 (nrow, ncol, ncell) ## resolution : 0.008327968, 0.008353187 (x, y) ## extent : 20.45242, 23.03409, 40.8542, 42.37448 (xmin, xmax, ymin, ymax) ## coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 plot(landcover)
  • 15. CLIMATE WorldClim Climate Data are available at: www.worldclim.org (WorldClim 1.4 (current conditions) by www.worldclim.org; Hijmans et al., 2005. Int. J. of Clim. 25: 1965-1978. Is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License).
  • 16. CLIMATE # load the climate covariates from the raster tif files files <- list.files(path = "covs/", pattern = "CHE3.tif", full.names = TRUE) # stack all the files in one RasterStack climate <- stack(files) # plot the first 2 layers plot(climate[[1:2]])
  • 17. CLIMATE # load the climate covariates from the raster tif files files <- list.files(path = "covs/", pattern = "CHE3.tif", full.names = TRUE) # stack all the files in one RasterStack climate <- stack(files) # plot the first 2 layers plot(climate[[1:2]])
  • 18. OVERLAYING SOIL DATA AND COVARIATES # Load the processed data. This table was prepared in the previous # chapter. dat <- read.csv("dataproc.csv") files <- list.files(path = "covs", pattern = "tif$", full.names = TRUE) covs <- stack(files)
  • 19. OVERLAYING SOIL DATA AND COVARIATES covs <- stack(covs, soilmap.r) # correct the name for layer 14 names(covs)[14] <- "soilmap" #mask the covariates with the country mask from the data repository mask <- raster("data/mask.tif") covs <- mask(x = covs, mask = mask) plot(covs)
  • 20. OVERLAYING SOIL DATA AND COVARIATES covs <- stack(covs, soilmap.r) # correct the name for layer 14 names(covs)[14] <- "soilmap" #mask the covariates with the country mask from the data repository mask <- raster("data/mask.tif") covs <- mask(x = covs, mask = mask) plot(covs)
  • 21. OVERLAYING SOIL DATA AND COVARIATES #upgrade points data frame to SpatialPointsDataFrame coordinates(dat) <- ~ X + Y # extract values from covariates to the soil points dat <- extract(x = covs, y = dat, sp = TRUE) # LCEE10 and soilmap are categorical variables dat@data$LCEE10 <- as.factor(dat@data$LCEE10) dat@data$soilmap <- as.factor(dat@data$soilmap) #levels(soilmap) <- Symbol.levels summary(dat@data)
  • 22. OVERLAYING SOIL DATA AND COVARIATES dat <- as.data.frame(dat) # The points with NA values has to be removed dat <- dat[complete.cases(dat),] # export as a csv table write.csv(dat, "data/MKD_RegMatrix.csv", row.names = FALSE)
  • 23. OVERLAYING SOIL DATA AND COVARIATES dat <- as.data.frame(dat) # The points with NA values has to be removed dat <- dat[complete.cases(dat),] # export as a csv table write.csv(dat, "data/MKD_RegMatrix.csv", row.names = FALSE)
  • 24. NEXT >> Mapping, Modelling