2

I am trying to use the Landscape Vector Overlay function in the LecoS plugin to calculate the amount of various proportions of land cover types (using an ordinary landscape raster) within buffer polygons around individual points (i.e., Landscape Proportions).

When I try to run this I get the following error:

An error has occurred while executing Python code: 
AttributeError: 'NoneType' object has no attribute 'GetFeatureCount'

I have little to no Python experience so I'm hoping my issue does not involve coding. However, I have not installed anything in Python (because I don't know how) and I realize that might be involved.

I am using QGIS 3.4

I am a pretty basic QGIS user.

I have researched several other options but always end up at a dead end. The LecoS plugin seems like it is designed specifically for what I am trying to accomplish.

  • 1
    In Python, the term None is used for NULL, so anywhere you see None or, as you've put here, NoneType it means there's a NULL - something is missing. A NoneType object, I'm guessing, means it's actually got no Object. Potentially you've added the wrong type of data into your tool. I can't comment further as I have little QGIS experience, but perhaps this helps give you somewhere to look? – Midavalo Feb 13 at 18:25
  • 1
    It's an error of how the plugin has been coded. Maybe you have a wrong input, but the plugin didn't hande it and failed execute one Python statement before the line GetFeatureCount. – etrimaille Feb 13 at 21:42
  • 3
    Check that your data fills these requeriments: github.com/Martin-Jung/LecoS/issues/20#issuecomment-542170578 – Gabriel De Luca Feb 14 at 0:24
  • I was able to figure it out. According to the above github.com link, multipolygon vector layers do not work with LecoS. When I made my vector polygon layer a single polygon layer (vs multipolygon layer) using Vector > Geometry Tools > Multipart to Singleparts, I no longer got the python error but I did get a separate error saying there was still and issue with my vector layer. After a bit of searching on this error, I landed on using the SAGA tool 'Polygon parts to separate polygon'. I ran LecoS with the new Polygon parts vector layer and it worked! – ahomkes Feb 19 at 16:04