Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow conversion of QgsFeatureStoreList results to Python objects #39510

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

nyalldawson
Copy link
Collaborator

Fixes #39479

@github-actions github-actions bot added this to the 3.16.0 milestone Oct 20, 2020
@nyalldawson nyalldawson merged commit 49c5089 into qgis:master Oct 21, 2020
@nyalldawson nyalldawson deleted the fix_39479_featurestorelist branch October 21, 2020 16:45
@agiudiceandrea
Copy link
Contributor

Hi @nyalldawson I've tested the example provided in #39479 and now, with your fix, the error unable to convert a C++ 'QgsFeatureStoreList' instance to a Python object is gone. Thank you!

I noticed that in the classQgsRasterIdentifyResult API and PyQGIS docs, it's incorrectly reported that results() (for QgsRaster.IdentifyFormatFeature) returns a dictionary of "QgsRasterFeatureList for each sublayer".

Should it be QgsFeatureStoreList (which however is not documented anywhere) or something better (like "a list of QgsFeatureStore objects")?

This is what returns results() in Python:

>>> result.results()
{0: [<qgis._core.QgsFeatureStore object at 0x0000029E4748B678>]}
>>> type(result.results())
<class 'dict'>
>>> result.results()[0]
[<qgis._core.QgsFeatureStore object at 0x0000029E4748B5E8>]
>>> type(result.results()[0])
<class 'list'>
>>> result.results()[0][0]
<qgis._core.QgsFeatureStore object at 0x0000029E4748B708>
>>> type(result.results()[0][0])
<class 'qgis._core.QgsFeatureStore'>

@nyalldawson
Copy link
Collaborator Author

@agiudiceandrea fixed in #39605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants