[(#HTTP_HEADER{Content-type: application/json [; charset=(#CHARSET)]})][(#HTTP_HEADER{Content-Disposition: attachment; filename=observations-#ENV{regne}-lieu.geojson})]#CACHE{0}
[(#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 *
\*******************************************************************************/
]{
"type": "FeatureCollection",
[(#SET{confidentialite,#LISTE{rien}})
][(#AUTORISER{exporter,observation}|oui) [(#SET{confidentialite,#LISTE{non}})
]][(#AUTORISER{debusquer,observation}|oui)[(#SET{confidentialite,#LISTE{oui,non,inconnu}})
]][(#REM)
Le 'perimetre' est un fichier geojson (ou lieu) 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})]
"properties": {
"confidentialite": [(#GET{confidentialite}|serialize|json_encode)],
"perimetre": [(#ENV{perimetre}|no8217|json_encode)],
"regne": [(#ENV{regne}|no8217|json_encode)],
"de": [(#ENV{de}|json_encode)],
"a": [(#ENV{a}|json_encode)],
"droits" : [(#NOM_SITE_SPIP|no8217|json_encode)],
"date": [(#ENV{date}|affdate{'d/m/Y'}|json_encode)]
},
"features": [
[(#REM)
]= #ENV{de}}{date_obs <= #ENV{a}}
{id_espece=#ID_ESPECE}
{discret IN #GET{confidentialite}}
{lat <= #GET{maxlat} }
{lat >= #GET{minlat} }
{lng <= #GET{maxlng} }
{lng >= #GET{minlng} }
>[(#SET{obsl,[(#GET{obsl}|push{#ARRAY{id,#ID_OBSERVATION,lat,#LAT,lng,#LNG}})]})][(#REM)
][(#REM)
][(#SET{obsok,[(#GET{obsl}|lieu_polygonal{[(#ENV{perimetre})]})]})]
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates" : [[(#LNG),][ (#LAT)]]},
"properties": {
"type": "observation",
"id": [(#ID_OBSERVATION)],
"confidentiel": "#DISCRET",
"titre": [(#TITRE|no8217|json_encode)],
"url": [(#URL_OBSERVATION{#ID_OBSERVATION}|url_absolue|json_encode)],
"auteur": [(#MODELE{observation_auteur}{id_observation=#ID_OBSERVATION}|no8217|json_encode)],
"date": [(#DATE_OBS|affdate{'d/m/Y'}|json_encode)],
"espece": [(#ESPECE|no8217|json_encode)],
"identification": [(#TITRE|no8217|json_encode)],
"cd_ref": #CD_REF0/B_tx>,
"adresse": [(#ADRESSE|supprimer_tags|no8217|json_encode)],
"commune" : [(#COMMUNE|no8217|json_encode)],
"insee": #INSEE,
"quantite" : [(#QUANTITE)],
"denombrement": [(#DENOMBREMENT|no8217|json_encode)],
"popupContent":[(#MODELE{observation_marker}{id_observation}|no8217|json_encode)]
}
}
]
}