Aller au contenu

Module:Infobox/Aire protégée

Cette page fait l’objet d’une mesure de semi-protection étendue.
Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 20 juin 2020 à 19:41 et modifiée en dernier par Noritop (discuter | contributions) (Cela devrait permettre d'éviter une énumération inutile dans le paramètre Adresse de l'infobox lorsque le paramètre adresse complète vaut non.). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

 Documentation[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.


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 = '#E0E0E0', 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()
	else
		return building.adminloc('')
	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', 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|Identifiant]]",
				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(),
		building.geoloc({pointtype = 'aire protégée', maptype = 'relief', marker = 'park', default_zoom = 8}),
	},
}