Google Earth Engine – How to Adjust Spatial Resolution of a Band

google-earth-engineremote sensingsentinel-1sentinel-2

In LANDSAT

var mndwi = ee.Image("LANDSAT/LC08/C01/T1_RT_TOA/LC08_148044_20130425").normalizedDifference(['B3', 'B6']).rename('MNDWI')

gives us MNDWI Band

In Sentinel 2 the resolutions of Green Band (B3 is 10m) and SWIR Band (B11 is 20m) are different.
How to change SWIR Band to be finer resolution so that I can apply normalized difference?

Best Answer

Yes, you can directly apply the normalized difference between Green and SWIR without any issues. You can even apply any kinds of calculation between Green band of Sentinel and SWIR band of Landsat or whatever data source if you would like to.

In Google Earth Engine, the resolution of the resulting MNDWI (or Landsat/Sentinel/MODIS image) is dynamic, i.e. undetermined until you ask GEE to do something that requires a determined resolution.

For example, when you add the resulting MNDWI image to Map (using Map.addLayer(mndwi)), GEE will determine the resolution of this image on the fly based on your current zoom level. If you want to fix a single resolution, says 10m, for your image, simply add mndwi = mndwi.reproject(mndwi.projection(), null, 10) before adding your image to Map.

When exporting an image, GEE requires you to specify a resolution for your image, usually via the scale argument. Yes you can pick any value for the resolution.

More on image resolution in GEE from here.