Hi,

I'm trying to create/prototype a custom QgsVectorDataProvider in Python to
retrieve data from a HTTP REST API.

When testing, I do the following to register my provider:

from qgis.core import QgsProviderRegistry, QgsProviderMetadata
from provider import MyProvider
registry = QgsProviderRegistry.instance()
metadata = QgsProviderMetadata(MyProvider.providerKey(),
MyProvider.description(),
MyProvider.createProvider)
registry.registerProvider(metadata)
layer = QgsVectorLayer(<my-url>, 'Test myprovider', 'myprovider-plugin')
QgsProject.instance().addMapLayer(layer)
This seems to initialize the provider, although it stops after the
constructor of MyFeatureIterator(QgsAbstractFeatureIterator) is run.
For this test, data is retrieved from the REST API in the constructor, and
I can see in the logs that the data is retrieved.

I expected it to start iterating objects, but the next message in the log
is prepareSimplification (I have added a log message to every class method
to watch progress in the logs), then nothing.

I even installed qgis-dev and watched the logs using Microsoft's
DebugViewer, but I could not see any relevant information.

Could someone please help me or tell me where to look to solve this issue
and start iterating with nextFeature/fetchFeature? Regards,
Mats Taraldsvik
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to