FieldStudiesCouncil / QGIS-Biological-Recording-Tools

QGIS plugin for biological recorders. Created with the FSC Tomorrow's Biodiversity project.
GNU General Public License v3.0
10 stars 4 forks source link

POLYGON SELECTION NOT ALWAYS WORKING FOR NBN TOOL #29

Closed bwmoths closed 5 years ago

bwmoths commented 5 years ago

I think I have a similar problem to issue #22 closed recently. On my system I have found that the polygon selection does not work for polygon shapefile layers (PSL) created in previous uses of a QGIS Project. If I create a PSL in a project and select it with NBN TOOL open then the 'polygon' box gets a tick and the filter works OK. If then the NBNTOOL is closed the project saved and then shut down, when reopening the project and using the NBN TOOL the previousely created PSL can be selected as before but the 'polygon' box does not get a tick and the filter fails ? Never to work again unless the PSL is deleted and recreated when it will work until the project closed as before. Am I doing something wrong ? I think I had had this before the QGIS 3.4.3 upgrade ? Martin

burkmarr commented 5 years ago

Thanks for another detailed description Martin which has enabled me to reproduce the problem and therefore (I hope) should enable me to fix it. I am working on a new major release of the software so this will be addressed within that. Should be ready for release in 2 to 4 weeks, all being well.

burkmarr commented 5 years ago

Polygon filter for NBN queries not always working as expected.

bwmoths commented 5 years ago

Thanks Rich, good luck with your 'major release' ! Regards martin

burkmarr commented 5 years ago

Thanks Martin. (Strictly speaking I guess that it is a 'minor' release - it will be 3.2.n.)

burkmarr commented 5 years ago

This turned out to be because code was using feature.geometry().wkbType() to detect geometry instead of feature.geometry().type(). The former detects different types of geometries within specific topological types so, for example, polygons and multi-polygons are differentiated. Code was only looking for polygons so mutli-polygons were missed. Instead now use type which only distiguishes major topological types, so all types of polygon treated together. Fixed for upcoming release 3.2.

bwmoths commented 5 years ago

Hmm interesting, thank's for the info. I look forward as before to the new release. Cheers.