1

I want to isolate some surface water areas on Landsat 8 images by using the Global Surface Water dataset in GEE as mask. After mapping both in the Editor I realized the positions of pixels of GSW and Landsat8 do not align, instead there is an offset in both dimensions (see image).

I did simply load and display the data. Didn't reproject any, as GEE states to harmonize Layers automatically. Looking in the properties of the images there are different projections assigned to them (LS: EPSG:32624 and GSW: EPSG:4326).

Is it necessary to reproject one of the layers?

I did try the function .register(), which should find displacements and correct them. However the output layer didn't have any changes in pixel position.

var LC08_CE1_2019= ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_217063_20190819');
var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater');
var extentGSW = gsw.select('max_extent') 
  .clip(Ceara)
  .unmask(0);
var regGSW= extentGSW.register({referenceImage: LC08_CE1_2019.select('B1'), maxOffset:15.0, patchWidth:60.0, stiffness:10});

enter image description here

2
  • The question was marked as off-topic. Is this not the right forum for this issue? Or is the answer just too trivial? I am not able to find many information on how to solve this in stack exchange nor on other websites..
    – elewe
    Nov 25 '19 at 9:40
  • 1
    You need to use reproject! var LC08_CE1_2019= ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_217063_20190819'); Map.addLayer(LC08_CE1_2019) Map.centerObject(LC08_CE1_2019, 8) var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater'); var extentGSW = gsw.select('max_extent') .clip(LC08_CE1_2019.geometry()) .unmask(0); Map.addLayer(gsw) var reproject = gsw.reproject(LC08_CE1_2019.projection()) Map.addLayer(reproject)
    – Jobbo90
    Nov 25 '19 at 11:24
0

Since the question has been updated i'll repost the answer from comments. But you can use reproject.

var LC08_CE1_2019= ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_217063_20190819');
var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater');
var extentGSW = gsw.select('max_extent') 
  .clip(geometry)
  .unmask(0);
var regGSW= extentGSW.register({referenceImage: LC08_CE1_2019.select('B1'), maxOffset:15.0, patchWidth:60.0, stiffness:10});

ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_217063_20190819'); 
Map.addLayer(LC08_CE1_2019) 
Map.centerObject(LC08_CE1_2019, 8) 
var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater'); 
var extentGSW = gsw.select('max_extent').clip(LC08_CE1_2019.geometry()).unmask(0); 
Map.addLayer(gsw) 
var reproject = gsw.reproject(LC08_CE1_2019.projection()) 
Map.addLayer(reproject) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.