Module:Infobox/Aire protégée
Apparence
[voir] [modifier] [historique] [purger]
Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Aire protégée.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Modèle:Documentation module d'infobox. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (modifier).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local building = require "Module:Infobox/Fonctions/Bâtiment"
local area = require "Module:Infobox/Fonctions"
local wd = require "Module:Wikidata"
local localdata = require "Module:Infobox/Localdata"
local iucn = {
Q14545608 = { couleur = '#E7AF97', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie Ia|Ia]] <small>([[Réserve naturelle|réserve naturelle intégrale]])</small>[[Catégorie:Aire protégée de l'UICN - catégorie Ia]]" }, -- Ia
Q14545620 = { couleur = '#DACAA5', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie Ib|Ib]] <small>(zone de nature sauvage)</small>[[Catégorie:Aire protégée de l'UICN - catégorie Ib]]" }, -- Ib
Q14545628 = { couleur = '#CDE5B2', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie II|II]] <small>([[parc national]])</small>[[Catégorie:Aire protégée de l'UICN - catégorie II]]" }, -- II
Q14545633 = { couleur = '#BFFFBF', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie III|III]] <small>([[monument naturel]])</small>[[Catégorie:Aire protégée de l'UICN - catégorie III]]" }, -- III
Q14545639 = { couleur = '#B2E5CD', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie IV|IV]] <small>(aire de gestion des habitats ou des espèces)</small>[[Catégorie:Aire protégée de l'UICN - catégorie IV]]" }, -- IV
Q14545646 = { couleur = '#A5CADA', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie V|V]] <small>(paysage terrestre ou marin protégé)</small>[[Catégorie:Aire protégée de l'UICN - catégorie V]]" }, -- V
Q14545652 = { couleur = '#A8BDEC', texte="[[:Catégorie:Aire protégée de l'UICN - catégorie VI|VI]] <small>(zone de gestion de ressources protégées)</small>[[Catégorie:Aire protégée de l'UICN - catégorie VI]]" }, -- VI
default = { couleur = '#00734a', texte=nil}
}
local areatype = wd.formatStatements{entity = localdata.item, property = 'P814', numval = 1, displayformat = 'raw' }
local maincolor = ( iucn[ areatype ] or iucn.default ).couleur
local function location( divstr )
if divstr ~= 'non' then
return building.adminlocation('Localisation')
else
return building.adminloc('','Localisation')
end
end
return
{
maincolor = maincolor,
parts =
{
area.title('map'),
area.mainimage('Article à illustrer Aire protégée', 'Defaut 2.svg'),
{type = 'table', title = 'Géographie', rows = {
location(localdata["adresse complète"]),
building.protectedarea(),
building.coordinates(),
{type = 'row', label = "Ville proche", value = "ville proche", wikidata = {property = 'P7153', qualifiers = 'P3831', qualifiervalue = 'Q72025746'}},
{type = 'row', label = "Superficie", value = 'superficie', wikidata = {property = 'P2046', targetunit = 'sqkm', rounding = '1'} },
{type = 'row', label = "Superficie terrestre", value = 'superficie terrestre'},
{type = 'row', label = "Superficie maritime", value = 'superficie maritime'},
{type = "row", label = "Point culminant", plurallabel = "Points culminants", value = "point culminant", property = "P610"},
{type = 'row', label = "Population", value = "population", wikidata = {property = 'P1082', showdate = 'true'}},
{type = 'row', label = "Protège", value = "protège", wikidata = {property = 'P6569', defaultlinkquery = {property = {'P171'}}, numval = '5'}},
},
},
{type = 'table', title = 'Administration', rows = {
{type = 'row', label = "Nom local", value = "nom local", wikidata = {property = 'P1705', showlang = true}},
{type = 'row', label = "Type", value = "type",
wikidata = {property = 'P31',
excludevalues = {'Q473972','Q570116','Q43229','Q15069452', -- Exclut ce qui ne correspond pas à une administration (y compris ce qui va dans le champ patrimonialité)
'Q43229','Q158454','Q1970725','Q131681','Q2221906','Q1200957','Q22698','Q29553','Q1286517',
'Q23397','Q8502','Q8072','Q34763','Q33837','Q23442','Q4421','Q166735', -- Géographie physique à exclure
'Q9444','Q199403', 'Q25391', 'Q39594','Q107679','Q8514','Q123991','Q39816','Q75520',
'Q4022','Q47053','Q43197','Q54050','Q878223','Q30198','Q1681353','Q27590','Q162602'},
defaultlinkquery = {property = {'P2354', 'P137'}}}},
{type = 'row', label = "Commémore", value = "commémore", property = 'P547'},
{
type = 'row',
label = "[[Commission mondiale des aires protégées|Catégorie UICN]]",
-- value = "catégorie iucn", désactivé pour le moment
property = 'P814',
wikidata = ( iucn[ areatype ] or iucn.default ).texte
},
{ type = 'row',
label = "[[World Database on Protected Areas|WDPA]]",
value = function()
local wdpa = localdata['Wdpa'] or localdata['wdpa']
if wdpa then
return '[https://protectedplanet.net/'.. wdpa .. ' ' .. wdpa .. ']'
end
end,
wikidata = {property = 'P809', urlpattern = 'https://protectedplanet.net/$1'}
},
{type = 'row', label = "Création", value = "création", property = 'P571'},
{type = 'row', label = "Texte fondateur", value = "texte fondateur", wikidata = {property = 'P457', numval = '1'}},
building.opening(),
building.protection(),
building.visitors(),
{type = 'row', label = "Administration", value = "administration", property = 'P137'},
{type = 'row', label = "[[Office de tourisme|Informations]]", value = "informations", wikidata = {property = 'P2872', numval = '5'}},
area.website(),
},
},
building.unesco(),
area.detailedmap('280'),
building.geoloc({pointtype = 'aire protégée', maptype = 'relief', marker = 'park', default_zoom = 8}),
},
}