SDR error: exception encountered in raster_calculator

I am trying to run the SDR model and I’ve been running into an error that seems to involve the raster_calculator function. Looking around on these forums I had the impression that these might be related to how NA values are coded in my .tif rasters. I thought that this meant I should reclassify NA cells to not be based on 0, but this does not seem to have fixed things. Any insight on what the error messages might mean would be helpful. I’ve attached the log file.
InVEST-natcap.invest.sdr.sdr-log-2023-05-05–15_51_41.txt (11.1 KB)

1 Like

Hi @KLI -

If your NoData value is set, and you’ve verified that all of the values in your land use/land cover map have an entry in the biophysical table, then I’m not sure what’s causing this error. If you can send me your data I’ll take a look at it. The best way to do it is this:

1/ In InVEST Workbench, go to the tab where you’re entering your model inputs.
2/ Click on “Save As…” in the left side of the screen.
3/ In the “Datastack options” window that appears, click on “Parameters and data”.
4/ Give the output file a name (leaving it as the default is fine too), and make sure that the file extension is “.tgz”.
5/ Save the file and send it to me at


~ Stacie

Thanks for posting @KLI,

@swolny, looking at the log this looks a bit more complicated than a nodata / table issue I think. It very well could be an edge case bug in one of our functions.

@KLI if you’re able to, could you also share your data with me as well using the instructions Stacie provided. My email is Or Stacie could forward it along as well!



Hi @KLI,

Thanks for sharing your data, there is indeed a pretty neat bug in the model. The bug stems from the DEM raster input having a nodata value of nan. While we work on a general solution to the problem, a workaround would be defining a non nan nodata value to the DEM input. That should do it.

Please report back if you run into other issues!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.