Hi everyone,
I am struggling with my Urban Flood Risk Mitigation model. I always receive “TopologicalError: The operation ‘GEOSIntersection_r’ could not be performed. Likely cause is invalidity of the geometry” when running my model.
I checked the log and found the problem is the Built Infrastructure vector.
So, I tried Repair Geometry in ArcGIS, didn’t help.
Tried Fix Geometries in QGIS, didn’t help.
Tried Fix Geometries + Dissolve in QGIS, didn’t help.
Tried Repair Geometry + Dissolve in ArcGIS, didn’t help.
Tried Fix Geometries in QGIS + Dissolve in ArcGIS, didn’t’ help.
Could please you give me a hand?
Below is my log:
2021-04-28 10:56:56,123 geoprocessing.zonal_statistics(1460) DEBUG remaining unset_fids: 0 of 2
2021-04-28 10:56:56,123 geoprocessing.zonal_statistics(1468) INFO all done processing polygon sets for reprojected_aoi.gpkg
2021-04-28 10:56:56,159 geoprocessing.reproject_vector(1711) INFO starting reprojection
2021-04-28 10:56:56,221 geoprocessing.reproject_vector(1754) INFO reprojection 100.0% complete on structures_reprojected.gpkg
2021-04-28 10:56:56,371 geos.callback(252) ERROR TopologyException: Input geom 0 is invalid: Ring Self-intersection at or near point 120.19836341801903 30.324019001062968 at 120.19836341801903 30.324019001062968
2021-04-28 10:56:56,371 geos.callback(252) INFO Ring Self-intersection at or near point 120.19836341801903 30.324019001062968
2021-04-28 10:56:56,371 Task.add_task(781) ERROR Something went wrong when adding task calculate damage to infrastructure in aoi (12), terminating taskgraph.
Traceback (most recent call last):
File “site-packages\taskgraph\Task.py”, line 747, in add_task
File “site-packages\taskgraph\Task.py”, line 1234, in _call
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 607, in _calculate_damage_to_infrastructure_in_aoi
File “site-packages\shapely\geometry\base.py”, line 676, in intersection
File “site-packages\shapely\topology.py”, line 70, in call
File “site-packages\shapely\topology.py”, line 38, in _check_topology
shapely.errors.TopologicalError: The operation ‘GEOSIntersection_r’ could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at 0x0000018E3422C4C8>
2021-04-28 10:56:56,372 model._logged_target(1652) ERROR Exception while executing <function execute at 0x0000018E2DBCB9D8>
Traceback (most recent call last):
File “site-packages\natcap\invest\ui\model.py”, line 1649, in _logged_target
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 387, in execute
File “site-packages\taskgraph\Task.py”, line 747, in add_task
File “site-packages\taskgraph\Task.py”, line 1234, in _call
File “site-packages\natcap\invest\urban_flood_risk_mitigation.py”, line 607, in _calculate_damage_to_infrastructure_in_aoi
File “site-packages\shapely\geometry\base.py”, line 676, in intersection
File “site-packages\shapely\topology.py”, line 70, in call
File “site-packages\shapely\topology.py”, line 38, in _check_topology
shapely.errors.TopologicalError: The operation ‘GEOSIntersection_r’ could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at 0x0000018E3422C4C8>
2021-04-28 10:56:56,374 model._logged_target(1655) INFO Execution finished
2021-04-28 10:56:56,375 utils.prepare_workspace(129) INFO Elapsed time: 25.18s