[(#REM)
/*******************************************************************************\
* BIODIV, plugin et squelette pour SPIP - https://www.spip.net/ *
* dédié à la gestion d'observations naturalistes *
* *
* Copyright (C) 2008-2024 Renaud LAURETTE *
* *
* BIODIV a été développé initialement pour le projet Biodiv.Balma de l'APCVEB *
* (Association de Protection du Cadre de Vie et de l'Environnement balmanais) *
* voir Biodiv.Balma : https://balma.biodiv.fr/ *
* voir APCVEB : https://apcveb.fr/ *
* *
* Ce programme est un logiciel libre distribué sous licence GNU/GPL. *
* Pour plus de détails voir les fichier COPYING.txt et LICENCE-BIODIV.md *
\*******************************************************************************/
][(#HTTP_HEADER{Content-type: text/csv[; charset=(#CHARSET)]})][(#CACHE{0})][(#HTTP_HEADER{Content-Disposition: attachment; filename=#ENV{filename}.csv})][
(#REM)
Le 'perimetre' est un fichier temporaire geojson contenant la description du lieu.
On charge les limites de la bounding box.
][
(#SET{bbox,[(#ENV{perimetre}|bounding_box)]})][
(#SET{maxlat,[(#GET{bbox}|table_valeur{maxlat})]})][
(#SET{minlat,[(#GET{bbox}|table_valeur{minlat})]})][
(#SET{maxlng,[(#GET{bbox}|table_valeur{maxlng})]})][
(#SET{minlng,[(#GET{bbox}|table_valeur{minlng})]})
][(#REM)
Avec la bounding box, on peut récupérer les observations
puis les filtrer selon le polygone du lieu.
][
(#SET{obsl, #ARRAY}) ][
(#SET{confidentialite,#LISTE{rien}}) ][
(#AUTORISER{exporter,observation}|oui)[(#SET{confidentialite,#LISTE{non}})] ][
(#AUTORISER{debusquer,observation}|oui)[(#SET{confidentialite,#LISTE{oui,non,inconnu}})]
]= #GET{minlat} }
{lng <= #GET{maxlng} }
{lng >= #GET{minlng} }
>[(#REM)
#ID_OBSERVATION dans la bbox
][(#SET{obsl,[(#GET{obsl}|push{#ARRAY{id,#ID_OBSERVATION,lat,#LAT,lng,#LNG}})]})
][
(#SET{obsok,[(#GET{obsl}|lieu_polygonal{[(#ENV{perimetre})]})]})
]"ObsId";"Sujet";"Date";"Titre";"TypeObs";"Espèce";"id_espece";"Identification";"Rubrique";"CD_REF";"Règne";"Group1";"Group2";"Quantité";"Latitude";"Longitude";"Confidentiel";"Adresse";"Commune";"INSEE";"Observateur";
"#ID_OBSERVATION";"#ID_SUJET";"[(#DATE_OBS|affdate{'d/m/Y'})]";"[(#TITRE|textebrut|replace{\"})]";"[(#TYPE_OBS|textebrut|replace{\"})]";"[(#ESPECE|textebrut|replace{\"})]";"#ID_ESPECE";"[(#TITRE|textebrut|replace{\"})]";"[(#INFO_TITRE{rubrique,#ID_RUBRIQUE}|textebrut|replace{\"})]";"";"";/B_ae>"#CD_REF";"#REGNE";"#GROUP1";"#GROUP2";"";"";"";"";/B_tx>"#QUANTITE";#LAT;#LNG;"#DISCRET";"[(#ADRESSE|textebrut|replace{\"})]";"[(#COMMUNE|textebrut|replace{\"})]";[(#INSEE)];"[(#MODELE{observation_auteur}{id_observation=#ID_OBSERVATION}|textebrut|replace{\"})]";