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/vector layer #217

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Feature/vector layer #217

wants to merge 6 commits into from

Conversation

zacdezgeo
Copy link
Collaborator

@zacdezgeo zacdezgeo commented Jan 31, 2025

What I changed

  • Refactored utils.py to properly distinguish between vector and raster layers when adding them to the map.
  • By the previous point, support the identify tool for vector layers by default.
  • Ensured that visParams were correctly handled for raster layers to maintain expected visualization behavior.
  • Fixed an issue where raster layers returned RGB values instead of elevation data when using Identify.
  • Refactored utils.py to properly distinguish between vector and raster layers when adding them to the map.
  • Also included a quick fix to the deprecation notice on Action Artifacts v3

How to test it

  1. Run unit tests (see CI)
  2. Load a DEM raster layer (e.g., USGS/SRTMGL1_003) and verify that the Identify tool returns elevation values instead of RGB.
  3. Load a vector layer and use the Identify tool to ensure it returns correct feature attributes.
  4. Check visualization: Confirm that raster layers still respect the visParams settings and display as expected.

Other notes

Assert vector datasets are added as vector layers. Currently fails because we add them with the EarthEngineRasterDataProvider
By setting ee.Image to visualize(**params) we were effectively creating a 3 band image and received the 3 bands from identify even if we were interested in the single band results for the elevation layer for example. The visualize(**params) is only passed to EarthEngine so it knows how to render the WMS layer.
@zacdezgeo zacdezgeo requested a review from alukach January 31, 2025 21:54
@zacdezgeo zacdezgeo self-assigned this Jan 31, 2025
@zacdezgeo
Copy link
Collaborator Author

zacdezgeo commented Jan 31, 2025

@alukach; I tried to get to type hinting, but it was already a large refactor... next iteration!

@zacdezgeo
Copy link
Collaborator Author

Also, wanted to share that I scrapped the idea of implementing a custom EarthEngineVectorProvider. It only makes sense to implement a custom provider if you want to override the default behavior from QGIS. For example, we want to use earth engine to run some custom logic on identify calls. For vector, there are no immediate needs like that; we should rely on the default behavior from QGIS.

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