Skip to content

Commit

Permalink
Add blurring sample + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
juggler31 committed Feb 14, 2025
1 parent 9787ac4 commit 6c26099
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 42 deletions.
19 changes: 19 additions & 0 deletions atlas/configuration/config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,25 @@ MAP = {
# True = maille / False = point
AFFICHAGE_MAILLE = False

# Si affichage en mailles, il est possible de surcharger certains elements dans le selecteur de couche.
AFFICHAGE_COUCHES_MAP = {
"M1": {
"label": "Mailles 1 km",
"selected": True,
"fillOpacity": 0.4
},
"COM": {
"label": "Mailles communes",
"selected": False,
"fillOpacity": 0.2
},
"M10": {
"label": "Mailles 10 km",
"selected": False,
"fillOpacity": 0.6
}
}

# Niveau de zoom à partir duquel on passe à l'affichage en point (si AFFICHAGE_MAILLE = False)
ZOOM_LEVEL_POINT = 11

Expand Down
11 changes: 3 additions & 8 deletions atlas/configuration/settings.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ geonature_source=true
# ATTENTION : Doit être égal à false si geonature_source=false
use_ref_geo_gn2=true

# Type d'aire a utiliser dans l'application (Pour optimiser et ne pas utiliser toutes les géométries présentes dans ref_geo)
type_code="'M10,M500,COM,EPCI'"

# Souhaitez-vous installer le schéma taxonomie de TaxHub dans la BDD de GeoNature-atlas ?
# false si vous souhaitez utiliser celui de GeoNature en FDW
# ATTENTION : Doit être true si geonature_source=false
Expand Down Expand Up @@ -108,14 +111,6 @@ metropole=true
# Choisissez alors la taille de vos mailles à utiliser (en km) / Valeurs possibles 1, 5 ou 10
taillemaille=5

# Choisissez alors la taille de vos mailles à utiliser
# Valeurs possibles M1, M5, COM, 10, COM, DEP ou REG

sensibility0="M1" # sensibilité de niveau 0
sensibility1="M1" # sensibilité de niveau 1
sensibility2="COM" # sensibilité de niveau 2
sensibility3="M10" # sensibilité de niveau 3

# A noter que la sensibilité de niveau 4 sera ignoré afin de ne pas afficher les observations correspondant a ces espèces.

# Si 'metropole=false', rajoutez dans le dossier /data/ref un SHP des mailles de votre territoire et renseignez son chemin
Expand Down
68 changes: 34 additions & 34 deletions data/gn2/atlas_ref_geo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,47 +52,47 @@ END$$;
--################################
--################################

-- DO $$
-- BEGIN
-- DROP TABLE atlas.t_layer_territoire;
-- EXCEPTION WHEN others THEN
-- RAISE NOTICE 'view atlas.t_layer_territoire does not exist';
-- END$$;
--
--
-- CREATE MATERIALIZED VIEW atlas.t_layer_territoire AS
-- WITH d AS (
-- SELECT st_union(geom) , b.type_name
-- FROM ref_geo.l_areas l
-- JOIN ref_geo.bib_areas_types b USING(id_type)
-- WHERE REPLACE(b.type_code, ' ', '_') = :type_territoire
-- GROUP BY b.type_name
-- )
-- SELECT
-- 1::int as gid,
-- type_name as nom,
-- st_area(st_union)/10000 as surf_ha,
-- st_area(st_union)/1000000 as surf_km2,
-- ST_Perimeter(st_union)/1000 as perim_km,
-- st_transform(st_union, 4326) as the_geom
-- FROM d;
--
-- CREATE INDEX index_gist_t_layer_territoire_the_geom
-- ON atlas.t_layer_territoire
-- USING gist
-- (the_geom);
--
-- CREATE UNIQUE INDEX t_layer_territoire_gid_idx
-- ON atlas.t_layer_territoire
-- USING btree (gid);
DO $$
BEGIN
DROP TABLE atlas.t_layer_territoire;
EXCEPTION WHEN others THEN
RAISE NOTICE 'view atlas.t_layer_territoire does not exist';
END$$;


CREATE MATERIALIZED VIEW atlas.t_layer_territoire AS
WITH d AS (
SELECT st_union(geom) , b.type_name
FROM ref_geo.l_areas l
JOIN ref_geo.bib_areas_types b USING(id_type)
WHERE REPLACE(b.type_code, ' ', '_') = :type_territoire
GROUP BY b.type_name
)
SELECT
1::int as gid,
type_name as nom,
st_area(st_union)/10000 as surf_ha,
st_area(st_union)/1000000 as surf_km2,
ST_Perimeter(st_union)/1000 as perim_km,
st_transform(st_union, 4326) as the_geom
FROM d;

CREATE INDEX index_gist_t_layer_territoire_the_geom
ON atlas.t_layer_territoire
USING gist
(the_geom);

CREATE UNIQUE INDEX t_layer_territoire_gid_idx
ON atlas.t_layer_territoire
USING btree (gid);


-- Rafraichissement des vues contenant les données de l'atlas
CREATE OR REPLACE FUNCTION atlas.refresh_materialized_view_ref_geo()
RETURNS VOID AS $$
BEGIN

-- REFRESH MATERIALIZED VIEW atlas.t_layer_territoire;
REFRESH MATERIALIZED VIEW atlas.t_layer_territoire;
REFRESH MATERIALIZED VIEW atlas.t_mailles_territoire;
REFRESH MATERIALIZED VIEW atlas.l_communes;
REFRESH MATERIALIZED VIEW atlas.vm_communes;
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHANGELOG

- Ajout du lien "Données personelles" dans le pied de page (#527 @juggler31)
- Suppression du support des installations sans TaxHub
- Ajout du floutage dans l'application (#571 @juggler31)

🐛 **Corrections**

Expand Down

0 comments on commit 6c26099

Please sign in to comment.