laptop and a wrench

Bug

NumPyArrayToRaster produces unexpected results when passed a view of a NumPy array.

Last Published: August 25, 2014 ArcGIS for Desktop
Bug ID Number NIM072404
SubmittedSeptember 7, 2011
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.0
Operating SystemWindows OS
Operating System VersionXP 64 Bit
Version Fixed10.1
StatusFixed

Workaround

z[:,::-1] creates a view of the array. NumPyArrayToRaster requires a NumPy array object.1) Pass np.array(z[:,::-1]) which creates a new copy of the array.ex. grid1=arcpy.NumPyArrayToRaster( np.array(z[:,::-1]),xyOrig,np.abs(dx),np.abs(dy))2) Use the .copy() method to create a new copy of the reorder array.ex. grid1=arcpy.NumPyArrayToRaster(z[::-1,:].copy(),xyOrig,np.abs(dx),np.abs(dy))

Steps to Reproduce

Bug ID: NIM072404

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options