Template:Mapshapes/doc
This is a documentation subpage for Template:Mapshapes. It contains usage information, categories and other content that is not part of the original template page. |
Documentation
editThis template overlays a group of shapes on a dynamic map using Template:Mapshape. Currently only geolines are supported.
The specified wikidata entry's sub-parts are iterated and each added as new Mapshape - with the right color applied. Primarily from statement P465/sRGB color hex triplet, fallback to P462/color, or template's default-color parameter.
Note that when the color property is modified on Wikidata, it takes a few moments to reflect on Wikivoyage.
Parameters
edit- (Mandatory) First argument is Wikidata ID of the 'parent' item. From this, sub-mapshapes are gathered via the P527/"has part" property - with a fallback to P2670/"has parts of the class".
- (Optional) Up to 9 Wikidata IDs can be specified - only those will be shown. If no ID is specified, all child items are shown.
- stroke-width: (Optional) Overrides the default Mapshape stroke-width.
- stroke-opacity: (Optional) Overrides the default Mapshape stroke-opacity.
- default-color: (Optional) If no color information is available for a particular Mapshape in wikidata, this color is used. If unspecified, black (#000000) is used.
- group: (Optional): Overrides the default Group (mask).
Example
editMap metro lines in Wien using default values:
{{Mapframe|48.209|16.366|zoom=11}}
{{Mapshapes|Q209400}}
To only show one line:
{{Mapframe|49.4700|10.9907|zoom=11}}
{{Mapshapes|Q697512|Q3433210}}
Wikidata/OSM requirements to allow showing (public-)transport lines
editThe entry point of showing a mapshape is having a proper structure of the wikidata and OSM data. Basically, this is what we want to end up with:
- Root wikidata entry of the transport system should contain links to its lines in has parts (P527) statements. Example: Q190271.
- Each of the referenced lines contains (e.g. Q1292805):
- color (P462) and/or sRGB color hex triplet (P465), the latter has preference. Optionally, P462 can have P465 specified as a qualifier (see e.g. Q168571#P462).
- OSM relation ID (P402) referring to the data in OSM.
- Finally, the OSM data referred by wikidata has the link back to wikidata, using the wikidata= (e.g. 7772996) tag.
If this is all done, this template will create Mapshape for each of the lines referenced by the root wikidata entry (using the right color). There's a (common) special case, see Template:Mapshape/doc#OSM wikidata tags.
Tutorial
editEditing wikidata is easy enough, but OSM may get a bit intimidating for novice users. Please take your time to get used to it and don't destroy the database :)
This tutorial will show what has to be done to setup a transport system almost from scratch - in this case for Nuremberg. It expects that the data is already in place - i.e. that the wikidata for the transport system+individual lines exist, and that the OSM data already contain at least the relations for the transport lines. This is quite common, and it means that only the links need to be added to put it all together.
In the end, it's a detective work, but quite repeating in most cases.
- Find the wikidata entry for the metro. Quickest way seems to be - google "$city metro wiki" to find the wikipedia article. Sometimes also direct search on wikidata.org works :) ----> w:Nuremberg_U-Bahn. The corresponding wikidata item can be found on the left part of wikipedia, in "Tools"/Wikidata item ----> Q697512.
- If the has parts statement contains links to the transport lines, skip to next step. Otherwise, you'll have to find the lines (and create has parts statement, if there's nothing). Usually the easiest way is to go back to the wikipedia article and find some line list there. E.g. w:Nuremberg_U-Bahn#Network. From each of the wikipedia line articles (w:U1_(Nuremberg_U-Bahn), again gather the wikidata entry (Q3433210). Afterwards, get back to the main wikidata article, and add the lines into 'has part' statement, one by one.
- Find/fix the wikidata-OSM links acc. to Template:Mapshape#Editing tutorial
If the OSM stuff was missing, wait for a few days until the changes to reflected on wikivoyage. Otherwise the changes should reflect after cache purge (easiest way - add ?action=purge to url; or do empty edit - just hit "Publish changes' button without any changes).
See also
edit- {{Mapshape}} - Template used to add a the individual mapshapes.
Adds a group of geoshapes to interactive map. Currently only supports adding geolines.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Wikidata 1 | 1 | First Wikidata QID parent item associated with Geoshape (only supports Geoline)
| String | required |
Wikidata 2 | 2 | Second Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Wikidata 3 | 3 | Third Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Wikidata 4 | 4 | Fourth Wikidata QID parent item associated with Geoshape (only supports Geoline) | Unknown | optional |
Wikidata 5 | 5 | Fifth Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Wikidata 6 | 6 | Sixth Wikidata QID parent item associated with Geoshape (only supports Geoline) | Unknown | optional |
Wikidata 7 | 7 | Seventh Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Wikidata 8 | 8 | Eighth Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Wikidata 9 | 9 | Ninth Wikidata QID parent item associated with Geoshape (only supports Geoline) | String | optional |
Stroke Width | stroke-width | If entered, overrides the default stroke width | Number | optional |
Stroke Opacity | stroke-opacity | If entered, overrides the default stroke opacity | Number | optional |
Default Color | default-color | If wikidata related shape does not have a colour already assigned, the shape will be assigned the hex colour entered here. If not entered, shapes that do not already have colours will be assigned the colour #000000 (ie black)
| String | optional |
Overrides the default group mask | group | no description | String | optional |