IlwisCore icon indicating copy to clipboard operation
IlwisCore copied to clipboard

optional contiguous memory handling for NumPy buffer access

Open pokulo opened this issue 11 years ago • 2 comments

There is a straight forward way of handling grid data (std::vector) directly as numpy.array via the Py_buffer protocol. I already implemented a rough way catching the PixelIterators current pointer to a double. To keep it safe and handy the RasterCoverage and/or the PixelIterator need an interface to get the raw pointer and the size of the contiguous memory.

pokulo avatar Jan 13 '14 16:01 pokulo

hmm. I dislike exposing these kind internal details to the outside world. problem is that ilwis-objects for obvious reasons ( memory limitations) doesnt use contiguous memory. So exposing it is only a partial solution that will fail in a number of cases.

MartinSchouwenburg avatar Jan 28 '14 07:01 MartinSchouwenburg

a Python API solution would be a derived BlockIterator that knows about the internal memory block size, which is then used in combination with numpy's direct memory access

pokulo avatar Jan 28 '14 10:01 pokulo