HRA model , TypeError: 'NoneType' object is not subscriptable

Hi,I’m trying to run the HRA Model , and get the following error:
AttributeError: ‘NoneType’ object is not subscriptable.

Any help would be much appreciated!

InVEST-Habitat-Risk-Assessment-log-2021-01-04–19_51_04.txt (6.8 KB)

Hi @Giggle,
Thanks for including the log file! There are a couple of warnings above the error message: A geometry of type MULTIPOLYGON is inserted into layer simplified_protect_area of geometry type POLYGON, which is not normally allowed by the GeoPackage specification, but the driver will however do it. To create a conformant GeoPackage, if using ogr2ogr, the -nlt option can be used to override the layer geometry type. This warning will no longer be emitted for this combination of layer and feature geometry type.
You can try checking for accidental multipolygons (in QGIS you can do this with the Geometry Checker tool: Vector -> Geometry Tools -> Check Validity) and correcting them.
Could you share your data so that I can look into the issue further? You can attach it here or email it to me privately: esoth @

1 Like

Thank you so much for the answers.I will share my date to you. (891.5 KB)
Thank you very much for your attention!

So sorry about the delay on this @Giggle ! And thank you for providing your inputs.

In this case, the model is failing because one of your habitat vectors (天然湿地2.shp) has no features in it. If there aren’t any features in the vector, then there’s nothing to rasterize and you’ll end up with some unexpected results anyways. So could you add a feature to the vector and see if that solves the issue?

Let us know how this goes!

1 Like