Annual Water Yield-ValueError

Hi,everyone,
I’ve met a problem about the Water Yield Model, about the value error as follows,
2022-04-19 17:31:40,209 utils.prepare_workspace(109) INFO Writing log messages to C:\Users\huang\Documents\hydropower_water_yeild_workspace\output\InVEST-Hydropower-Water-Yield-log-2022-04-19–17_31_40.txt
2022-04-19 17:31:40,209 model._logged_target(1634) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.hydropower.hydropower_water_yield 3.6.0.post525+h31b10cfee0d4:
biophysical_table_path C:/Users/huang/Desktop/New folder/T1/Invest/biophysical table.csv
depth_to_root_rest_layer_path C:/Users/huang/Desktop/New folder/T1/Invest/rooted.tif
do_scarcity_and_valuation False
eto_path C:/Users/huang/Desktop/New folder/T1/Invest/ETO.tif
lulc_path C:/Users/huang/Desktop/New folder/T1/Invest/LULC2018.tif
n_workers -1
pawc_path C:/Users/huang/Desktop/New folder/T1/Invest/pawc.tif
precipitation_path C:/Users/huang/Documents/hydropower_water_yeild_workspace/Invest/rain.tif
results_suffix
seasonality_constant 15
sub_watersheds_path C:/Users/huang/Desktop/New folder/T1/Invest/Subwatersheds.shp
watersheds_path C:/Users/huang/Desktop/New folder/T1/Invest/Watershed.shp
workspace_dir C:\Users\huang\Documents\hydropower_water_yeild_workspace\output

2022-04-19 17:31:40,224 hydropower_water_yield.execute(101) INFO Validating arguments
2022-04-19 17:31:40,256 validation._wrapped_validate_func(148) DEBUG Validation warnings: []
2022-04-19 17:31:40,474 Task.add_task(636) ERROR Something went wrong when adding task align_raster_stack (0), terminating taskgraph.
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 685, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 3125, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-2637272.6032999996, 1878001.1308999984, 2207727.3967000023, 5920001.130900001], [67.98333332380429, 1.316666688310498, 136.53333332117023, 54.67500001959351], [-2645356.6032999996, 1869917.1309000012, 2221211.3967000004, 5928085.130900001], [-2745866.75, 1870782.625, 2370133.25, 5953782.625], [-2745866.75, 1870782.625, 2370133.25, 5953782.625], [-2745866.75, 1870782.625, 2370133.25, 5953782.625]] mode: intersection result: [67.98333332380429, 1878001.1308999984, 136.53333332117023, 54.67500001959351]
2022-04-19 17:31:40,474 model._logged_target(1640) ERROR Exception while executing <function execute at 0x0FA80530>
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1637, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\hydropower\hydropower_water_yield.py”, line 217, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 685, in align_and_resize_raster_stack
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 3125, in merge_bounding_box_list
ValueError: Bounding boxes do not intersect. Base list: [[-2637272.6032999996, 1878001.1308999984, 2207727.3967000023, 5920001.130900001], [67.98333332380429, 1.316666688310498, 136.53333332117023, 54.67500001959351], [-2645356.6032999996, 1869917.1309000012, 2221211.3967000004, 5928085.130900001], [-2745866.75, 1870782.625, 2370133.25, 5953782.625], [-2745866.75, 1870782.625, 2370133.25, 5953782.625], [-2745866.75, 1870782.625, 2370133.25, 5953782.625]] mode: intersection result: [67.98333332380429, 1878001.1308999984, 136.53333332117023, 54.67500001959351]
2022-04-19 17:31:40,474 model._logged_target(1643) INFO Execution finished
2022-04-19 17:31:40,474 utils.prepare_workspace(115) INFO Elapsed time: 0.27s

If someone can solve the problem, I will be very grateful for that, thanks.
The error details file is also attached.
InVEST-Hydropower-Water-Yield-log-2022-04-19–17_31_40.txt (4.3 KB)

Hi @yajiaoban,

The error message Bounding boxes do not intersect means that not all of your raster inputs overlap. This is the list of bounding box coordinates (the rectangular outline of each raster):

[-2637272.6032999996, 1878001.1308999984, 2207727.3967000023, 5920001.130900001], 
[67.98333332380429, 1.316666688310498, 136.53333332117023, 54.67500001959351], 
[-2645356.6032999996, 1869917.1309000012, 2221211.3967000004, 5928085.130900001], 
[-2745866.75, 1870782.625, 2370133.25, 5953782.625], 
[-2745866.75, 1870782.625, 2370133.25, 5953782.625], 
[-2745866.75, 1870782.625, 2370133.25, 5953782.625]]

As you can see, the second box in the list is very different from all the others. This one is probably in a different coordinate system.

I recommend checking that all your rasters are in the same projection since this model does not reproject them for you. Let me know if you still have trouble!

Thank you very much for your explanation, the problem has been solved.

1 Like

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