SDR ValueError: Bounding boxes do not intersect

Good day researchers, i’m facing an error when execute invest sdr in a Brazilian watershed, i don’t know what kind of problem is this one, can someone help?

Which variables i can modify to fix this problem ? Thanks a lot.

Here’s invest error log

Best Wishes

2020-11-19 15:40:29,293 Task.add_task(641) ERROR Something went wrong when adding task align input rasters (0), terminating taskgraph.
Traceback (most recent call last):
File “site-packages\taskgraph\Task.py”, line 607, in add_task
File “site-packages\taskgraph\Task.py”, line 1071, in _call
File “site-packages\pygeoprocessing\geoprocessing.py”, line 698, in align_and_resize_raster_stack
File “site-packages\pygeoprocessing\geoprocessing.py”, line 3181, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-55.054670309158325, -19.653608800436817, -53.29184949548659, -18.26817925742489], [703947.2437995224, 7822608.416305953, 892200.9841003647, 7979052.541576396], [703952.0489212618, 7822599.757177031, 892205.7555445489, 7979073.444794752], [703948.938071518, 7822596.048450897, 892202.5957082794, 7979069.695351746], [703961.9683850275, 7822610.926465942, 892186.0447125471, 7979054.990535052]] mode: intersection result: [703961.9683850275, 7822610.926465942, -53.29184949548659, -18.26817925742489]
2020-11-19 15:40:29,294 model._logged_target(1648) ERROR Exception while executing <function execute at 0x10CCAC00>
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1645, in _logged_target
File “site-packages\natcap\invest\sdr\sdr.py”, line 350, in execute
File “site-packages\taskgraph\Task.py”, line 607, in add_task
File “site-packages\taskgraph\Task.py”, line 1071, in _call
File “site-packages\pygeoprocessing\geoprocessing.py”, line 698, in align_and_resize_raster_stack
File “site-packages\pygeoprocessing\geoprocessing.py”, line 3181, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-55.054670309158325, -19.653608800436817, -53.29184949548659, -18.26817925742489], [703947.2437995224, 7822608.416305953, 892200.9841003647, 7979052.541576396], [703952.0489212618, 7822599.757177031, 892205.7555445489, 7979073.444794752], [703948.938071518, 7822596.048450897, 892202.5957082794, 7979069.695351746], [703961.9683850275, 7822610.926465942, 892186.0447125471, 7979054.990535052]] mode: intersection result: [703961.9683850275, 7822610.926465942, -53.29184949548659, -18.26817925742489]
2020-11-19 15:40:29,295 model._logged_target(1651) INFO Execution finished
2020-11-19 15:40:29,296 utils.prepare_workspace(121) INFO Elapsed time: 0.21s

Hey @MuriloArima,

Thanks for posting and sorry for the SDR troubles. Could you take a look at your watershed, DEM, and LULC inputs in QGIS or ArcGIS to make sure that they overlap in space? It seems that some of the inputs might not overlap which is causing the error. Also, it would be helpful if you could attach your logfile as well as opposed to a copy paste of the error.

Thanks!

Doug

hi Doug, how are u mate?

i guess that everything is fine, because i use same shape to create WS, DEM e LULC, also the same linear reference, UTM 21S - any idea what could happened?

sure, here is log file InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-11-19–15_38_09.txt (3.7 KB)

Hey @MuriloArima,

I see you’re using InVEST 3.8.0. We’ve made a lot of enhancements and bug fixes since then and are actually close to an InVEST 3.9 release. Could you try downloading and running this development version of InVEST?

https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.8.9.post885%2Bg4cda085b/InVEST_3.8.9.post885%2Bg4cda085b_x64_Setup.exe

Could you also check that erodibility and erosivity raster files overlap with the others? It looks like one of these files might be in a WSG84 lat / long projection?

If nothing jumps out after trying the above, would you be willing to share your inputs? You could zip them up to Google Drive, Dropbox, etc, and either share a link here or to my email address at ddenu@stanford.edu.

Cheers,

Doug

hi doug, i’ve sent u in your email a link to my files because i couldn’t find the issue.

i hope u get it, thanks for u help

cheers

best regards.

hey buddy, have u received my mail?

cheers.

Hi @MuriloArima, thanks for your patience as it has been a holiday for us in the US. Can you confirm that you have tried the version of InVEST that Doug linked above (or the latest release: 3.8.9) ?

Do you have a logfile from that latest version to share with us? Thanks

Hi @MuriloArima,

I did get your email! As Dave mentioned, we had a long weekend for the Holiday. More soon.

Doug

@MuriloArima,

It looks like you’re Watershed shapefile is projected in Lat/Long even though the CRS indicates UTM zone 21S.

Extent
-55.0546703091583254,-19.6536088004368139 : -53.2918494954865878,-18.2681792574248902

This can sometimes happen when setting the projected of a vector or raster file as opposed to projecting. If you define the Watershed shapefile to a WGS84 projection in QGIS or ArcGIS, and then re-project that to UTM zone 21s, I think it should fix the issue.

Best,

Doug

1 Like

@dcdenu4 @dave

good day lads,

i’ve tried both solutions that you said, seems none worked

now the software shows a inconsistent data as shown in this printscreen

also i’m using ArcGis, is there any guide of how to solve this issue correctly?

Hi @MuriloArima,

Sorry you’ve had trouble with this, it can definitely be a pain. In QGIS I did the following:

  • Right click Bacia_Coxim_UTM and Set CRS to EPSG:4326 WGS84
  • Under the Vector menu tab, reproject layer to EPSG: EPSG:32721 - WGS 84 / UTM zone 21S

Find attached the output. Please try using that and let us know if it works!

Bacia_Coxim_UTM_fixed.zip (10.6 KB)

Cheers,

Doug

hey @dcdenu4

thanks for your help

it worked, (invest sdr model ran) but my log shows an error about value error

" ValueError: Values in the LULC raster were found that are not represented under the ‘lucode’ column of the Biophysical table. The missing values found in the LULC raster but not the table are: [128]."

seems 128 it’s linked to no data, but i’m not so sure because this value does not exist in my LULC raster

The log file is linked below:

InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-12-02–19_19_45.txt (58.1 KB)

Cheers, have a nice week

Hey,

Just did some digging around and it looks like this is a bug in how we handle GDAL raster BYTE type and the metadata associated with it. The nodata values for the LULC are really -128, but are displaying as +128 because of the BYTE type and how ArcGIS / QGIS load those data.

Anyway, this bug will be fixed in InVEST 3.9. In the meanwhile, can you try using this int16 version of your LULC? That should do the trick.

usodosoloUTM_int16.tif (1.6 MB)

Doug

hi @dcdenu4 still not working, same error

sorry to bother you about this issue

i’ve tried everything i know about gis data, but all my attempts not worked

anyway, i would like to know if my data is working correctly in another pc, if so, i hope that there is anything that i could in my workstation.

Cheers, have a nice weekend

InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-12-03–22_51_17.txt (14.7 KB)

Hey @MuriloArima,

That’s my fault! Didn’t notice that when I converted the datatype that it did not set the nodata values properly. Please now try the following LULC. I tested this on my machine and it runs through without any errors.

usodosoloUTM_int16_fixed.tif (1.6 MB)

Sorry about that! Please let me know right away if this isn’t working either.

Have a great weekend,

Doug

2 Likes