Module:Infobox/Aire protégée
Wikimedia module / De Wikipedia, l'encyclopédie encyclopedia
local building = require "Module:Infobox/Fonctions/Bâtiment" local general = require "Module:Infobox/Fonctions" local wd = require "Module:Wikidata" local localdata = require "Module:Infobox/Localdata" local linguistic = require "Module:Linguistique" local country = wd.stringTable{entity = localdata.item, property = "P17", displayformat = "raw"} local countryid if country then countryid = country[1] end local iucn = { Q14545608 = { couleur = '#E7AF97', texte="Ia (réserve naturelle intégrale)" }, -- Ia Ia = 'Q14545608', Q14545620 = { couleur = '#DACAA5', texte="Ib (zone de nature sauvage)" }, -- Ib Ib = 'Q14545620', Q14545628 = { couleur = '#CDE5B2', texte="II (parc national)" }, -- II II = 'Q14545628', Q14545633 = { couleur = '#BFFFBF', texte="III (monument naturel)" }, -- III III = 'Q14545633', Q14545639 = { couleur = '#B2E5CD', texte="IV (aire de gestion des habitats ou des espèces)" }, -- IV IV = 'Q14545639', Q14545646 = { couleur = '#A5CADA', texte="V (paysage terrestre ou marin protégé)" }, -- V V = 'Q14545646', Q14545652 = { couleur = '#A8BDEC', texte="VI (zone de gestion de ressources protégées)" }, -- VI VI = 'Q14545652', default = { couleur = '#E0E0E0', texte=nil} }
local areatype = iucn[ localdata['catégorie iucn'] ] or wd.formatStatements{entity = localdata.item, property = 'P814', numval = 1, displayformat = 'raw' } local maincolor = ( iucn[ areatype ] or iucn.default ).couleur
local function localDivRows() -- liste de lignes de divisions administrative basée sur des données locales local rows = {} local hasrows = false -- devient vraie si une valeur est non null for i = 1, 10 do i = tostring(i) local param, labelparam = "subdivision " .. i, "subdivision " .. i .. " type" if localdata[param] then hasrows = true local label = localdata[labelparam] or "Subdivision" table.insert(rows, {type = "row", label = label, value = function() return localdata[param] end}) end end if hasrows then return rows end end
return { maincolor = maincolor, parts =
{
general.title('map'), general.mainimage('Article à illustrer Aire protégée', 'Defaut 2.svg'), {type = 'table', title = 'Géographie', rows = { general.country(), {type = "multi", rows = localDivRows() or general.wikidataDivRows(countryid) or {}}, 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", wikidata = {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 = 'row', label = "Partie de", value = "partie de", wikidata = {property = 'P361'}}, }, }, {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','Q210272', 'Q23397','Q8502','Q8072','Q34763','Q33837','Q23442','Q4421','Q166735', 'Q169358', 'Q212057', 'Q46831', 'Q52942871', -- Géographie physique à exclure 'Q9444','Q199403', 'Q25391', 'Q39594','Q107679','Q8514','Q123991','Q39816','Q75520','Q740445','Q2624046','Q9381142','Q19850234', 'Q4022','Q47053','Q43197','Q54050','Q878223','Q30198','Q1681353','Q27590','Q162602','Q55075651','Q1400565'}, defaultlinkquery = {property = {'P2354', 'P137'}}}}, {type = 'row', label = "Commémore", value = "commémore", property = 'P547'}, { type = 'row', label = "Catégorie UICN", value = "catégorie iucn", property = 'P814', wikidata = ( iucn[ areatype ] or iucn.default ).texte }, { type = 'row', label = "WDPA", value = function() local wdpa = localdata['Wdpa'] or localdata['wdpa'] if wdpa then return 'wdpa .. ' ' .. wdpa .. '' end end, wikidata = {property = 'P809', urlpattern = 'https://protectedplanet.net/$1'} }, {type = 'row', label = "Création", value = "création", wikidata = {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", wikidata = {property = 'P137'}}, {type = 'row', label = "Informations", value = "informations", wikidata = {property = 'P2872', numval = '5'}}, general.website(), }, }, building.unesco(), general.detailedmap('280'), building.geoloc({pointtype = 'aire protégée', maptype = 'relief', marker = 'park', default_zoom = 8}), }, }