Resampling Raster Data in R

Minerva Singh
A free video tutorial from Minerva Singh
Bestselling Instructor & Data Scientist(Cambridge Uni)
4.4 instructor rating • 43 courses • 77,224 students

Lecture description

In this lecture we will see how the pixel size (and extent) of a given raster can be modified using another raster as a baseline

Learn more from the full course

Core Spatial Data Analysis: Introductory GIS with R and QGIS

Become Proficient In Spatial Data Analysis Using R & QGIS By Working On A Real Project - Get A Job In Spatial Data!

02:22:07 of on-demand video • Updated November 2021

  • You will have a greater clarity of basic spatial data concepts and data types
  • Carry out practical spatial data analysis tasks in freely available software
  • Learn about the kind of questions that are answered through spatial analysis and where to obtain free spatial data.
  • Analyze spatial data using both R and QGIS
  • Process raster and vector data in both R and QGIS
  • Show off your skills & gain experience by working on a real life conservation related spatial data analysis project
  • Start analyzing spatial data for your own projects using two powerful freeware tools
  • You'll have a copy of all the data and R scripts used in the course will be provided to students for their reference and to use in their own analysis.
  • You'll also have plenty of handy hints and tips will be provided alongside the code to prevent glitches
English [Auto] In the previous lectures, we have seen that for us to work with multiple rostral simultaneously, they need to have the same resolution that is the same pixel size. That is usually not the case. When we get raster data from multiple sources in that situation, we have to change a Rasta pixel size according to another baseline Rosta that is resampling. Before we start, a few basic handy hints slash disclaimer warnings. The basic format for Resampling interesting hour is the reasonable function from the package roster. The roster to be resample comes first baseline roster interpellation technik. The Rostow's pixel size has to be modified is the first argument. A number of interpolation techniques exist, including nearest neighbors by Lenie, the interpellation technique that you end up choosing will eventually depend on your project. I have already read into rosters for us the Hillshire roster of Tomball National Park and the NBA roster of our national park. And this is the Hillshire roster of the top down national park in latitude longitude. And this is the NBA roster in Utah. So before we start resampling, what is the first thing we need to do? Yes, that's right. We need to change the coordinate reference system in this case, I'm going to change the coordinate reference system of my NBA into latitude longitude and it entirely possible to do it the other way around. Now, let us examine our rosters, because the first thing with resampling is that your rosters, they do need to lie on top of each other. OK, now this is the pixel resolution series of NBA. This is the pixel resolution size of the Hill Adrasta. Now, I am going to re sample the pixel values of NDB. Reja zero point zero zero zero, Two-Line, to the pixel values of the Hillshire trustor, so that's why my ENTYVIO roster is here. Hillshire Trastevere MGB stands for nearest neighbor. That is my interpellation technique. You are free to choose whichever interpellation technique is suited to your project. Now, this has been resample, let us just check the pixel values. OK, now the pixel values are zero point zero zero eight. And the previous pixel values were these now usually my observation has been that if the pixel sizes are quite far apart, then you would be better off resampling from a coarser pixel that is from a bigger pixel to a smaller pixel, because if you try to make a smaller pixel larger and the size gap is quite a bit, then that can take a tremendous amount of time. So that is something worth bearing in mind.