Skip to content

Commit 79ca5be

Browse files
lpofredcTheoLechemia
authored andcommitted
Update changelog
1 parent 4b9c07f commit 79ca5be

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.2
1+
1.7.3
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- Creation d'une vue permettant de reproduire le contenu de la table du même nom dans les versions précédentes
2+
3+
CREATE OR REPLACE VIEW synthese.syntheseff AS
4+
WITH areas
5+
AS (SELECT DISTINCT ON (sa.id_synthese, t.type_code) sa.id_synthese
6+
, sa.id_area
7+
, a.centroid
8+
, st_transform(a.centroid, 4326) AS centroid_4326
9+
, t.type_code
10+
FROM ref_geo.bib_areas_types t
11+
JOIN ref_geo.l_areas a ON t.id_type = a.id_type
12+
JOIN synthese.cor_area_synthese sa ON sa.id_area = a.id_area
13+
WHERE t.type_code::TEXT = ANY
14+
(ARRAY ['M10'::CHARACTER VARYING, 'COM'::CHARACTER VARYING, 'DEP'::CHARACTER VARYING]::TEXT[]))
15+
, obs_data AS (SELECT s.id_synthese
16+
, s.cd_nom
17+
, s.id_dataset
18+
, s.date_min AS dateobs
19+
, s.observers AS observateurs
20+
, (s.altitude_min + s.altitude_max) / 2 AS altitude_retenue
21+
, COALESCE(areas.centroid_4326, st_transform(s.the_geom_point, 4326)) AS the_geom_point
22+
, s.count_min AS effectif_total
23+
, dl.cd_nomenclature::INTEGER AS diffusion_level
24+
FROM synthese.synthese s
25+
LEFT JOIN synthese.t_nomenclatures dl
26+
ON s.id_nomenclature_diffusion_level = dl.id_nomenclature
27+
LEFT JOIN synthese.t_nomenclatures st
28+
ON s.id_nomenclature_observation_status = st.id_nomenclature
29+
LEFT JOIN areas ON (
30+
s.id_synthese = areas.id_synthese
31+
AND areas.type_code = CASE
32+
WHEN dl.cd_nomenclature::TEXT = '1'::TEXT
33+
THEN 'COM'
34+
WHEN dl.cd_nomenclature::TEXT = '2'::TEXT
35+
THEN 'M10'
36+
WHEN dl.cd_nomenclature::TEXT = '3'::TEXT
37+
THEN 'DEP'
38+
END)
39+
WHERE (NOT dl.cd_nomenclature::TEXT = '4'::TEXT
40+
OR s.id_nomenclature_diffusion_level IS NULL)
41+
AND st.cd_nomenclature::TEXT = 'Pr'::TEXT)
42+
SELECT d.id_synthese
43+
, d.id_dataset
44+
, d.cd_nom
45+
, d.dateobs
46+
, d.observateurs
47+
, d.altitude_retenue
48+
, d.the_geom_point
49+
, d.effectif_total
50+
, c.insee
51+
, diffusion_level
52+
FROM obs_data d
53+
JOIN atlas.l_communes c ON st_intersects(d.the_geom_point, c.the_geom);

docs/changelog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
CHANGELOG
33
=========
44

5+
1.7.3 (2025-09-xx)
6+
------------------
7+
8+
🐛 **Corrections**
9+
10+
* Gain de performance sur la vue `synthese.syntheseff`
11+
12+
⚠️ **Notes de version**
13+
14+
- Exécutez le script SQL de mise à jour de la BDD : https://github.com/PnX-SI/GeoNature-atlas/blob/master/data/update/update_1.7.2to1.7.3.sql
15+
16+
517
1.7.2 (2025-09-17)
618
------------------
719

0 commit comments

Comments
 (0)