I have successfully run the Coastal Vulnerability toolbox in the previous InVEST version (3.5.0) and just wanted to keep up with the new updates in InVEST 3.7.0. However, I could not run the model anymore. I have changed the CSV files for the habitats, which I thought is the only one that needs to be modified. Is there anything else needs to be changed in this new version?
Please see the attached log file. The error message is:
AttributeError encountered: “NoneType” object has no attribute “IsEmpty”
I would really appreciate your help!
InVEST-Coastal-Vulnerability-log-2020-02-03–15_18_25.txt (1.2 MB)
Thanks for including your logfile! Based on your logfile, it looks like there’s some invalid geometry, probably in your seagrass vector:
ERROR [errno 1] TopologyException: Input geom 0 is invalid: Self-intersection at or near point 667878.10059999779 -4339184.7610999998 at 667878.10059999779 -4339184.7610999998
Could you perhaps check the validity of geometries (and repair any invalid ones) in your habitats vectors, and re-run with the new vectors?
It’s also worth noting that we’ve recently made some significant improvements to CV, which are included in the development build linked below and will be included in the next InVEST release. Here’s the download link: https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.7.0.post914%2Bh13fa555b9640/InVEST_3.7.0.post914%2Bh13fa555b9640_x86_Setup.exe
If neither of those address this issue, let us know and we’ll continue troubleshooting.
Thanks for your quick response!
I have checked the geometry and nothing comes up. It seems to be fine for all the habitat shapefiles.
I ran the same habitat shapefiles using the previous version (3.5.0) and it still worked.
Thanks for the download link! I will try with this new development build and then get back to you.
Yes, better handling of those invalid geometries is one thing that should be improved in that version James linked.
It’s also ~3x faster with that wind exposure algorithm on some tests I did (I’m curious to see if you see if that holds for your AOI as well). By the way the runtime of that algorithm is sensitive to the length of the fetch rays, the level of detail in the landmass polygon, and the model resolution if you’re looking for a way to reduce it.
For what it’s worth, when I’ve gotten errors about invalid geometries in Coastal Vulnerability, I’ve found that doing this usually (but not always) helps:
1/ Fix Geometry in QGIS (There’s a Repair Geometry in ArcGIS, but I don’t think it works as well.)
2/ Then do a Dissolve on the result from #1. Here, the Dissolve in ArcGIS seems to work better than the one in QGIS.
Not sure why, but Dissolve seems to be necessary after fixing the geometries.