Open dbaldig opened 1 year ago
Sorry, I'm dealing with another issue. Let me know if you want me to open another issue seperately.
elevation = 'C:/Users/.../DEM_filled.tif' slope = 'C:/Users/.../slope.tif' roughness = 'C:/Users/.../roughness.tif' tri = 'C:/Users/.../tri.tif' tpi = 'C:/Users/.../tpi.tif' ndvi = 'C:/Users/.../ndvi.tif' annual_prec = 'C:/Users/.../annual_prec.tif' aspect = 'C:/Users/.../aspect.tif' etc.
predictor_files = [elevation, slope, roughness, tri, tpi, ndvi, annual_prec, aspect, etc.] stack = Raster(predictor_files) stack.names
stack.names returns the actual dict_keys for most of the rasters but as soon as I add annual_prec and/or "aspect" to predictor_files, it returns an empty "dict_keys([])". The path is correct and the resolution is also the same. Any idea why this could be? It seems like it's quite random, cause I had a third raster which didn't work at first, but works now after processing it just the same way as before.
Thanks a lot!
EDIT: So, I can stack the layers with rasterio and then load the stacked raster with pyspatialml. The bands are renamed by pyspatialml to stack_01, stack_02, etc. When I try to rename the the bands, I get the "read() takes 1 positional argument but 2 were given" and "read() takes 1 positional argument but 2 were given" errors but it eventually renames the names. In the end, I got the model running like that.
Dear @dbaldig & @stevenpawley I'm getting the same error. I'm wondering if you find an alternative solution. Thanks Giuseppe
Hi, same issue. Raster() used to work just fine last year but now, I get
TypeError:` 'NoneType' object is not subscriptable
see at the bottom of this page for a solution https://spatial-ecology.net/docs/build/html/CASESTUDY/Tree_Height_03RF_pred.html?highlight=pyspatialml
Hey Steven, first of all, thanks a lot for your package...it's such a great help!
I followed along your Multi-Target Spatial Prediction using the Meuse Dataset tutorial to modify it for a RF implementation. I tried to work with a stacked raster dataset of mine but eventually always run in the same error. For example, when executing this code:
it returns an:
Do you have an idea what could cause this? I made sure that all rasters have only one band