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

Feature/export geotiff #236

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Feature/export geotiff #236

wants to merge 15 commits into from

Conversation

zacdezgeo
Copy link
Collaborator

@zacdezgeo zacdezgeo commented Mar 4, 2025

Short demo
https://github.com/user-attachments/assets/59b9e86b-6c5f-4542-96d0-c46340bde1e1

What I Changed

  • I added the export_geotiff widget to export GeoTIFF files from Earth Engine.
  • Implemented widget_parsers.py to handle QGIS widget data extraction.
  • Implemented FileSelectionWidget and a dropdown_widget helpers
  • Enhanced tests to validate dialog values and handle various projections.
  • Fixed projection handling to ensure only EPSG codes are captured.
  • Added tooltips and refactored widgets for improved usability.

How to Test It

  • Add an ee.Image and try the export functionality
  • Run unit tests, see CI

Other Notes

@zacdezgeo zacdezgeo requested a review from alukach March 4, 2025 23:26
@zacdezgeo zacdezgeo self-assigned this Mar 4, 2025
@alukach
Copy link
Collaborator

alukach commented Mar 5, 2025

@zacdezgeo Having some troubles getting this to work locally. After running paver setup, I'm getting the following errors within QGIS:

Couldn't load plugin 'ee_plugin' due to an error when calling its classFactory() method 

ImportError: cannot import name 'EllipsisType' from 'types' (/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/types.py) 
Traceback (most recent call last):
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/__init__.py", line 41, in classFactory
    from . import ee_auth, config, ee_plugin
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_plugin.py", line 23, in 
    from . import provider, config, ee_auth, utils
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/provider.py", line 23, in 
    from . import Map
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/Map.py", line 19, in 
    from . import utils
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/utils.py", line 12, in 
    import xarray as xr
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/__init__.py", line 3, in 
    from xarray import coders, groupers, testing, tutorial, ufuncs
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/coders.py", line 6, in 
    from xarray.coding.times import CFDatetimeCoder, CFTimedeltaCoder
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/coding/times.py", line 14, in 
    from xarray.coding.variables import (
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/coding/variables.py", line 13, in 
    from xarray.core import dtypes, duck_array_ops, indexing
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/core/dtypes.py", line 9, in 
    from xarray.core import array_api_compat, npcompat, utils
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/core/array_api_compat.py", line 3, in 
    from xarray.namedarray.pycompat import array_type
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/namedarray/pycompat.py", line 10, in 
    from xarray.core.utils import is_scalar
  File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/alukach/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs/xarray/core/utils.py", line 69, in 
    from types import EllipsisType, ModuleType
ImportError: cannot import name 'EllipsisType' from 'types' (/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/types.py)

Did you experience this?

alukach added 2 commits March 5, 2025 15:58
* Setup logger for better observability

* Utilize builtin logger
@zacdezgeo zacdezgeo marked this pull request as draft March 7, 2025 20:45
@zacdezgeo
Copy link
Collaborator Author

Sharing for visibility, the dependency on xarray and numpy for this feature have led to issues with packaging. We are working through it at this time, but the issue should be considered a blocker until resolved. The gist is that numpy requires access to some C dependencies. While the feature works when we install xarray directly on the QGIS PYTHONPATH, our packaging approach wouldn't work out of the box.

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

Successfully merging this pull request may close these issues.

GUI Functionality: Export image data to GeoTIFF
2 participants