I try to convert raster tif
or netcdf
file to ee.Image
Google Earth Engine object in Python. The netcdf
raster testing data (5-bands) is in this link. Here I converted the first band from raster file to ee.Image
but throwed errors indicating invalid data types.
import rioxarray
import ee
import xarray as xr
ds=rioxarray.open_rasterio("testdata.nc", masked=True)
# Rename
ds.name="raster"
# Select the first band and convert it to GEE image
band=ds.isel(band=0)
band=ee.Image(band)