Closed ohadshapira closed 2 months ago
The array_to_image
function uses rio.to_raster
under the hood. You can try converting the xarray.DataArray to rioxarray by setting crs and transform.
https://corteva.github.io/rioxarray/html/examples/convert_to_raster.html#Converting-DataArray-to-raster
It seems like the missing part was:
hypercoast.aviris_to_image(ds,output="test4"**,cellsize=32,crs="EPSG:3857"**)
It is mandatory input for 'leafmap.array_to_image' (in both aviris_to_image and pace_to_image).
The only issue now is that when reading and immediately saving the ds
, I get different file sizes (original vs. saved)
This issue has been fixed in the upstream leafmap package. See https://github.com/opengeos/leafmap/pull/869
Once the package is updated, you should be able to use the following to save the DataArray as an image.
hypercoast.aviris_to_image(dataset, wavelengths=[400, 500, 600], output="aviris.tif")
Leafmap v0.36.6 has been released. Please update it using pip install -U leafmap
and try the aviris_to_image()
function again.
Environment Information
Description
Trying to save AVIRIS HSI file as an image. Have been failing due to an incompatible connection to leafmap