Bulk Interpolation Using the R Environment
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 95 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/15515 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Place | Nottingham |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
InterpolationIntegrated development environmentComputer-generated imagerySampling (music)Field (computer science)SpacetimeVariable (mathematics)Workstation <Musikinstrument>Data typeTask (computing)Moving averageStatisticsGeometryLevel (video gaming)Computer fileVector spaceRaster graphicsEmailProgramming languageFreewareSoftwareoutputFile formatFunction (mathematics)Mountain passScalable Coherent InterfaceArmDecimalInclusion mapStructural loadMatching (graph theory)Set (mathematics)Identical particlesScale (map)Thermodynamisches SystemPoint (geometry)Discrete element methodAreaASCIILibrary (computing)Unified threat managementLine (geometry)Metropolitan area networkSubsetMaxima and minimaCoordinate systemElectronic mailing listVarianceChi-squared distributionVariable (mathematics)Functional programmingThermodynamisches SystemMultiplication signProcess (computing)Observational studyState observerSet (mathematics)Level (video gaming)Computer fileInterpolationUniform resource locatorCASE <Informatik>Vector spaceGraph theorySpacetimePoint (geometry)Orientation (vector space)Goodness of fitTask (computing)File formatTouchscreenDifferent (Kate Ryan album)Workstation <Musikinstrument>NumberPlotterRaster graphicsShape (magazine)Field (computer science)Scripting languageGraph coloringAreaPresentation of a groupTime seriesSoftwareDimensional analysisoutputReading (process)Cone penetration testOpen sourceFunction (mathematics)Loop (music)Slide ruleTable (information)StatisticsSubsetProgramming languageMereologyCartesian coordinate systemQuicksortBoss CorporationOperating systemFilm editingState of matterSoftware testingSelf-organizationInsertion loss3 (number)Matching (graph theory)Student's t-testOrder (biology)Machine visionRhombusType theoryOctahedronVolume (thermodynamics)Group actionWordSemiconductor memorySampling (statistics)Endliche ModelltheorieRight angleCoordinate systemWindow functionHand fanMaxima and minimaSummierbarkeitLogic gateComputer animation
08:49
Point (geometry)Vector spaceRaster graphicsDifferent (Kate Ryan album)AreaObservational studyVector spaceRaster graphicsInterpolationUniform resource locatorPoint (geometry)AlgorithmData typeDifferent (Kate Ryan album)State observerChaos (cosmogony)Electronic visual displayType theoryComputer animation
09:26
KrigingInterpolationInformationDistanceAlgorithmGame theoryInterpolationData managementInverse function2 (number)CASE <Informatik>Error messageComputer animation
10:20
InterpolationData modelIntercept theoremCASE <Informatik>Shape (magazine)Linear regressionNichtlineares GleichungssystemResidual (numerical analysis)CNNInformationUniverse (mathematics)Set (mathematics)Line (geometry)Limit (category theory)Game theoryInternetworkingInterpolationInstance (computer science)CodeQuicksortOrder (biology)Extension (kinesiology)Bounded variationCASE <Informatik>Endliche ModelltheorieEstimatorLinear regressionProduct (business)CoefficientResidual (numerical analysis)Intercept theoremKrigingMultiple RegressionComputer animation
12:55
Dedekind cutSpectrum (functional analysis)Goodness of fitThermodynamisches SystemQuicksortoutputNumbering schemeGraph coloringSet (mathematics)Level (video gaming)Computer animation
13:36
Spectrum (functional analysis)Graph coloringInterpolationRaster graphicsVector spacePoint (geometry)Control flowOrder (biology)DemosceneComputer animation
14:04
Level (video gaming)Computer fileProbability density functionASCIISoftwareSet (mathematics)Computer-generated imageryImage resolutionComputer configurationPoint (geometry)Clique-widthInterpolationLoop (music)Structural loadMatching (graph theory)SubsetComputer fileDataflowMultiplicationComputer configurationNumbering schemeMultiplication signCartesian coordinate systemImage resolutionDigital electronicsCASE <Informatik>Level (video gaming)Medical imagingGraph coloring2 (number)Set (mathematics)Different (Kate Ryan album)PlotterInterpolationFile formatLoop (music)MereologyVector graphicsComputer animation
17:15
NumberGraphical user interfaceData modelTask (computing)Level (video gaming)AutomationIntegrated development environmentSoftwareStatisticsScripting languageElectronic program guideSource codeInformationWebsiteRaster graphicsData analysisVariable (mathematics)InterpolationSample (statistics)Presentation of a groupThermal radiationMultiplicationProgram slicingEvent horizonSpacetimeComputer fileQuicksortWebsitePresentation of a groupOrder (biology)Sampling (statistics)NumberDimensional analysisSource codeLogische ProgrammierspracheGame theoryMereologyRow (database)Computer configurationDifferent (Kate Ryan album)Functional programmingGroup actionGoodness of fitLevel (video gaming)Scripting languageElectronic program guideWeb 2.0Raster graphicsProcess (computing)Function (mathematics)Data analysisFile formatGoogolTask (computing)Projective planeState observerCentralizer and normalizerComputer animation
Transcript: English(auto-generated)
00:01
Good morning, welcome everybody, thanks for taking the time coming to this session. My name is Jerzy Kavlets and my presentation is together with Pavel Treml from Czech Republic
00:22
and we will discuss interpolation, how to make large number of interpolated maps using R software. So in this presentation we will be dealing with the data that are fields which have
00:47
dimension in space and also in time. So for the observation we can ask the question what, where and when and our values may be
01:03
regular, but also irregular with lot of missing data points. So here in this slide is the example of data I'm talking about. You can see the cones are station, then longitude and latitude coordinates, then
01:29
the variable we can see here are two different variables, temperature and snow, then the time when it was observed and also the value.
01:44
And with my colleagues we were facing the task, we had hundreds of stations and hundreds of observations per station and we needed to create maps for all the time steps with
02:04
the same appearance. So examine how one or more variables change in space and in time. So regarding interpolation we have some observations and we want to estimate what
02:29
was the value at a certain time where we don't have any observation or as in the
02:41
second example, we have a location and we want to estimate what was the value at this location based on the surrounding locations for example.
03:05
And now I will talk about the R environment. R is a free software for doing statistical analysis. It is open source and runs on Windows, Mac and Linux operating systems and in R
03:29
there is many input data formats. Your input data may be as a text file or if you're familiar with vector data, shape
03:43
files or with raster data grids. And also it supports large number of output data formats including pictures, text file and also raster and vector.
04:04
And the main strength I think is that R has a scripting language which allows to automate your tasks. So for example, here at the top we have an example script which reads a text file
04:28
and then it creates the graph in this example, the discharge at two different rivers as
04:42
the time series plot. So in my case study, the case study creates maps of air temperature and snow in Czech Republic and year is 2013 and also for orientation we need to show some background features
05:07
such as the major rivers and country boundaries. So here our process proceeds as a loop. First we load our data sets and then for each selected time we locate the matching
05:31
observations, then run interpolation, create the map cartography and then move to the next time step.
05:42
So our first example is showing how we can load a raster data set in R. So at the start we have the command library, this selects the needed functions and then
06:08
we have a local file with the elevation data, then next we set the color ramp and
06:20
last we can plot it on the screen using the color ramp. Also in R there is a useful function which allows you to get the elevation data for your area of interest directly from the web.
06:44
Then next example is a little more complex, it shows how to load the vector data, by vector I mean country boundaries or rivers. In the first case we directly load the rivers, we are using functions in the map tools
07:13
package but in the second example our data set is in a different coordinate system
07:25
and we can see R supports the functionality to reproject our vector data to the desired coordinate system. Then last we organize these data sets into a layout and we can visualize them.
07:52
Now for the observations which change in time we have a text file, so using read
08:05
table command we can read the text file, this text file contains data for all the time step, so we can subset it just to use one time step and then in the second
08:28
part of this example script we assign the coordinates and we can also plot the labels
08:41
with the point values as shown in the example. Now the next example shows all the different data types displayed together in R, so we
09:03
have the raster which is the elevation grid, we have the vector which is the borders and major rivers and we have the points also vector which are the observation locations.
09:24
Now moving to interpolation as you may know there are many different methods and algorithms
09:40
for interpolation available, two examples are IDW inverse distance weighted which is called deterministic method and the second is kriging which is called geostatistical method.
10:06
Kriging compared to IDW also gives you more information about the errors of your prediction, but often such as in the case of meteorological data we have some other
10:34
information which could help us with our estimate, for instance temperature is often
10:45
correlated with the elevation above the sea level and in our case we have the elevation grid available, therefore in R we can create a linear regression model, so here A is
11:10
the intercept, A is the slope and B is the intercept and then we can use these coefficients
11:23
in our next step, so in our next step we can use these coefficients to multiply the values of the original elevation grid and add the intercept to this product and we get
11:53
a basic estimate of the temperature, then if we look at our regression model we have some
12:04
residuals, those are the blue lines in the slide, so instead of interpolating the original values we just interpolate the residuals and then in the last step we combine our
12:27
grid created by the linear regression also with the residuals, there are also some variations of this method, here I showed it's called regression kriging but also there are
12:50
universal kriging or you can see the name kriging with external drift, so if we want to show our data in the map it is important to select the right contrasting color scheme and
13:09
color breaks, so for this there is a useful package called rcolorbrewer and it provides us
13:22
with predefined sets of the color ranging from the high value to the low value and now if we combine these steps, so we loaded the vector data, we loaded the raster data
13:52
and our points and we also set up our predefined color breaks and we run the
14:02
interpolation process, here is an example which shows the snow depths in the Czech Republic for a selected time step, it's the 1st of January 2013 and we can see the
14:25
rivers and country borders and in the bottom part of the map we can see the predefined color ranges snow depth in centimeters, now important step is we want to save our map to a file, so
14:49
in R you have the option to save to different file formats such as png picture or a pdf
15:03
file or a vector graphics file as well as some gis formats and the trick there is that first you write the command with format of the file and specify some settings such as
15:25
file resolution and image size, this is useful if you need to supply your file for publication, then you run the plot commands and then this rev.off that stops the writing to the file and
15:50
so now we will move to the bulk interpolation as I have said I have multiple time steps in my
16:02
case 365 days and for each day I need to create the map with the same color scheme and color breaks, so for this we can use a command which is called the for loop so we start this
16:24
loop then inside we run the plotting and interpolation command and then we repeat this again automatically until the last time step, so here is example for the snow
16:49
we can see the first time step and second time step and each of these has the same color scheme therefore it's easy to compare how the snow depth changed in the course
17:07
of the time with snow melting and new snow falling also and so if I could according to my
17:22
experience compare R with desktop GIS in desktop GIS your maps are highly interactive and you have good options for label placement but if you want to automate and create a large
17:45
number of maps in reproducible way we found R easier to use although the maps are static not interactive there is quite a good documentation and large user base our task
18:11
can be automated and reproduced and so we found R to be the preferred method for
18:23
automatically creating large number of maps we can also consider in desktop GIS typically you have some project file where the process of creating your map is stored in R this is stored
18:42
in the R script so here is the references I would recommend this book applied spatial data analysis with R and also the practical guide to geostatistical mapping here are some useful
19:03
website and finally if you would be interested in trying your examples so with your own data there is the website hydrodata.info
19:23
slash R on this website you can find this presentation you can find many different sample scripts which are commented so you can replace the parts you need with your own data
19:44
and also you can find the source data meteorological observation for the central europe region thank you for your attention
20:20
right now I have looked at the individual slices I haven't looked at the three-dimensional space-time rigging it could be interesting option to explore
20:58
well basically our output we can save to different file formats
21:08
and so this includes also geo-referenced file formats such as the geotiff file and the
21:22
functions are in the package called raster package
21:55
and yes so one example to present it is we can save our data to the kml files and then
22:12
uh we can use in a web gis for example google maps or google
22:22
arts so that that was one example I looked into I think there's examples script for this in the website I shown