Hi,
I'm trying to convert a Feature Class with attribute fields of X, Y and a Level (effectively Z) to an array and then to a raster for further processing.
The conversion to an array works using the command:
Where fc is the input Feature Class.
When I then try and covert it to a raster to be able to do spatial analysis functions I get the error "Argument in_array: Expected a two-dimensional Numpy array"
The code I'm using is:
I can perform array operations like adding up the level using array["Level"].sum() but the array.shape only gives me one number.
Where am I going wrong?
Thanks
I'm trying to convert a Feature Class with attribute fields of X, Y and a Level (effectively Z) to an array and then to a raster for further processing.
The conversion to an array works using the command:
Code:
array = arcpy.da.FeatureClassToNumPyArray(fc,["OID@", "SHAPE@XY", "Level"], spatial_reference=SR)When I then try and covert it to a raster to be able to do spatial analysis functions I get the error "Argument in_array: Expected a two-dimensional Numpy array"
The code I'm using is:
Code:
myRaster = arcpy.NumPyArrayToRaster(array)Where am I going wrong?
Thanks