Re: Create a Dataset from an array


Sean Gillies
 

I feel it's too early to make a new function for this. First, I'd like to try to use this to eliminate the copying of data inside InMemoryRaster.


On Thu, Aug 19, 2021 at 3:39 PM <ayr035@...> wrote:
Hi Sean,

Thank you for the example code. It seems to work reliably enough for my use case. It was way easier than I imagined it being as I thought it might involve hacking the InMemoryRaster class. Would it be a desirable addition to make it easy for a user to do this in rasterio (at least a helper function generate the MEM string given an array)?

Wrapping the array in a Dataset does not seem to have much of a noticeable performance penalty if any at all. The performance of reading directly from the array (making a copy of any slices) and reading from the Dataset were almost identical.

Thanks again.


--
Sean Gillies

Join main@rasterio.groups.io to automatically receive all group messages.