How does bilinear resampling work when converting a 10 meter raster to 30 meter?

2835
8
Jump to solution
09-21-2018 07:43 AM
MorganGraham
New Contributor II

There is a 10 meter resolution land cover raster. An analyst wishes to resample 10 meter raster to 30 meter raster. The analyst selects the Bilinear Resampling technique in the Resample tool of the Raster Processing toolset of ArcGIS 10.3.

ArcGIS 10.3 help defines the Bilinear Resampling technique as:

Performs a bilinear interpolation and determines the new value of a cell based on a weighted distance average of the four nearest input cell centers. It is useful for continuous data and will cause some smoothing of the data.

A 30 meter output cell will contain nine cells from the input 10 meter raster. The closest input cell center will be the one that perfectly overlaps the output cell center. That leaves three remaining input cell center values for inclusion in the bilinear interpolation. In the resample of 10 m to 30 m there are eight remaining values that are equidistant to the output cell center.

Which 3 values of the 8 equidistant values are utilized to create the output?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus
The bilinear option will determine the cell values based on a weighted distance of the four nearest input cell centers.

Sample—Help | ArcGIS Desktop 

Which is why it is sometimes better use rolling statistics and your own kernel.  

I have covered this in a couple of blog posts as well

/blogs/dan_patterson/2016/09/01/blog-template 

/blogs/dan_patterson/2018/10/08/generalization-tools-for-rasters 

View solution in original post

8 Replies
ChrisDonohue__GISP
MVP Alum

I don't know if it has changed in more recent versions of the software, but in older version of ArcGIS Desktop it appears to be the 4 cell centers in the original raster closest to the cell center output point of the new raster cell.  Check out the full explanation and diagram here:

FAQ: How is bilinear interpolation calculated? 

Here is the ArcGIS Desktop 10.3 explanation:

Cell size and resampling in analysis—ArcGIS Help | ArcGIS for Desktop 

Chris Donohue, GISP

0 Kudos
DanPatterson_Retired
MVP Emeritus

 If you are using categorical data, perhaps Nearest Neighbor  or even Majority should be your option(s).

Resample—Data Management toolbox | ArcGIS Desktop 

You can't interpolate nominal data, because it makes no sense.

MorganGraham
New Contributor II

Thanks Dan. Per the Resample link you shared above:

"If the center of the pixel in output space falls exactly the same as one of the pixels in the input cells, that particular cell value gets all the weights, thereby causing the output pixel to be the same as the cell center. This will affect the result of bilinear interpolation and cubic convolution."

The 10 meter land cover raster I originally described is actually a numerical relative habitat value score. If bilinear interpolation resampling in arcgis 10.3.1 is the same as ArcGIS Pro, then only the single center cell of nine input 10 meter cells is used in calculating the output 30 meter cell. Can anyone from ESRI confirm that as the case?

0 Kudos
DanPatterson_Retired
MVP Emeritus

A relative habitat value score is at best on an ordinal scale and not continuous data (ie interval or ratio scale data).so bilinear or cubic should be out of the consideration pool. 

I would recommend

Aggregate—Help | ArcGIS Desktop 

but they don't have a mode (modal class/rank) option which leaves a less useful min or max since I can't remember if median does division for tied ranks

DouglasLong
Occasional Contributor

This response is not necessarily about Resampling, however, it is more of a rant about the Sample tool.

Man, I struggled with this one for a while. I rewrote the Spatial Analyst Sample using numpy/gdal.
it was painful cause I was so confused on how arcpy actually interpolates. a few things I found out.

  1. arcpy Sample does not actually do bilinear interpolation.
  2. arcpy sample BILINEAR is actually average 4 - which takes the average of the closest centers, including the source.

I was very upset cause I had written my own bilinear interpolation based on the actual function, and it kept giving me a different number than ArcGIS. I was sure I had written it correctly. I tried many things, ultimately I used another software called FME (to see if my python was correct) to do a point on raster and they had several options for interpolation.

  • nearest = arcpy nearest
  • bilinear != arcpy bilinear
  • average4 == arcpy bilinear

Lone behold, I found out that arcpy bilinear is not actually a true bilinear rather just an average four including the source cell.

here is what arcpy does with bilinear in the following situations

  1. a point within the raster 

2. Top left of the raster 

3. Top right of the raster

my conclusion is the bilinear in arcpy is not a true bilinear rather an average 4. however what it does do is it takes the three cells as seen in my illustrations.

0 Kudos
DanPatterson_Retired
MVP Emeritus
The bilinear option will determine the cell values based on a weighted distance of the four nearest input cell centers.

Sample—Help | ArcGIS Desktop 

Which is why it is sometimes better use rolling statistics and your own kernel.  

I have covered this in a couple of blog posts as well

/blogs/dan_patterson/2016/09/01/blog-template 

/blogs/dan_patterson/2018/10/08/generalization-tools-for-rasters 

DouglasLong
Occasional Contributor

Hey Dan,

hope all is well, thank you for sharing your blog posts, I will check them out and comment. I really enjoy this stuff.

yea it takes the weighted distance of the four nearest input cell centers, would you agree though it should not be called bilinear, rather average4 or something along those lines?

pretty interesting topic and not really GIS-related, I wrote my own rolling statistics for interpolating certain aspects of dents on pipeline inspection data and I agree with you 100% it usually is better to just write your own.

Cheers,

Doug

0 Kudos
curtvprice
MVP Esteemed Contributor

Resampling is usually inappropriate for this use case (down-sampling 10 meter data to 30 meters) -- as data will be dropped/ignored when creating the output raster.

I suggest considering the Aggregate tool.

How Aggregate works—Help | ArcGIS Desktop 

0 Kudos