Select to view content in your preferred language

Wrong cell values after conversion to a NumPy-Array?

2997
1
10-15-2014 03:09 AM
AndréBaldauf
Deactivated User

Hello Comunity,

 

Due to my Bachelor Thesis I am working on some python-scripts für ArcGIS.

At the Moment, I develop a script for rastermanipulation by modifying the cell values. My dataset contains cell values from 1,000093 to 4,43723 metres, on which I want to perform some height-modification. Therefore, I convert the raster to a NumPy-array, which contains surprisingly cell values from -3,40282e+038 to 4,43723 metres.

How does this min-value came across my data?

I guess, it is a "nodata"-value which cause probles with the "float32"-datatype, but I am not sure.

Maybe I can find some help around here.

 

Regards,

André

0 Kudos
1 Reply
DallasShearer
Deactivated User

when running function RasterToNumPyArray (in_raster, {lower_left_corner}, {ncols}, {nrows}, {nodata_to_value})

try setting the -3,40282e+038 for the nodata_to_value parameter.

It could also be a product of the way the numpy creates it's arrays, by creating the array 1st with dummy values and then going and updating the values that correspond to the raster.