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

Add Map.onChangeCenter() to QGIS plugin #83

Open
vieiramesquita opened this issue Jan 8, 2021 · 5 comments
Open

Add Map.onChangeCenter() to QGIS plugin #83

vieiramesquita opened this issue Jan 8, 2021 · 5 comments
Assignees

Comments

@vieiramesquita
Copy link

No description provided.

@gena gena self-assigned this Jan 8, 2021
@gena
Copy link
Collaborator

gena commented Jan 8, 2021

Let's elaborate a bit:

Can you provide a few scenarios on how this will be used?

In Code Editor, when the user hits run, all event handlers defined in that script are subscribed, and when the user re-runs that script - event handlers are re-subscribed from scratch. This feature can be probably implemented in QGIS in a similar way if I manage to find how to handle the Run Script button signal. And then unsubscribe all Map.on* events when the user hits Run. Would that be acceptable?

@gena
Copy link
Collaborator

gena commented Jan 8, 2021

Here how a prototype looks like, a bit slow with EE calls on every center change:

map_on_change_center.mp4

@vieiramesquita
Copy link
Author

The example I have is: I need to navigate through many points (9k) and I don't want to load images (Sentinel 2) for a large area (an entire country, i.e. Brazil) or click on the Run button for each point. Map.onChangeCenter() seems to be the best way to do this in QGIS.

@gena
Copy link
Collaborator

gena commented Jan 8, 2021

Hmm, I still don't see how Map.onChangeCenter() would help here, if you plan to re-run EE processing every time you change map center - it could be slow.

It might be better to have some more explicit way to trigger processing for a given point (or points), e.g. select a point in a layer to trigger EE update or something using QGIS Python API, like run a script that will iterate over points in the current view (or over selected points only) and run some EE processing for all of them, putting results into a single resulting layer. For QGIS API see for example https://docs.qgis.org/3.4/pdf/en/QGIS-3.4-PyQGISDeveloperCookbook-en.pdf

@vieiramesquita
Copy link
Author

I will try to iterate over the selected feature. It seems to be the best way to do what I want 😅

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

No branches or pull requests

2 participants