forked from PnX-SI/GeoNature-atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: some stats on territory sheet (PnX-SI#540)
- Loading branch information
Showing
16 changed files
with
290 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2025-01-08 14:03+0100\n" | ||
"POT-Creation-Date: 2025-01-09 21:50+0100\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -127,7 +127,7 @@ msgstr "" | |
msgid "atlas.presentation" | ||
msgstr "" | ||
|
||
#: atlas/templates/areaSheet/_main.html:55 | ||
#: atlas/templates/areaSheet/_main.html:63 | ||
msgid "last.obs.zone" | ||
msgstr "" | ||
|
||
|
@@ -274,6 +274,30 @@ msgstr "" | |
msgid "observer" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:23 | ||
msgid "sources" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:23 | ||
msgid "source" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:28 | ||
msgid "first_observation" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:33 | ||
msgid "last_observation" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:38 | ||
msgid "protected_species" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/statHierarchy.html:44 | ||
msgid "patrimonial_species" | ||
msgstr "" | ||
|
||
#: atlas/templates/core/tabTaxons.html:7 | ||
msgid "group" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
atlas/modeles/repositories/vmStatsStatutTaxonCommRepository.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding:utf-8 -*- | ||
|
||
from sqlalchemy.sql import text | ||
|
||
|
||
# get nombre taxons protégés et nombre taxons patrimoniaux par communes | ||
def get_nb_taxon_pro_pat_zone(connection, id_zone): | ||
sql = """ | ||
SELECT | ||
COUNT(t.patrimonial) AS nb_taxon_patrimonial, COUNT(t.protection_stricte) AS nb_taxon_protege | ||
FROM atlas.vm_observations o | ||
JOIN atlas.vm_taxons t ON t.cd_ref=o.cd_ref | ||
JOIN atlas.zoning zone ON st_intersects(o.the_geom_point, zone.the_geom_4326) | ||
WHERE zone.id_zone = :thisIdZone | ||
""" | ||
req = connection.execute(text(sql), thisIdZone=id_zone) | ||
taxonProPatri = dict() | ||
for r in req: | ||
taxonProPatri = {"nbTaxonPro": r.nb_taxon_protege, "nbTaxonPatri": r.nb_taxon_patrimonial} | ||
return taxonProPatri | ||
|
||
|
||
# # get stats sur les statuts des taxons par communes | ||
# def getStatsStatutsTaxonsCommunes(connection, insee): | ||
# sql = """ | ||
# SELECT | ||
# nb_taxon_que_pro, | ||
# nb_taxon_que_patri, | ||
# nb_taxon_pro_et_patri, | ||
# nb_taxon_sans_statut | ||
# FROM atlas.vm_stats_statut_taxon_comm a | ||
# WHERE a.insee = :thisinsee | ||
# """.encode('UTF-8') | ||
# | ||
# mesStatutsTaxons = connection.execute(text(sql), thisinsee=insee) | ||
# for inter in mesStatutsTaxons: | ||
# return [ | ||
# {'label': "Taxons protégés", 'y': inter.nb_taxon_que_pro}, | ||
# {'label': "Taxons patrimoniaux", 'y': inter.nb_taxon_que_patri}, | ||
# {'label': "Taxons protégés et patrimoniaux", 'y': inter.nb_taxon_pro_et_patri}, | ||
# {'label': "Autres taxons", 'y': inter.nb_taxon_sans_statut}, | ||
# ] | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
img.patrimonial_img { | ||
width: 1rem; | ||
} | ||
|
||
.info_zone_card { | ||
width: 100%; | ||
justify-items: center; | ||
padding: 1rem; | ||
} | ||
|
||
.specie_list_map_block { | ||
display: flex; | ||
height: 100%; | ||
} | ||
|
||
.stats_block { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.