Null value in InVEST recreation model

Hi,

I have justed running InVEST recreation model. The model seemed to run successfully before with the different AOI. Currently, I tried with different AOI and it doesnt work. May I know the reason why my model it doesnt work successfully with different AOI?

Here my windows

2020-05-28 15:18:42,323 utils.prepare_workspace(115) INFO Writing log messages to G:/InVEST Recreation/InVEST_result/Try\InVEST-Recreation-Model-log-2020-05-28–15_18_42.txt
2020-05-28 15:18:42,324 model._logged_target(1642) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.recreation.recmodel_client 3.8.0:
aoi_path G:/InVEST Recreation/InVEST/InVEST Recreation/InVEST_running/rzwp3k_ntt_utm.shp
cell_size 700
compute_regression True
end_year 2017
grid_aoi True
grid_type hexagon
n_workers -1
predictor_table_path G:/InVEST Recreation/InVEST/InVEST Recreation/InVEST_running/predictors_run.csv
results_suffix
scenario_predictor_table_path
start_year 2005
workspace_dir G:/InVEST Recreation/InVEST_result/Try

2020-05-28 15:18:42,539 recmodel_client._grid_vector(545) INFO gridding aoi
2020-05-28 15:18:49,073 geos.callback(209) ERROR TopologyException: Input geom 0 is invalid: Self-intersection at or near point 483246.53083046369 8786148.1677377988 at 483246.53083046369 8786148.1677377988
2020-05-28 15:18:49,073 Task.add_task(641) ERROR Something went wrong when adding task grid_aoi (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\natcap\invest\recreation\recmodel_client.py”, line 560, in _grid_vector
File “site-packages\shapely\ops.py”, line 131, in cascaded_union
File “site-packages\shapely\geometry\base.py”, line 76, in geom_factory
ValueError: No Shapely geometry can be created from null value
2020-05-28 15:18:49,074 model._logged_target(1648) ERROR Exception while executing <function execute at 0x291F5DF8>
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1645, in _logged_target
File “site-packages\natcap\invest\recreation\recmodel_client.py”, line 326, 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\natcap\invest\recreation\recmodel_client.py”, line 560, in _grid_vector
File “site-packages\shapely\ops.py”, line 131, in cascaded_union
File “site-packages\shapely\geometry\base.py”, line 76, in geom_factory
ValueError: No Shapely geometry can be created from null value
2020-05-28 15:18:49,074 model._logged_target(1651) INFO Execution finished
2020-05-28 15:18:49,076 utils.prepare_workspace(121) INFO Elapsed time: 6.75s

Thanks in advance for helping me

Hi @000212 -

When I get an error about invalid geometry, I try running the vector layer (rzwp3k_ntt_utm.shp in this case) through a GIS tool that fixes invalid geometries. In ArcGIS it’s called “Repair Geometry” and in QGIS it’s called “Fix Geometry” - I’ve found that the QGIS version tends to work better. Give that a try and let us know if it helps.

~ Stacie

1 Like