Template:OSM Location map/examples#Map using WikiData Query Service (WDQS)

numbered dots with an auto-caption

[edit]
Map
About OpenStreetMaps
Maps: terms of use
14km
8.7miles
8
8 Motuoapa
8 Motuoapa
7
6
6 Tuaropakai (Mōkai)
6 Tuaropakai (Mōkai)
5
5 Rangitoto Range
5 Rangitoto Range
4
4 Pūkawa
4 Pūkawa
3
3 Motutere
3 Motutere
2
2 Waihaha
2 Waihaha
1
File:New Zealand North Island relief map.jpg
Places in the life of Herea
1
Kaiwha
2
Waihaha
3
Motutere
4
Pūkawa
5
Rangitoto Range
6
Tuaropakai (Mōkai)
7
Waitahanui pa
8
Motuoapa
|    minimap = file bottom right 
|  mini-file = New Zealand North Island relief map.jpg
| mini-width = 65  
|mini-height = 88
| minipog-gx = 54 
| minipog-gy = 59 <!-- Upper left is (0,0), lower right is (100,100). -->
| minimap-boxwidth = 13 <!-- gx,gy is centre of box -->

| mark-coord1= {{coord|-38.50990|175.69186}}
| mark-title1 =Kaiwha
| shape1=n-circle
| shape-color1=dark blue
| shape-outline1=white
| mark-size1=16
| mark-coord2 =  {{coord|38.762649|S|175.685639|E}}
| mark-title2 = [[Waihaha]]
| mark-coord3= {{coord|-38.88643|175.95359}}
| mark-title3 = [[Motutere, New Zealand|Motutere]]
| mark-coord4 =  {{coord|38|55.0|S|175|45.3|E}}
| mark-title4 = [[Pukawa|Pūkawa]]
| mark-coord5 =  {{coord|38|25|S|175|35|E}}
| mark-title5 = [[Rangitoto Range]]
| mark-coord6 =  {{coord|38.526348|S|175.903913|E }}
| mark-title6 =Tuaropakai ([[Mōkai]])
| mark-coord7 =  {{coord|-38.944333|175.781431}}
| mark-title7 = Waitahanui pa
| mark-coord8 =  {{coord|-38.92148|175.86236}}
| mark-title8 = [[Motuoapa]]
| caption = Places in the life of Herea
| auto-caption=10

A map with a variety of features and a main subject.

Map
About OpenStreetMaps
Maps: terms of use
3km
1.9miles
C
a
r
d
i
g
a
n
B
a
y
P
R
E
S
E
L
I
H
I
L
L
S
Pentre Ifan, Pembrokeshire
Pentre Ifan
Pentre Ifan, Pembrokeshire
Pentre Ifan, Pembrokeshire
Bedd Arthur, Pembrokeshire
Bedd Arthur stone circle
Bedd Arthur, Pembrokeshire
Bedd Arthur, Pembrokeshire
Cerig-y-Gof chambered tomb, Pembrokeshire
Cerig-y-Gof
chambered tomb
Cerig-y-Gof chambered tomb, Pembrokeshire
Cerig-y-Gof chambered tomb, Pembrokeshire
Trellyffaint burial chamber, Pembrokeshire
Trellyffaint dolmen
Trellyffaint burial chamber, Pembrokeshire
Trellyffaint burial chamber, Pembrokeshire
Standing Stones, Pembrokeshire
Standing Stones
Standing Stones, Pembrokeshire
Standing Stones, Pembrokeshire
Bedd yr Afanc Burial Chamber, Pembrokeshire
Bedd yr Afanc
Burial Chamber
Bedd yr Afanc Burial Chamber, Pembrokeshire
Bedd yr Afanc Burial Chamber, Pembrokeshire
Banc Du Neolithic enclosure, Pembrokeshire
Banc Du
Neolithic enclosure
Banc Du Neolithic enclosure, Pembrokeshire
Banc Du Neolithic enclosure, Pembrokeshire
Carreg Coetan Arthur, Pembrokeshire
Carreg Coetan
Arthur dolmen
Carreg Coetan Arthur, Pembrokeshire
Carreg Coetan Arthur, Pembrokeshire
Llech-y-Tribedd, Pembrokeshire
Llech-y-Tribedd
dolmen
Llech-y-Tribedd, Pembrokeshire
Llech-y-Tribedd, Pembrokeshire
File:Pembrokeshire UK relief location map.jpg
Pentre Ifan and other nearby Neolithic sites
| mark-coord = {{coord|51.9990|-4.7700}}
|  mark-size = 14
| mark-title = Pentre Ifan, [[List of Scheduled prehistoric Monuments in north Pembrokeshire|Pembrokeshire]]
| mark-image = DMPentreIfanFront.JPG 
| mark-description = The largest and best preserved [[Neolithic British Isles|neolithic]] [[dolmen]] in [[Wales]]
|      label = Pentre Ifan
| label-size = 14,outline,background
|label-color = dark grey
|  label-pos = left,with-line
| ldx=-14|ldy=3

[edit]
Map
About OpenStreetMaps
Maps: terms of use
170km
106miles
Using 'rule' to show a dotted line
Distance = 603 miles (970 km)
John o' Groats
Using mark-line to show a red line to John o' Groats
John o' Groats
John o' Groats
Land's End
Land's End
Land's End
Land's End

Method 1: Draw a line between two markers/shapes. This is done using the 'mark-line' option within the label-pos parameter:

| label2 = Using mark-line to show a red line to John o' Groats
| shape-outline2=dark red,0
| label-pos2 = left,mark-line,1,solid <!-- this draws a red line to the previous marker, and aligns the label to it -->
| ldx2=-4

Method 2: Include an additional marker, that uses the 'rule' shape option to draw a line of given length and angle.

|mark-coord3={{coord|54.6|-4.305}}
|mark-size3=350
|shape3=rule                         <!-- this draws a 'rule' line on a given angle, centred at a particular point -->
|shape-angle3=-80.2
|label-angle3=-80.2
|label-pos3=center
|ldy3=-34| ldx3=24
|label3=Using 'rule' to show a dotted line^ Distance = 603 miles (970 km)
|shape-outline3=dark grey,5,40,dotted
Map
About OpenStreetMaps
Maps: terms of use
1km
0.6miles
Richard's 'precipitate move'
towards Henry
Henry's
Retinue
Advance of Brackenbury
and Norfolk
Advance of
Oxford, Savage
and Talbot
Henry's
Forces
Camp of
Richard III
Battle of Bosworth,1485. Peter Foss scenario for mapping/Arrows demonstration


It is also now possible (2016) to add arrows to the 'calling end' of a 'mark-line' line. The strategy is to set up the mark-line at the end wanting the arrow, set the shape=arrowhead, and all other parameters as preferred. The arrowhead angle and any label text are automatically given an angle to match the line (unless overidden by 'shape-angle=' and 'label-angle=').

| mark-coord6={{coord|52.5926|-1.4466}}  <!-- this is the point of the map that the arrow points to -->
|  label-pos6=top,mark-line,6,solid,1,2  <!-- ''pos, line-option, thickness, gap for double line, number of the mark at the other end of the line'' -->
| shape-outline6=soft red,0              <!-- this sets the colour of the line -->
| shape-color6=hard red                  <!-- this sets the colour of the arrowhead -->
| shape6=arrowhead
| mark-size6=25
| label-size6=12,background
| label-color6=dark red
| label6 = Advance of Brackenbury ^and Norfolk
| ldx6=15| ldy6=0

Using the new photo-panel feature to highlight a landmark

[edit]
Map
About OpenStreetMaps
Maps: terms of use
920m
1003yds
L
a
k
e
B
u
r
l
e
y
G
r
i
f
f
i
n
National Carillon
File:National Carillon, Canberra ACT.jpg
National
Carillon
National Carillon
National Carillon
| mark-coord1 = {{coord|-35.2985|149.1417}}  <!--nb panel-height defaults to 50 -->
| label-pos1=left, photo-panel, 0.65, 83  <!-- photo-dim, panel-width[, panel-height]-->
| label-color1=hard blue         <!-- in photo-panel this is also outline/line color -->
| ldx1=-36| ldy1=-93               <!-- sets relative position of panel to it's mark -->
| label1=National ^Carillon                  <!-- label text is put inside the panel -->
| mark-title1=[[National Carillon]]          <!-- if wikilink the dot will be 'live' -->
| mark-image1=National Carillon, Canberra ACT.jpg    <!--used in panel and fullscreen-->

Using numbered dots, including the new lines features to sort out crowded dots

[edit]

Country-scale map with live-link locator dots (zoom=5)

Map
About OpenStreetMaps
Maps: terms of use
190km
118miles
14
14 Austerlitz
14 Battle of Austerlitz on 2 December 1805
14 Battle of Austerlitz on 2 December 1805
13
13
13 Battle of Wischau on 25 November 1805
13 Battle of Wischau on 25 November 1805
12
12 Battle of Schöngrabern on 16 November 1805
12 Battle of Schöngrabern on 16 November 1805
11
11 Battle of Dürenstein on 11 November 1805
11 Battle of Dürenstein on 11 November 1805
10
10 Battle of Mariazell on 8 November 1805
10 Battle of Mariazell on 8 November 1805
9
9 Battle of Amstetten on 5 November 1805
9 Battle of Amstetten on 5 November 1805
8
8 Battle of Lambach on 31 October 1805
8 Battle of Lambach on 31 October 1805
7
7 Ulm
7 Battle of Ulm from 15 to 20 October 1805
7 Battle of Ulm from 15 to 20 October 1805
6
6
6 Battle of Elchingen on 14 October 1805
6 Battle of Elchingen on 14 October 1805
5
5 Battle of Memmingen on 14 October 1805
5 Battle of Memmingen on 14 October 1805
4
4
4 Battle of Haslach-Jungingen on 11 October 1805
4 Battle of Haslach-Jungingen on 11 October 1805
3
3 Battle of Günzburg on 9 October 1805
3 Battle of Günzburg on 9 October 1805
2
2
2 Battle of Wertingen on 8 October 1805
2 Battle of Wertingen on 8 October 1805
1
1
1 Donauwörth on 7 October 1805
1 Donauwörth on 7 October 1805
  current battle
  Napoleon in command
  Napoleon not in command
| label6=
| label-pos6=top, n-line
| label-size6=12,outline,background
| ldx6=-11|ldy6=-18
| mark-coord6={{coord|48.45|10.1}}
| mark-title6=[[Battle of Elchingen]] on 14 October 1805

Using new shapes and line features to add items relevant to the article

[edit]

Landscape-scale map with a selection of features. (zoom=14)

Map
About OpenStreetMaps
Maps: terms of use
350m
382yds
Blast Furnaces at Banwen
Blast
Furnaces
Blast Furnaces at Banwen
Blast Furnaces at Banwen
Roman Road
Powys
Neath Port Talbot
Roman road
Memorial Stone to St Patrick
St Patrick
Memorial Stone
Memorial Stone to St Patrick
Memorial Stone to St Patrick
Henrhyd Waterfall
Henrhyd
Waterfall
Henrhyd Waterfall
Henrhyd Waterfall
Roman
Marching
Camp
Roman Fort
Roman Auxiliary Fort
Roman Auxiliary Fort
Map of the area around Banwen, South Wales, showing the Roman roads and earthworks close to the border between Neath Port Talbot and Powys.[1]
| mark-coord1 = {{coord|51.78365|-3.6553}} 
| shape1=box
| mark-size1=17,17,3
| shape-outline1=hard grey,1,70
| shape-color1=white
| shape-angle1=-9
| label1 = Roman Fort
| ldx1=-3
| mark-title1 = [[Roman auxiliaries in Britain|Roman Auxiliary Fort]]
| label-pos1=left
| label-angle1=0
| label-size1 = 12

...

| mark-coord8 = {{coord|51.7860|-3.6667}} 
| mark-size8=0
| mark-title8 = none
| label8=Powys^Neath Port Talbot
| label-size8=8
| label-angle8=-1
| label-pos8=center
| label-color8=black,40

Example from Margam Stones Museum (right) landscape scale locator dots (zoom=12)

Map
About OpenStreetMaps
Maps: terms of use
1km
0.6miles
8
Eglwys Nunydd cross
7
7 Railway Station cross
6
Ilci and Ilquici
5
5 Abbey Church
and Chapter House
4
4: Pillar of Thomas
3
Bodvoc Stone
2
Pumpeius Stone
File:Margam Stones Museum (5612).jpg
1
Stones
Museum
Source locations for the Margam Stones (where known).
1
Margam Stones Museum
2
Pumpeius Stone (Kenfig)
3
Bodvoc Stone
4
Cwrt Uchaf (4, Pillar of Thomas; also 9 and 16)
5
Margam Church and churchyard (5,6,7, 8 and 15)
6
Cwrt-y-defaid (10, 11: Ilci and Ilquici crosses)
7
Port Talbot Railway Station (cross 12)
8
Eglwys Nunydd (Cart wheel cross 13)

Using map-raw to show customised areas and lines

[edit]
Map
About OpenStreetMaps
Maps: terms of use
600km
373miles
P
a
c
i
f
i
c
P
l
a
t
e
A
u
s
t
r
a
l
i
a
n
P
l
a
t
e
Trobriand plate
Woodlark plate
Solomon Sea plate
South Bismarck plate
Solomon Sea and New Britain subduction zone features:
Key:
  •   South Bismarck plate
  •   Solomon Sea plate
  •   Trobriand plate
  •   Woodlark plate
  •   Active extension boundaries
  •   Active trench subduction boundaries
  •   Inactive trench subduction boundaries
  •   zone of earthquake activity up to 70 km deep
  •   zone of earthquake activity > 70 km deep
  • Mouse hover over feature to see its name/link

This Solomon Sea map makes use of raw GeoJSON files to show complex tectonic features. The GeoJSON code can be contained within a separate file. In this case it uses two data files called by:

|map-raw={{Wikipedia:Map data/Solomon Sea plate}},{{Wikipedia:Map data/New Britain subduction zone}}

In production note that only selected tectonic features were selected out that were most relevant to an article, as such complex maps can be hard to understand.

Raw GeoJSON has been used in many {{mapframe}} calls used in say infoboxs, before this capacity existed via {{OSM Location map}}. According the GeoJSON code between square brackets [...] in a {{mapframe}} could be used now in a {{OSM Location map}} call if an editor desired to say add extra labels to the map. Complex large raw GeoJSON files can have significant server side processing overhead and some {{mapframe}} code has needed an optimisation trick #tag: to get Lua processing time consistently below the 10 second maximum allowed. An example is on the page Mount Cargill. Such GeoJSON could now be used in a {{OSM Location map}} call and is unlikely to create such issues. See Wikipedia:Map data for a list of the many pre-existing raw GeoJSON files that can now be used in {{OSM Location map}} calls. Changing a {{mapframe}} to {{OSM Location map}} call can improve server side page processing times if the optimisation trick mentioned has not been used.

Map using WikiData Query Service (WDQS)

[edit]
Map
About OpenStreetMaps
Maps: terms of use
900km
559miles
US State Governers
Republican
Democrat


Using a Sparql query it is possible to add live data extracted from Wikidata, to show on a map. The US State Governor party allegiance map also adds links and photos within the fullscreen version, and is created using

|map-wdqs-type=geoshape
|map-wdqs=SELECT ?id ?head (SAMPLE(?img) as ?img_) (min(?partyId) as ?party) (if(?party = '0', '#DB3123', if(?party = '1', '#4B77D6', '#008000')) as ?fill) (concat('[[w:', substr(str(?link),31,400),  '{{!}}', ?headLabel, ']]') as ?title) (concat(?stateLabel, '\\n', '[[File:', substr(str(?img_), 52, 400), '{{!}}200px]]') as ?description) WHERE { ?id wdt:P31 wd:Q35657 . ?id wdt:P6 ?head . ?head wdt:P102 ?party . BIND(if(?party = wd:Q29468, '0', if(?party = wd:Q29552, '1', '2')) as ?partyId) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?head rdfs:label ?headLabel . ?id rdfs:label ?stateLabel . } OPTIONAL { ?head wdt:P18 ?img . } ?link schema:about ?head . ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?head ?headLabel ?link ?stateLabel

References

  1. ^ Royal Commission on the Ancient and Historical Monuments of Wales (1976). Glamorgan Inventory, Vol 1, Part 2: The Iron Age and Roman Occupation. p. 100.

Maps using WikiData en:Wikipedia template calls

[edit]
Map
About OpenStreetMaps
Maps: terms of use
140km
87miles
2
Plateaux Region
(1,635,946)
2 Plateaux Region, Togo (population 1,635,946)
2 Plateaux Region, Togo (population 1,635,946)
1
Maritime
(2,599,955)
1 Maritime Region, Togo (population 2,599,955)
1 Maritime Region, Togo (population 2,599,955)
5
Centrale Region
(795,529)
5 Centrale Region, Togo (population 795,529)
5 Centrale Region, Togo (population 795,529)
4
Kara Region
(985,512)
4 Kara Region (population 985,512)
4 Kara Region (population 985,512)
3
Savanes Region
(1,143,520)
3 Savanes Region, Togo (population 1,143,520)
3 Savanes Region, Togo (population 1,143,520)
Population Map of Togo's five regions.
Total Togo population (wikidata:Q945) = 7,797,694 (2017)
(WD = Wikidata page)

Data Table ranked by population size.
Togopop.
1
Maritime Region, Togo2,599,955 WD
2
Plateaux Region, Togo1,635,946 WD
3
Savanes Region, Togo1,143,520 WD
4
Kara Region985,512 WD
5
Centrale Region, Togo795,529 WD

1) Automated to find sub-regions of a territory, and a value relating to those regions. The dots are then given a relative size to reflect the different values - in this case the populations of each of Togo's 5 regions. It also labels each dot, shows the territorial boundaries (if available from OSM) and provides a table of the data.

{{OSM Location map
| coord = {{coord|qid=Q945}} <!-- find the coords. Q945 is Togo, used several times to find different attributes-->
| zoom =6
| width = 200          <!-- width and height of the frame. numeric input - do not add px -->
| height = 310
| scalemark=10
| caption =  Population Map of Togo's five regions.
| geo-region=Q945     <!-- This wikidata entry provides the list of sub-regions, if it has been added -->
| geo-sub-region=P150 <!-- normally P150 (contains administrative areas), or can be P527 (parts)  -->
| geo-data-type= P1082<!-- Population is P1082, households is P1538, per capita income (P10622), land area (P2046) -->
| map-data-inverse=Q945
| geo-scalefactor=0.7 <!-- scales the dots to a sensible size for the space on a map -->
| geo-number-size=11  <!-- sets the dot-numbers to the same size, even if the dots are different sizes -->
| geo-boundaries=1    <!-- draws the boundary lines, if available -->
| geo-list-sort=VH    <!-- sort by value, highest first. Other options are A-alphabetic, N=north-first, W=west-first-->
| shapeD=n-circle
| shape-colorD=dark red,50
| shape-outlineD=white
| label-posD=right^   <!-- adds the labels (^ = data value with line break) (use 'off' to use without labels)
| ldyD=3              <!-- shifts all the labels down a bit -->
| label-sizeD=10,background,outline
| auto-caption=on     <!-- show the total and data table (geo-data tables always start collapsed) -->
| toggletext = Data Table ranked by population size.
}}

2) Discoverings and displaying data manually from Wikidata:

Map
About OpenStreetMaps
Maps: terms of use
2km
1.2miles
Murgindueta
Murgindueta (5 population), human settlement in Araquil, Navarre, Spain
Murgindueta (5 population), human settlement in Araquil, Navarre, Spain
Itsasperri
Itsasperri (0 population),
Itsasperri (0 population),
Aizkorbe
Aizkorbe (20 population), human settlement in Spain
Aizkorbe (20 population), human settlement in Spain
Zuhatzu
Zuhatzu (42 population), human settlement in Arakil, Navarre, Spain
Zuhatzu (42 population), human settlement in Arakil, Navarre, Spain
Urritzola
Urritzola (19 population), human settlement in Araquil, Navarre, Spain
Urritzola (19 population), human settlement in Araquil, Navarre, Spain
Satrustegi
Satrustegi (53 population), settlement and administrative division (consejo) in Araquil, Navarre, Spain
Satrustegi (53 population), settlement and administrative division (consejo) in Araquil, Navarre, Spain
Izurdiaga
Izurdiaga (178 population), human settlement in Araquil, Navarre, Spain
Izurdiaga (178 population), human settlement in Araquil, Navarre, Spain
Yábar
Yábar (136 population), concejo de Navarra, España
Yábar (136 population), concejo de Navarra, España
Hiriberri Arakil
Hiriberri Arakil(114 population), human settlement in Araquil, Navarre, Spain
Hiriberri Arakil(114 population), human settlement in Araquil, Navarre, Spain
Etxeberri
Etxeberri (60 population), settlement and administrative division (consejo) in Araquil, Navarre, Spain
Etxeberri (60 population), settlement and administrative division (consejo) in Araquil, Navarre, Spain
Etxarren
Etxarren (157 population), human settlement in Araquil, Navarre, Spain
Etxarren (157 population), human settlement in Araquil, Navarre, Spain
Ekai
Ekai (34 population), human settlement in Araquil, Navarre, Spain
Ekai (34 population), human settlement in Araquil, Navarre, Spain
Eguiarreta
Eguiarreta (77 population), municipal capital of the Araquil, Navarra, Spain
Eguiarreta (77 population), municipal capital of the Araquil, Navarra, Spain
Errotz
Errotz (67 population), human settlement in Araquil, Navarre, Spain
Errotz (67 population), human settlement in Araquil, Navarre, Spain
Settlements in Arakil municipality.

Several templates exist that allow access WikiData. The en:Wikipedia has templates/modules {{Coord}}, {{wd}} and {{WikidataIB}} as well as others that are depreciated. An example of a hard coded population map of a locality is given that calls code like:

| coord = {{Coord|qid=Q1753006}}
| map-data-inverse =Q1753006
| label-sizeD =14,background,outline
| label-posD = top
| shapeD = circle
| shape-colorD = soft red,70

and repeats for each population centre

| mark-coord1 = {{Coord|qid=Q3057492}}
| mark-size1 = {{#expr:1+{{#invoke:wd|property|Q3057492|P1082}}/{{#invoke:wd|property|Q1753006|P1082}}*200}}
| mark-description1 = {{#invoke:wd|description|Q3057492}}
| label1 = {{#invoke:wd|label|Q3057492}}
| mark-title1 = [[{{#invoke:wd|label|Q3057492}}]] ({{#invoke:wd|property|Q3057492|P1082}} population), {{#invoke:wd|description|Q3057492}}

Some pages with example uses for OSM Location map

[edit]

Roman Britain fortress ground plans, etc

[edit]

Townscape scale maps to show 'on-the-ground' features (zoom 15/16)

Building-scale architectural plan

[edit]

(zoom=19) St Illtyd's Church, Llantwit Major