Error NDR model 3.6.0.post515

Hi,Im receiving an error during the run of a NDR model.
Attached you can find the log file.
Thank you in advance for the help!
InVEST-Nutrient-Delivery-Ratio-Model-(NDR)-log-2019-05-21–16_00_06.txt (3.4 KB)

Hi @Prime -

It looks like you’re using a development version of InVEST, which can be buggy. Can you please try the new release version (3.7.0) and let us know if the problem still happens? Thanks!

~ Stacie

Hi Stacie,
I follow your advice and try the new release version(3.7.0),but the problem still happen.And i try the version(3.6.0) and (3.5.0),the model could run successfully, but the result is not what I want.Also,I tried to change the parameter “Borselli k paramete” for calibration,the result does not change.
Attached the screenshot of the error.
Thank you for your help!

Hi @Prime -

It is most useful if you can post the whole log file (like you did in the first post), so we can see your inputs and any other messages.

Are you still using an ESRI GRID for the runoff proxy input? Does anything change if you save that as a TIFF and try again?

~ Stacie

Hi Stacie,
The file format that i save is TIFF.

Here are the log.
I would like to upload the input data,but the zip seems a little big and a problem about the upload
Thanks!

Prime
InVEST-Nutrient-Delivery-Ratio-Model-(NDR)-log-2019-05-22–08_57_58.txt (3.3 KB)

Hi Prime -

Thanks for the log file. I’m still learning about Taskgraph, so am not familiar with this error, but the first thing I would look at is whether the rasters listed in the error were actually created in your Workspace:

Expected: [u’e:\\output\\ndr\\intermediate_outputs\\cache_dir\\aligned_dem.tif’, u’e:\\output\\ndr\\intermediate_outputs\\cache_dir\\aligned_lulc.tif’, u’e:\\output\\ndr\\intermediate_outputs\\cache_dir\\aligned_runoff_proxy.tif’]

If you can upload your input data somewhere that I can access it (Dropbox, Google Drive, Box, whatever), I’ll see if I can replicate the issue.

~ Stacie

Hi Stacie,
Here are the address of the data,please check it.

I hope this problem will be solved with your help.
Thanks!
~Prime

Hm, well I was hoping to do more debugging here, and I did get the same error as Prime, but don’t understand what’s going wrong. The error says

RuntimeError: In Task: align rasters (1)
Missing expected target path results.
Expected: [u’x:\\temp\\forums\\prime\\output\\intermediate_outputs\\cache_dir\\aligned_dem_t1.tif’, u’x:\\temp\\forums\\prime\\output\\intermediate_outputs\\cache_dir\\aligned_lulc_t1.tif’, u’x:\\temp\\forums\\prime\\output\\intermediate_outputs\\cache_dir\\aligned_runoff_proxy_t1.tif’]
Observed: set([])

and indeed none of those rasters exists. The input rasters look fine to me, and I don’t see any other error or warning that indicates that there are problems with the inputs. So @Rich, I’m going to have to punt to you…

~ Stacie

Hi, it looks like this issue is caused by a feature in GDAL we enabled called “cutline polygon”. It’s used to efficiently mask out a raster by a vector and usually works great. But sometimes there’s a polygon that has some invalid geometry that causes this to fail. With your polygon I see the following error in the terminal:

Warning 1: Ring Self-intersection at or near point 456116.77249104343 3304050.450901119
ERROR 1: Cutline polygon is invalid.

We were debating earlier if we were going to keep this functionality and just the fact that you’re encountering it means we should revert to the older functionality. That’ll take a little bit of work, but in the meantime if you can’t wait you can repair your watershed geometry I think things will work for you.

I’ll post here with a fixed version when we get it.

Hi rich,
Thank you for your kind information.I will follow your advice and try again.
~Prime

Hi rich,
I’ve received the same error during the run of a NDR model.
How can I repair my watershed geometry? The input vector looks fine to me…
Thanks
Priscila

Hi Priscila -

Which GIS are you using? There’s a Repair Geometry in ArcGIS that you can try. And QGIS has Check Geometries and Fix Geometries tools. Let us know if one of those tools helps.

~ Stacie

Hi Stacie,
I used “Repair geometry” tool in ArcGIS but I’ve come across with the same error described by Prime. I’m using the new release version (3.7.0). Should I try another (older) InVEST version?
Many thanks

Priscila

Hi,priscilai
The problem seem to be solved if you use Fix Geometries tool in QGIS. I have used Repair geometry tool in ArcGIS,the result is same to yours. So I suggest you the tool in QGIS.
Of course,the older InVEST version like 3.5.0 and 3.6.0 can run successfully.

~Prime

Hi,priscilai
The problem seem to be solved if you use Fix Geometries tool in QGIS. I have used Repair geometry tool in ArcGIS,the result is same to yours. So I suggest you use the tool in QGIS.
Of course,the older InVEST version like 3.5.0 and 3.6.0 can run successfully.

~Prime

Hi Prime,
Thank you for your advice. I’ve tried to fix geometries using QGIS 3.6.3 but the problem is still happening.
I will try an older InVEST version.
Kind regards,

Priscila