I typically read large raster data using gdal and setting up a moving window of 256*256 pixels (for example).
I recently had to do some processing using arcpy, so I did the same thing, using arcpy.RasterToNumPyArray.
This is incredibly slow compared to using the gdal equivalent. It is almost worth the hassle of exporting the raster to a gdal format and using gdal.
I was wondering why it is so slow. My only thought is that with each call to arcpy.RasterToNumPyArray, you must provide the file path...I imagine arcpy is then opening/closing the file and/or acquiring/releasing locks on each call. Seems like this could waste a certain amount of time.
Is there a more efficient method for iterating through windows of raster data in arcpy?
أكثر...
I recently had to do some processing using arcpy, so I did the same thing, using arcpy.RasterToNumPyArray.
This is incredibly slow compared to using the gdal equivalent. It is almost worth the hassle of exporting the raster to a gdal format and using gdal.
I was wondering why it is so slow. My only thought is that with each call to arcpy.RasterToNumPyArray, you must provide the file path...I imagine arcpy is then opening/closing the file and/or acquiring/releasing locks on each call. Seems like this could waste a certain amount of time.
Is there a more efficient method for iterating through windows of raster data in arcpy?
أكثر...