-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Bug 195/add vector layer #196
Conversation
The goal will be to reuse the fixture for other tests
# TODO | ||
layer = QgsRasterLayer(url, name, "wms") | ||
|
||
layer = QgsRasterLayer(url, name, "EE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting for future 👀: So the practical impact here is that we are treating all Earth Engine data as a QgsRasterLayer
layer registered with the "EE" provider which is managed via our custom EarthEngineRasterDataProvider
.
qgis-earthengine-plugin/provider.py
Lines 40 to 68 in eb7a27e
class EarthEngineRasterDataProvider(QgsRasterDataProvider): | |
PARENT = QObject() | |
# def __getattribute__(self, attr): | |
# method = object.__getattribute__(self, attr) | |
# # if not method: | |
# # raise Exception("Method %s not implemented" % attr) | |
# if callable(method): | |
# print(f"method: {attr}") | |
# return method | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.ee_object = None | |
self._args = args | |
self._kwargs = kwargs | |
# create WMS provider | |
self.wms = QgsProviderRegistry.instance().createProvider("wms", *args, **kwargs) | |
@classmethod | |
def description(cls): | |
return "Google Earth Engine Raster Data Provider" | |
@classmethod | |
def providerKey(cls): | |
return "EE" |
* Writing some initial tests for Map.py using pytest-qgis * Add proper registration of WMS provider * wip to test add_layers functionality * Add python env file to use extlibs as pythonpath * Debug adding provider * Base example test implemented * Update CI to authenticate to earthengine * Add test to pythonpath * Revert pytest call in CI * Add pythonpath * Simplify test execution in CI * Add future for CI dependencies * Reorganized plugin code into a module * Activate virtualenv to avoid system wide permissions error * Update python version to 3.9 * Move plugin files to ee_plugin module Clean up installed plugin to include only extlibs and python files. * Modify path for paver package to avoid nested ee_plugin * Add icons, i18n, and contrib to paver packaging * Update path to ee_plugin module * Add paver to dev requirements * Bug 195/add vector layer (#196) * Move fixtures to separate conftest.py file The goal will be to reuse the fixture for other tests * Add unit test reproducing the bud * Fix bug adding vector layers by creating layers with the EE flag * Simplify code paths layer is a QgsRasterLayer in any case --------- Co-authored-by: Anthony Lukach <[email protected]>
What I Changed
How to test it
python3 -m pytest test
Other notes