Wikipedia:Creating shape maps from OpenStreetMap data: Difference between revisions
Content deleted Content added
not for use on non-articles |
|||
(12 intermediate revisions by 2 users not shown) | |||
Line 2:
This is a tutorial for creating interactive maps on Wikipedia for shapes using [[OpenStreetMap]] data, available on a compatible [[Open Database License]]. This is applicable for creating maps of neighborhoods, parks, historic districts, campuses, and most other present-day sites. For maps of lines (transit routes, roads, etc.), see [[Wikipedia:Creating route maps from OpenStreetMap data]].
This tutorial requires basic knowledge of:
* finding Wikidata IDs
There are two methods you can use to find the space you want to map:▼
* using {{tl|Maplink}} and its parameters (some helpful substitutes may be {{tl|Infobox mapframe}} and {{tl|Maplink-road}})
If you need help please use the talk page, [[User talk:Ɱ]], or [[Module talk:Mapframe]].
[[File:Park OSM map.jpg|thumb|upright=1.8|After right-clicking the shape you want to map (for instance, Scioto Audubon Metro Park), click 'Query features' to bring up the lefthand toolbar. Select its name to bring up its relation.]]▼
=== Method 1: Wikidata ===
The first thing to try is the easiest. There's a possibility your data is already linked and you're ready to map. Create a test map in [[Special:MyPage/sandbox|your sandbox]]. You'll need to use {{tl|Maplink}} together with the Wikidata ID of the shape. As an example: <kbd><nowiki>{{maplink|frame=yes|type=shape|id=Q160236}}</nowiki></kbd> If it displays, great. You can use the map and add parameters to make it display to your liking. If the map data does not populate, the below methods are straight-forward and reliable:
=== Method 2: Using the OpenStreetMap website ===
▲[[File:Park OSM map.jpg|thumb|upright=1.8|After right-clicking the shape you want to map (for instance, Scioto Audubon Metro Park), click 'Query features' to bring up the lefthand toolbar. Select
#Go to [https://www.openstreetmap.org/ OpenStreetMap] and zoom into the general area where the shape is.
#Right-click (control-click on Macs) on the shape and select 'Query features'. This will also display shapes that may otherwise not be visible.
#Then search through the list for the shape you desire; selecting it will bring you the relation representing the shape, with the shape displayed beside it on the map.
=== Method
If you already know how the relation would be tagged, the OSM Relation Analyzer can be more convenient. '''Note:''' this can only be used for shapes that are relations, not ways.
#Go to the [http://ra.osmsurround.org/ OSM Relation Analyzer].
#Type in the item name and click 'Search'.
#Click the relevant relation ID (generally several digits long), then click 'Browse' to see it on the OpenStreetMap website.▼
▲#Click the relevant relation ID (generally several digits long), then click Browse to see it on the OpenStreetMap website.
If you found the data on OSM, continue on to Part 3. If you did not find it, continue to Part 2 first to create the shape on OpenStreetMap.
== Part 2:
This optional step is only for shapes that are not already mapped on OpenStreetMap. Note that the entity you want to map must be an existing place in order to be accepted on OpenStreetMap, as OSM is not intended to map out historical, fictional, or unrecognized entities.
# Sign up or log-in to OpenStreetMap.
Line 39 ⟶ 43:
== Part 3: Embedding the shape into an article ==
{{maplink|frame=yes|frame-width=200|frame-height=285|zoom=13|frame-lat=40.782|frame-long=-73.965|type=shape|stroke-width=3|fill=#000|fill-opacity=0.1|id=Q160409|text=[[Central Park]]}}
There are two ways to embed the shape into an article, both using the {{tl|maplink}} template:
Line 45 ⟶ 49:
If the shape has a Wikidata item and the OpenStreetMap shape relation already has a <code>wikidata</code> tag set to that item's QID, you can embed a map of the shape directly onto a Wikipedia article as [[mw:Help:Extension:Kartographer#External data|external data]]. Use the {{tl|maplink}} template, setting the {{para|id}} parameter to the QID, such as <kbd>Q88466277</kbd>. Normally, changes to the route in OpenStreetMap are reflected in the article within about two days.
Example: <code><nowiki>{{maplink|frame=yes|
=== Method 2: Using Wikimedia Commons ===
{{Maplink|frame=yes|frame-width=200|zoom=15|title=Schiller Park|type=shape|from=Schiller Park.map|text=[[Schiller Park (Columbus, Ohio)|Schiller Park]]}}
Using [[mw:Help:Map Data|map data]] on Wikimedia Commons:
#Paste the relation ID into [https://overpass-turbo.eu/s/RXB this Overpass query], replacing '8343040'. The ID filter is actually one of [[OpenStreetMap:Overpass API/Overpass QL#By element id|many possible filters]] you could use here.
|