I am attempting to use the python lidar
package function lidar.ExtractSinks()
. I have a raster dataset that looks like the following.
Not a very useful image, but it gets the point across that I am only interested in the white area. The rest of it has been clipped, masked, or something to remove actual elevation values. This area is causing problems with the function.
At this stage, I have attempted to replace 0 values with nodata
I believe based on another post using rasterio src.nodata = 0 # set the nodata value
. The reason I think This worked is that my data histogram now looks like the following, whereas before the histogram showed that I had a huge number of cells of value 0.
Regardless of whether I apply this change to the black cells in the raster image, I receive the following error: AttributeError: module 'numpy' has no attribute 'float'.
, which can be traced back to a line in the source code of the function: max_elev = np.float(np.max(dem[dem != no_data]))
. This line is what makes me think this is a NoData cells issue. The documentation of the error suggests that np.float
is deprecated and to use float
instead, but this is not my code, so I cannot change it.
Any suggestions as to how to get around this, or if I am even correct about the issue?
Also, if it would be helpful to post more of the code I have used please let me know.
Thanks!