Coastal Vulnerability Model TypeError: 'MultiLineString' object is not iterable

What is the issue or question you have?

I keep getting error warnings from InVEST program and I’m not sure what the problem is.

What do you expect to happen?

I thought there was something wrong with the Landmass file, so I tried fixing it, but I got the same error.

What have you tried so far?

I tried to match the coastline data and landmass data and completed the validity check analysis using the QGIS program, but an error occurred.

Upload the logfile using the :outbox_tray: button

And if the error persists even after receiving feedback through log file sharing, I would like to ask if you could share the input data so that we can check the error.
InVEST-natcap.invest.coastal_vulnerability-log-2024-09-04–15_11_09.txt (3.7 KB)
InVEST-natcap.invest.coastal_vulnerability-log-2024-09-04–14_32_04.txt (4.4 KB)

Hi @SG_LEE , thank you for posting your logfiles. I think you are probably right that the issue is with the Landmass layer. If you can share that layer, and your Area of Interest, I can try to resolve the issue.

Thank you,

I used these data(aoi, aoi_300, Landmasses_5179, Landmasses_5179_dis)
I tried using 2 of each, 4 combinations in total, but it didn’t work out well.
Please check it once.
Thank you.

Please understand that the file size is large so I am sending it as a Google Drive link.

Hi @SG_LEE , thanks for sharing these data. I recommend that you first try using a much, much simpler AOI. The AOI should not be identical to the landmass (this may be the source of the error). For the AOI, simply draw a polygon around the area you wish to analyze. The edges of the landmass within the AOI polygon are treated as the coastline. More details: Coastal Vulnerability Model — InVEST® documentation

For the landmass, I suggest not using the dissolved version. And I also recommend using a layer with less detail. The detail of the landmass should not be a problem, but it will make the model take much, much longer. There are features in your landmass layer as small as 3 meters across! If you’re desired model resolution is 300m, this extra detail in the landmass is not useful.

Finally, I suggest using a large model resolution (maybe 10000 meters, given the size of your study area) until you successfully complete a run without errors. Then you may reduce the resolution as desired.

Hello,

I have the same problem, I got the same error message.
I tried some alternatives of my AOI -not the landmass- file, also a coule of different model resolutions (1-10km), but nothing changed.
As the problem is similar I didn’t create a new post… I attach my log file as well as AOI and landmass. I would appreciate your help, I need it to work.

p.s. The model run successfully with a landmass and AOI of similar complexity, so I am not sure what the problem is in this case. Also, I have simplified the AOI if it helps (exclude very small landmasses from the model), still I cannot oversimplify it… Finally, I have also divided the AOI into smaller ones (in order to merge the final results), which was successful but not for all of them.

InVEST-natcap.invest.coastal_vulnerability-log-2024-09-30–08_07_26.txt (6.0 KB)
invest input.zip (5.2 MB)

Hi @byron , sorry for the delayed response. I think this error is a bug that we can fix in the next invest release. In the meantime, here are some thoughts on your input data. Making some adjustments here may also avoid the error in the meantime.

For the AOI, typically I would suggest using one of those polygons as an AOI and doing a separate model run for each. Or, use one big polygon drawn around the entire area to do the whole thing with one model run. Either approach should be fine. Some of your polygons in this AOI overlap each other, and that could lead to some unexpected behavior in the model.

In addition, I’m not sure the small “holes” within the AOI polygons are doing what you expect. They will prevent shore points from being plotted on the land within those holes, but the land itself will still be used in other parts of the model, such as when determining wind & wave exposure.

Hello Dave, it’s ok, thanks for responding.
In the meantime, I did some tests and I think finally it worked. Probably overlapping AOI polygons could be the problem, however I cannot interpret the model behavior related with that as it was not the problem in all the cases. Maybe it could be handled differently in future releases.
Fortunately, the model run successfully after modifying the AOI (I kept ‘holes’ a slight larger than the masses within them).

About your comment on the AOI holes, the concept was indeed to exclude results at those points but also those masses need to be accounted in general, regarding the local conditions. It seems right to me, I hope it makes sense that it is necessary to consider all landmasses in wind-wave exposure calculation but perhaps exclude generating results in some of them. Anyways, the model possibly completes with the whole AOI polygon selected as well.