Xee icon indicating copy to clipboard operation
Xee copied to clipboard

Xee does not provide correct data for resampled image

Open deepgabani8 opened this issue 1 year ago • 3 comments

When I use ee.data.computePixels, it returns different data for different resample methods, which it should but fetching data using xee as backend returns the same data.

Using ee.data.computePixels, which gives different data for resample methods = ['bilinear', 'bicubic'].

image = ee.Image(image_id)
image = image.resample('bilinear').reproject(crs=crs, crsTransform=crs_transform)
image = image.clip(
    ee.Geometry.Rectangle(
      [[-180, -90], [-90, -45]],
      None,
      geodesic=False,
  )
)

data = np.load(io.BytesIO(ee.data.computePixels({
    'expression': image,
    'fileFormat': 'NPY',
})))

Using Xee as the backend, which gives the same data for resample methods = ['bilinear', 'bicubic'].

image = ee.Image(image_id)
image = image.resample('bilinear').reproject(crs=crs, crsTransform=crs_transform)
geom = ee.Geometry.Rectangle(
    [[-180, -90], [-90, -45]],
    None,
    geodesic=False,
)

ds = xr.open_dataset(
  ee.ImageCollection([image]), projection = image.projection(), geometry=geom,
  engine=xee.EarthEngineBackendEntrypoint,
)

var = list(ds.data_vars)[0]
data = ds[var].data[0,:,:].T

deepgabani8 avatar Feb 26 '24 10:02 deepgabani8