Wikipedia:Creating route maps from OpenStreetMap data
Finding the route data on OpenStreetMap
Using the OpenStreetMap website
- Go to OpenStreetMap and zoom into the general area where the route runs.
- Switch to the "Transport Map" layer using the
'Layers' sidebar on the right.
- Now you should see all the transit routes highlighted on the map, with numbers indicating the route numbers. Select a route by right-clicking (control-click on Macs) and selecting 'Query features'.
- Then search through the list for the route you desire; selecting it will bring you the relation representing the route, with the route displayed beside it on the map.
Using the OSM Relation Analyzer
If you already know how the relation would be tagged, the OSM Relation Analyzer can be more convenient:
- Go to the OSM Relation Analyzer.
- Set Relation Type to route.
- Set Network to a route network identifier, such as COTA, or set Operator to an agency name, such as Central Ohio Transit Authority.
- Set Ref Tag to the route number, for example 10.
- Optionally set Route to bus if the same agency assigns the same route number to a bus line and another kind of route.
- Click Search.
- Click the relevant relation ID (generally several digits long), then click Browse to see it on the OpenStreetMap website.
Embedding the route into an article
There are two ways to embed the route into an article, both using the {{maplink}} template:
Using Wikidata
If the route has a Wikidata item and the OpenStreetMap route relation already has a wikidata
tag set to that item's QID, you can embed a map of the route directly onto a Wikipedia article as external data. Use the {{maplink}} template, setting the |id=
parameter to the QID, such as Q88466277. Normally, changes to the route in OpenStreetMap are reflected in the article within about two days.
Note: Due to downtime in the service that synchronizes Kartographer with OpenStreetMap, any element tagged after January 24 won't be picked up by this service, making this easier route impossible for newly-tagged elements.
Using Wikimedia Commons
Using map data on Wikimedia Commons:
- Paste the relation ID into this Overpass query, replacing '8343040'. The ID filter is actually one of many possible filters you could use here.
- Run the query, then click 'Export' in the toolbar and select the 'copy' part of 'download/copy as GeoJSON'
- In Wikimedia Commons, create a page in the Data: namespace with the .map extension, like c:Data:COTA10.map
- When you create the page, replace the 'Data' placeholder (including the two brackets) with the GeoJSON you copied.
- Uncomment the line
"license": "ODbL-1.0", // ODC Open Database License v1.0
and save the page. - You may need to adjust the coordinates or zoom level in order for the map to display properly; here you can also add parameters for line width, color, etc.
- Then you can use the map data in Wikipedia articles, through {{maplink}} using the parameter
|from=COTA10.map
, or manually, like seen here.
If the route changes in OpenStreetMap, repeat steps 1 through 3 to update the Wikimedia Commons map data page.