Sentinel-2: Resampling Spatial Resolution

Thank you @ABraun for your elaborated explanation. Yes, I will be extracting the values by points.

You say your are having points. But why do the points have an extent?
How have they be generated?
Maybe you can generated polygons - or rectangles - instead of points.
Then you can extract those pixels either by “Raster / Export / Mask Pixels” or you can use the StatisticsOp. There is a thread explaining its usage.
A StatisticsOp graph - GPF Graphs - STEP Forum (esa.int)
If you still want to resample the S2 data you can use the Multi-size Mosaic operator at “Raster / Geometric / Multi-size Mosaic”.

1 Like

Thank you, @marpet, for your suggestion. Actually, each point represents an individual sample plot whose tree aboveground biomass was calculated from field measurements, and the dimension of each plot on the field is 20 m * 40 m.
Also, is there a way I can do this on R programming if I want to do it? Thank you for your anticipated response.

So, even if you resample the data, the 2x4 pixel will in most cases not match your 20x40 area.

This is probably also doable in R or in Python if you like.
But it is more likely to find help in the respective forums.

Okay. Thank you again @marpet. A senior colleague of mine just suggested that the information in the raster can be extracted as a pixel-weighted average around the sample point: If my field plot is 800 m2 (i.e 20 * 40), I will need to extract information from 8 pixels (averaged) around the point. In case you are aware of this approach, what do you think of it?

You could use the pixel extraction.
but this allows only the extraction of squared areas so 3x3 would be the closest.
Raster / Export / Extract Pixel Values

You could do a filter operation (Raster / Filtered Band) with a user defined filter:
image

And there is still the problem that your field measurements are not aligned with the scene image. The probably do not lie like the orange rectangle, probably more like the pink ones.

So it would be good to have the shape of the rectangles. Then the StatisticsOp as mentioned before can be used or the imported shapes are used as mask and then you can export the mask values.
image
Due to the bug SNAP-1352, you have to save the product and reopen it after you have created the masks. Otherwise the option will not be enabled.

1 Like

Thank you @marpet for the detailed illustration. Let me try it out.

Hi there,

I am new to SNAP and I have a question about resampling too. I have opened a Sentinel-2 L2A .xml file in SNAP and wish to resample all bands to 10m spatial resolution. I used the tool from Raster > Geometric Operations > Resampling

I defined the size of the resampled product from source product “B4”, which I think should result in all bands having 10m spatial resolution.

When I check the metadata for the resampled product it says the spatial resolution of B1 is 60m

I checked the metadata here: Metadata/Level_2A_User_Product/General_Info/Spectral_Information_List/Spectral_Information

Does this mean the resampling didn’t work, or am I looking in the wrong place?

Also, (not sure if it matters) I had subset the image before resampling.

The metadata is changed changed by the resampling.
You can check the size of the images by selecting it in the product tree and open the Information Window image
There the size is shown. If all bands have the same, then the resampling worked.

Depending on how you want to use the resulting resampled data it might be better do use the dedicated S2 resampling tool (Optical / Geometric / S2 Resampling Processor).
Have a look in the help there the reason is explained or check this thread.
Tile border bug? - s2tbx - STEP Forum (esa.int)
in a nutshell, if you want to use the view angles in subsequent steps you better use the special resampler.

1 Like