AnsweredAssumed Answered

Script Zonal statistics: runtime error - cannot open file

Question asked by cianfabio on Jul 6, 2015
Latest reply on Jul 7, 2015 by xander_bakker
Branched to a new discussion

Hi everyone,

I'm running a script that it's basically zonal statistic over polylines (I modified one script that I found in this forum Zonal statistics - percentiles ).

The code takes a shape file containing the lines along which I want to analyse the elevation. For every line, it creates a raster (let's say it converts the line into a raster) where in every pixel it writes the corresponding elevation value. It analyses the values of the elevation along the line and returns the max, min and percentiles values. It repeats the same thing for all the lines in the shape file. 

The code is running without problems with a certain digital elevation model. Recently I received a new LiDAR file and I tried to run the code but I got an error:


RuntimeError: cannot open "line1.tif"


line1.tif is the line converted to raster. I checked the file and it is exactly the line in tif format with the right values of elevation. The folder in which it is stored, is the same as using the previous DEM.


The DEM and LiDAR have different resolution and therefore line1.tif in case of DEM in something like 2 KB and in case of LIDAR around 60 KB. This is the only difference I can notice.


Anyone has a clue of what is happening?

Thanks a lot