rioxarray icon indicating copy to clipboard operation
rioxarray copied to clipboard

Allow rio.to_raster with a BytesIO object

Open SarahG-579462 opened this issue 2 years ago • 3 comments

Please consider adding support for in-memory rasterizing, rasterio supports this with MemoryFile, which could be written to a BytesIO object for easier cross-compatibility.

SarahG-579462 avatar Apr 14 '23 19:04 SarahG-579462

Related: https://github.com/corteva/rioxarray/discussions/204

snowman2 avatar Apr 14 '23 19:04 snowman2

This works, as recommended in the planetary computer documentation.

with io.BytesIO() as buffer:
    d.rio.to_raster(buffer, driver="COG")
    buffer.seek(0)

jessjaco avatar May 16 '23 23:05 jessjaco

Related #309

snowman2 avatar May 24 '23 01:05 snowman2