# SDR ValueError: Bounding boxes do not intersect

**URL:** <https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522>\
**Category:** Software Support\
**Tags:** sdr\
**Created:** [November 20, 2020, 6:16pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522 "2020-11-20T18:16:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [November 20, 2020, 6:16pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/1 "2020-11-20T18:16:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [November 20, 2020, 6:29pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/2 "2020-11-20T18:29:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [November 20, 2020, 8:25pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/3 "2020-11-20T20:25:42Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/9bVYErkrtm2VUirgnvGAy54nYzN.txt) (3.7 KB)

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [November 20, 2020, 8:32pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/4 "2020-11-20T20:32:46Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [November 25, 2020, 5:50pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/6 "2020-11-25T17:50:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [November 29, 2020, 9:49pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/7 "2020-11-29T21:49:58Z")

</div>

hey buddy, have u received my mail?

cheers.

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [November 30, 2020, 2:00pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/8 "2020-11-30T14:00:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [November 30, 2020, 2:01pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/9 "2020-11-30T14:01:50Z")

</div>

Hi @MuriloArima,

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

Doug

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [November 30, 2020, 3:04pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/10 "2020-11-30T15:04:11Z")

</div>

@MuriloArima,

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

```auto
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

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [December 1, 2020, 6:52pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/11 "2020-12-01T18:52:39Z")

</div>

@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?

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/e/e950cb13c32c157c12dd2b1500f5fcc3199841cd.png)

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [December 2, 2020, 1:28pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/12 "2020-12-02T13:28:24Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/469c9YFwAVRb1PamdtIsy22Md1R.zip) (10.6 KB)

Cheers,

Doug

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [December 3, 2020, 12:37am UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/13 "2020-12-03T00:37:29Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/6/6aa3112314763796a7aa485c2647058412141c20.png)

The log file is linked below:

[InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-12-02–19\_19\_45.txt](https://community.naturalcapitalalliance.org/uploads/short-url/bfE5odjiYEbZZ8FiBYUgME4NIkz.txt) (58.1 KB)

Cheers, have a nice week

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [December 3, 2020, 4:13pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/14 "2020-12-03T16:13:20Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/bjm1DSCoewIzAZ7ezlZcodFmQnt.tif) (1.6 MB)

Doug

---

<div class="post-metadata">

**Author:** ![MuriloArima](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/muriloarima/32/575_2.png) [@MuriloArima](https://community.naturalcapitalalliance.org/u/MuriloArima)\
**Post date:** [December 4, 2020, 3:03am UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/15 "2020-12-04T03:03:51Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/99nwsIcKPxE5S4hJGOe8BJo2Vhk.txt) (14.7 KB)

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [December 4, 2020, 1:11pm UTC](https://community.naturalcapitalalliance.org/t/sdr-valueerror-bounding-boxes-do-not-intersect/1522/16 "2020-12-04T13:11:05Z")

</div>

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](https://community.naturalcapitalalliance.org/uploads/short-url/bKhgo3BFjhNuQoJjuUdhq5srYCn.tif) (1.6 MB)

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

Have a great weekend,

Doug
