"Bounding Boxes do not intersect", in seasonal water yield model

What is the issue or question you have? I got the message: “Bounding boxes do not intersect,” what can I do about it?

What do you expect to happen? That the file would be running

What have you tried so far? Nothing

Attach the logfile here:Initializing…

Showing messages with level INFO and higher
2023-02-03 00:47:11,251 (natcap.invest.utils) utils.prepare_workspace(161) Level 100 Writing log messages to [C:\Users\49173\Documents\seasonal_water_yield_workspace\InVEST-Seasonal-Water-Yield-log-2023-02-03–00_47_11.txt]
2023-02-03 00:47:11,257 (natcap.invest.ui.model) model._logged_target(1626) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.seasonal_water_yield.seasonal_water_yield 3.12.1:
alpha_m 1/12
aoi_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/Baringo-Bogoria-Merccatchment.shp
beta_i 1
biophysical_table_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/biophysical_table_Baringo.csv
dem_raster_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/SRTM30_reproj_Mercator.tif
et0_dir C:/Users/49173/Documents/Seasonal Water Yield INPUTS/ETo_clipped
gamma 1
lulc_raster_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/ESACCI_reproj_Mercator.tif
monthly_alpha False
n_workers -1
precip_dir C:/Users/49173/Documents/Seasonal Water Yield INPUTS/Rainfall data
rain_events_table_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/rain events_baringo.csv
results_suffix
soil_group_path C:/Users/49173/Documents/Seasonal Water Yield INPUTS/curve number proj - Mercator.tif
threshold_flow_accumulation 100
user_defined_climate_zones False
user_defined_local_recharge False
workspace_dir C:\Users\49173\Documents\seasonal_water_yield_workspace

2023-02-03 00:47:11,307 (natcap.invest.seasonal_water_yield.seasonal_water_yield) seasonal_water_yield._execute(421) INFO prepare and test inputs for common errors
2023-02-03 00:47:11,421 (natcap.invest.seasonal_water_yield.seasonal_water_yield) seasonal_water_yield._execute(487) INFO Building file registry
2023-02-03 00:47:11,422 (natcap.invest.seasonal_water_yield.seasonal_water_yield) seasonal_water_yield._execute(493) INFO Checking that the AOI is not the output aggregate vector
2023-02-03 00:47:11,422 (natcap.invest.seasonal_water_yield.seasonal_water_yield) seasonal_water_yield._execute(502) INFO Aligning and clipping dataset list
2023-02-03 00:47:11,625 (taskgraph.Task) Task.add_task(706) ERROR Something went wrong when adding task align rasters (0), terminating taskgraph.
Traceback (most recent call last):
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task.py”, line 1093, in _call
File “pygeoprocessing\geoprocessing.py”, line 752, in align_and_resize_raster_stack
File “pygeoprocessing\geoprocessing.py”, line 3326, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-5424300.901326116, -36979.128442064415, -5348089.11590503, 72395.09794295426], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [-5424268.3983, -36869.0123, -5348189.6425, 72363.3298], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [-5424299.1879, -36970.6982, -5348096.4709, 72393.307], [-5424300.5533, -36974.88829999999, -5348105.4634, 72373.7903]] mode: intersection result: [35.550003211945295, -0.3525817000000018, -5348189.6425, 0.7188443000000007]
2023-02-03 00:47:11,629 (natcap.invest.utils) utils.prepare_workspace(166) ERROR Exception while executing Seasonal-Water-Yield
Traceback (most recent call last):
File “natcap\invest\utils.py”, line 164, in prepare_workspace
File “natcap\invest\ui\model.py”, line 1632, in _logged_target
File “natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 406, in execute
File “natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 553, in _execute
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task.py”, line 1093, in _call
File “pygeoprocessing\geoprocessing.py”, line 752, in align_and_resize_raster_stack
File “pygeoprocessing\geoprocessing.py”, line 3326, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-5424300.901326116, -36979.128442064415, -5348089.11590503, 72395.09794295426], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273], [-5424268.3983, -36869.0123, -5348189.6425, 72363.3298], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [35.531092700000016, -0.3525817000000018, 36.423947700000014, 0.7188443000000007], [-5424299.1879, -36970.6982, -5348096.4709, 72393.307], [-5424300.5533, -36974.88829999999, -5348105.4634, 72373.7903]] mode: intersection result: [35.550003211945295, -0.3525817000000018, -5348189.6425, 0.7188443000000007]
2023-02-03 00:47:11,633 (natcap.invest.utils) utils.prepare_workspace(169) INFO Elapsed time: 0.38s
2023-02-03 00:47:11,633 (natcap.invest.utils) utils.prepare_workspace(172) INFO Execution finished

Hello @IHartmann ,

This error message can be a little difficult to decipher, but it’s saying that one or more of your input layers have different spatial projections, when the model expects that all rasters must have the same spatial projection and they must also all overlap.

Would you please verify that all of your spatial inputs to the model have the same spatial projection and coordinate system and try re-running the model?

Thanks,
James

Dear James,
many thanks for your response. I have meditated now for long over the data, but did not find a solution. I do not find an issue with the projections. Above all, because the model would not start running, if not all data are correclty in the same projection? Then I thought, maybe it is the rain events table. Do I have to write them pairwise per month under each other, or in two lines with 12 parameters for each month? Because in your data examples, there are the two versions, and I do not know, which would fit for me. Finally, Can’t you perhaps from the logfile, in which file of my data the failure occured? Many thanks! Cheers. Ingrid

Maybe I can attach here the rain events table. I also attach the first Eto-file, maybe it has a too high raster?
rain events_baringo.csv (79 Bytes)

REF Eto-1.tif (444 Bytes)
I also wanted to upload the catchment file, but could not, because it is a shapefile. Is that what could be wrong?
Cheers
Ingrid

Would you please share your complete set of inputs with me so I can take a closer look? Feel free to share them with a file sharing services such as google drive, OneDrive or Dropbox if you would prefer. My email is jdouglass@stanford.edu, or you can just include the link to the shared folder here in the thread.

Thanks,
James

Dear james, thank you so much. That is very kind!
I will send by we-transfer.
Cheers
Ingrid

@IHartmann thank you for sharing your inputs! I have received them and will take a look soon.

Dear James, many thanks. I just want to add, that there are three lakes in the watershed, which might complicate the issue… One can see them in the watershed file…Cheers. Ingrid

And I also would like to add, that I would appreciate, if you could care for it somewhat soon, because there are people waiting for my results…Cheers again.
Ingrid

Hi @IHartmann -

We are in a workshop for the next few days, so might not have time to look at your results until afterward. In the meantime, look at the Properties of each of your input layers and compare the coordinate systems. You should find that most of them have the same one, but two others have something different. You’ll need to reproject/warp some of them to match the others, and make sure that they are in a projected (not geographic) coordinate system.

To understand the specific error message better, if you look at the list of bounding boxes, you can see that there are two different sets of coordinate values listed:

[-5424300.901326116, -36979.128442064415, -5348089.11590503, 72395.09794295426]
and
[35.550003211945295, -0.40000075101852417, 36.40000322461128, 0.8499992676079273]

So you can also look at the Extent shown in each layer’s Properties, and determine which layers have a different extent/bounding box that way.

~ Stacie

1 Like

Dear Stacie, so many thanks. Will try that inbetween. Have a nice Workshop!
Cheers
Ingrid

Dear all,
inbetween, the model had already read my files. Now it is stuck with my biophyiscal table. Alas, I have checked it again and again, but did not find a mistake with it. I am attaching the logfile, and my biophyisical table and the file with my curve numbers. Maybe you see something there, which I did not find. Many thanks.
Cheers and many thanks!
Ingrid
Log and Error Message.txt (5.7 KB)
biophysical_table_Baringo.csv (714 Bytes)
CN-number.tif (266.4 KB)

Dear Stacie and James,
I just wanted to say, that now the bounding boxes do intersect, but I have a problem with the biophysical table, which I posted to the user forum.
(To avoid confusions…)
Best
Ingrid

1 Like

Hi @IHartmann , I’m glad you were able to resolve the bounding box/projection issue!

This new error message you are getting is actually in reference to your soil group raster. Specifically, the model requires that your soil group raster has pixel values of 1, 2, 3, or 4. Any other values aside from an assigned nodata value will cause the model to fail, as it did here on a value of 6. There is some guidance in the user’s guide about soil group data that may be useful: Data Sources — InVEST documentation

Please let us know if you have any further questions,
James

1 Like

thank you so much! It worked. Tomorrow I will continue then with the SDR model. Cheers. Ingrid

2 Likes

Great to hear! I’ll mark this thread as resolved, then.

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