1

I am trying to convert a numpy array to a raster that I can open in ArcGIS. When queried through numpy, the values of the array seem reasonable and correct for my purposes. An image of the array plotted through Python looks exactly like expected.

>>> numpy.min(three)
0.0
>>> numpy.max(three)
36.222499999999997
>>> numpy.mean(three)
0.017112844231034222

However, when I convert the numpy array to a raster and open it in ArcGIS, the raster contains erroneous values and will not display.

newdsm = arcpy.NumPyArrayToRaster(three, "", 0.1, 0.1)
newdsm.save("newdsm.tif")

erroneous values in table of contents

What do I need to do in order to convert the numpy array correctly? I am using Python v2.7 and ArcGIS v10.4. It is a single-band square raster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.