Skip to content

Commit

Permalink
Another smaller map optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe committed Jul 25, 2024
1 parent 248a70f commit 3fea314
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
TODO:
- to continue:
- new table in DB for the not seen, and populated. so we can now:
- adjust all the seen/not seen code to make sure it uses the new model
- add the user preference to choose which observations should be marked as seen automatically (delay)
- add code to mark as seen all the observations that are older than the delay (run each day after the data import?)
- test if data migration performance is enough for prod purposes !!
- (at the end): drop the old observationView table
- (clone the existing site/db to test everything before real deployment)?
- confirm with Damiano that all observations are considered as seen whe a user create an account
- New NL translations?


# GBIF Alert

<!-- badges: start -->
Expand Down Expand Up @@ -27,4 +40,5 @@ See [INSTALL.md](INSTALL.md) for more information.
## GBIF Alert instances in the wild

- LIFE RIPARIAS Early Alert: [production](https://alert.riparias.be) / [development](https://dev-alert.riparias.be) (Targets riparian invasive species in Belgium)
- [GBIF Alert demo instance](https://gbif-alert-demo.thebinaryforest.net/) (Always in sync with the `devel` branch of this repository)
- [GBIF Alert demo instance](https://gbif-alert-demo.thebinaryforest.net/) (Always in sync with the `devel` branch of this repository)
- The Belgian Biodiversity Platform uses GBIF alert under the hood as an API for the ManaIAS project.
4 changes: 4 additions & 0 deletions dashboard/views/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
SELECT ov1.id FROM $observationview_table_name ov1 WHERE ov1.user_id = {{ user_id }}
)
{% endif %}
{% if limit_to_tile %}
AND ST_Within(obs.location, ST_TileEnvelope({{ zoom }}, {{ x }}, {{ y }}))
{% endif %}
"""
).substitute(
observationview_table_name=OBSERVATIONVIEWS_TABLE_NAME,
Expand Down Expand Up @@ -140,6 +143,7 @@ def mvt_tiles_observations(

sql_params = {
# Map technicalities
"limit_to_tile": False,
"zoom": zoom,
"x": x,
"y": y,
Expand Down

0 comments on commit 3fea314

Please sign in to comment.