-
Notifications
You must be signed in to change notification settings - Fork 103
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
Accueil / Synthèse - Problème d’affichage carte 100 dernières observations #3249
Comments
Je ne suis pas certain que cela soit un bug, mais peut-être tout simplement que ces utilisateurs ont des permissions différentes ? Si c'est un soucis, il ne semble pas spécifique à la carte de la page d'accueil, car avec l'utilisateur PUBLIC, on a les mêmes dernières observations quand on accède au module Synthèse. |
Nous avons effectivement observer ce bug en premier lieux chez nous (même version de GeoNature que la démo). Nous avons un groupe qui visualise toutes les données et dont les données sensibles sont flouter (permission image 1) et un groupe qui visualise toutes les données de manière précises (permission image 2) Ils sont donc sensé voir les même données (avec juste un floutage sur les données sensibles pour un des deux groupe), en toutes logique les dernières données observé pour ces deux groupes sont les même. C'est ce qui nous a fait penché pour un bug sur le calcul des 100 dernières observations lorsque le groupe n'as accès qu'aux données sensible flouter. Oui c'est plus lier au dernières observations afficher que ce soit dans la synthèse ou sur la page d'accueil. |
Je confirme l'observation de Ludmilla et confirme le fait que c'est difficile de parler d'un bug. J'avais déjà recherché la raison de pourquoi les données sensibles s'affichent prioritairement par rapport aux données non sensibles. GeoNature/backend/geonature/core/gn_synthese/routes.py Lines 218 to 231 in 3bdda83
Génère une requête de ce type :
Il y a un ORDER BY au niveau de la requête principale, mais pas au niveau des sous-requetes sur les données sensibles et et les données non sensibles. Donc selon la valeur du paramètre ["NB_MAX_OBS_MAP"] et selon le nombre de données dans la base les sous-requêtes vont retourner des données random qui ne seront pas forcément les plus récentes. En fait la requête formatée de cette manière devrait retourner le résultat attendu :
Au passage quand il doit y avoir la prise en compte des données sensible c'est un tri sur le champ id_synthese qui est effectué sur GeoNature/backend/geonature/core/gn_synthese/routes.py Lines 194 to 199 in 3bdda83
J'ai bien conscience de la difficulté du traitement des données sensibles, mais cette requête m'avait vraiment interrogée quand je m'y étais penché. Je ne sais pas si ce serait encore le cas aujourd'hui avec un peu de recul. |
Ah ouais OK OK, c’est en limitant à 100 que les données sensibles remontent si on a du floutage appliqué. |
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249 Co-authored-by: VincentCauchois <vincent.cauchois@mnhn.fr> Co-authored-by: Christophe Ramet <christophe.ramet@mnhn.fr>
For Synthese queries involving blurring: - Add first order_by on descending date_min > this allows to retrieve up-to-50000 more-recently-dated observations from the up-to-100000 observations of the 2 unioned queries - Set (now) second order_by on id_synthese from ascending to descending > this allows, for several observations with same date_min, to prioritize more-recently-added-in-database observations Notes: - We want to preserve the final order_by on `allowed_geom_cte.c.priority` and the distinct clause on id_synthese, to keep only precise geom for obs retrieved in both precise and blurred subqueries: this requires to: - Keep the order_by on id_synthese - The wish to retrieve "more recent" observations may be understood in two ways: - Meant as "more-recently-dated": operated by the first order_by > it is thus assumed this is the preferred meaning given to "more recent" - Meant as "more-recently-added-in-database": operated by the second order_by > it is thus assumed that for two observations with the same date_min we qualify as "more recent" the one with the greater id_synthese Solves #3249 Co-authored-by: VincentCauchois <vincent.cauchois@mnhn.fr> Co-authored-by: Christophe Ramet <christophe.ramet@mnhn.fr>
Version
GeoNature : 2.14.2
Description du bug
Lorsqu’on se connecte en tant qu’admin, la carte des 100 dernières observations semble bien correspondre aux 100 dernières observations. Cependant, lorsqu’on se connecte avec un autre profil, il semble que les données affichées comme étant les 100 dernières observations soient, en priorité, les dernières données sensibles.
Accès Admin :
Accès public :
The text was updated successfully, but these errors were encountered: