User:Planemad/Kartographer maps workshop

Workshop to create maps with Kartographer at WikidataCon Berlin.
 * Date: Sunday 29 October 2017
 * Venue and Time: Room 'E' 12.30-13.30PM

= Resources =
 * https://www.mediawiki.org/wiki/Help:Extension:Kartographer#External_data
 * https://www.wikidata.org/wiki/Template:Wikidata_list

= Guides & Documentation =
 * https://en.wikipedia.org/wiki/User:Naveenpf/sandbox#Districts_in_India
 * https://www.wikidata.org/wiki/Template:Wikidata_list

= Workshop =

Wikimedia Maps
The Wikimedia Map service is the primary provider of open maps for Wikimedia Projects. The service consists of a zoomable street level map of the world generated using data from the OpenStreetMap Project.
 * Wikimedia Maps: Browse
 * Improve the map data on OpenStreetMap: Map | Wiki

OpenStreetMap
The OpenStreetMap Project is the largest source of crowdsourced geographical data. It takes a few minutes to sign up and improve the map of your home neighborhood using the online map editor called iD via the [edit] button. One can add or improve any type of map feature like roads, buildings, trees and even trash cans.

This make OSM the ideal database to store open map data. The data is licensed under the ODbL license which allows data reuse with attribution and share alike.

OSM Data structure
Every map feature is defined as shape (points, lines, areas) and some metadata (`key`=`value` pairs) called tags. This allows adding defining a full geographical feature like a street with its shape and properties like road type, width, multilingual and even a Wikidata reference.

It is also possible to group smaller shapes as a larger group with a different set of tags. This is called a relation and is commonly used for defining boundaries, highway routes and river systems.


 * Use taginfo to find commonly used tags for the feature you want to map

Adding Wikidata ids to OSM
Adding Wikidata tags to OSM map features helps link map features on the OSM database to their associated item on the Wikidata database. This allows:
 * querying a map feature from OSM based on a Qid
 * adding extra metadata form Wikidata to map features like language labels

See http://wiki.openstreetmap.org/wiki/Wikidata#Linking_from_OSM_to_Wikidata

Adding OSM ids to Wikidata
Adding OSM ids to Wikidata is not encouraged since the OSM ids can change as the shapes are merged or split often. Relation ids are more stable and can be added using Property:P402

See http://wiki.openstreetmap.org/wiki/Wikidata#Linking_from_Wikidata_to_OSM

Adding OSM tags to Wikidata
Tags on OSM help describe the various properties of map features. These tags can also be added to their corresponding Wikidata item using Property:P1282. This allows:
 * querying wikidata items by OSM tags. Example: Items on Wikidata tagged with OSM tag for city

= Creating Wiki maps using OSM data =

Now that we have updated map data on the OpenStreetMap Project with Wikidata links, it can be used to embed interactive maps on Mediawiki sites with a few lines of code. There are two ways to do this:

Kartographer Maps
The easiest way to embed

 { "type": "ExternalData", "service": "geoshape", "ids": "Q797" }


 * Resources: https://www.mediawiki.org/wiki/Help:Extension:Kartographer/OSM

Shape Types =

 * geoshape


 * geoline


 * geopoint