I’ve been trying to use the Coastal Vulnerability model but currently faced with this error: AttributeError: ‘NoneType’ object has no attribute ‘IsValid’. Seems to be the one of my vectors (Mangrove) but I am not entirely sure.
Thanks for posting the log file and data. If you look earlier in the log file, there’s this message:
2023-02-03 13:12:39,623 (natcap.invest.coastal_vulnerability) coastal_vulnerability.search_for_vector_habitat(2048) INFO Searching for Mangrove within 500 meters of shore points
2023-02-03 13:12:39,702 (taskgraph.Task) Task.add_task(706) ERROR Something went wrong when adding task searching for Mangrove
So I’m guessing that the issue is that the model is not finding any Mangrove within 500 meters of your landmass. And when I look at your inputs, indeed that seems to be the case. You have a lot of polygons in your landmass, and a lot of Mangroves, but your area of interest polygon only covers a very small area, and there are no Mangroves anywhere near it.
Ah, I thought so! Thank you very much @swolny for your time and effort to check. Also, if that’s the case, what do you recommend to do in this case? Do I have to make the value lower?
This is indeed a problem! Though technically the model hit this error before it finished searching for the Mangroves. I think the error is caused by an empty feature in the Mangrove layer. In other words, there is a row in the attribute table that has no associated polygon. Deleting that feature should resolve this.