Template:Election map example
Jump to navigation
Jump to search
This is a Kartographer example map.
SELECT
?city
?cityLabel
(?city as ?id)
(SAMPLE(?img) as ?img)
(SAMPLE(?fill) as ?fill)
(concat('[[:d:',substr(str(?city),32,100), ' | ', ?cityLabel, ']]') as ?title)
(concat('[[File:', substr(str(?img), 52, 100), '|200px]]') as ?description)
WHERE {
?item wdt:P361 wd:Q20252009.
?item wdt:P1867 ?total_voters .
?item wdt:P1697 ?active_voters.
?item wdt:P1001 ?city.
BIND (100*?active_voters/?total_voters AS ?percent) .
BIND(
if(?percent>= 75, '#610604',
if(?percent>= 70, '#994910',
if(?percent>= 65, '#D0B01F',
if(?percent>= 60, '#CBF13F',
if(?percent>= 55, '#ABF97A',
if(?percent>= 50, '#B1FFB3', '#a6a6a6')))))
) as ?fill).
OPTIONAL { ?city wdt:P94 ?img . }
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en,fi,sv'. }
} GROUP BY ?city ?cityLabel
TemplateData[edit]
Election map of Finland
Parameter | Description | Type | Status | |
---|---|---|---|---|
width | width | no description | Unknown | optional |
height | height | no description | Unknown | optional |
align | align | no description | Unknown | optional |