Machine-readable Map Feature list/Tagwatch-libs

From OpenStreetMap Wiki
Jump to: navigation, search

The Tagwatch script is used to generate information about the used Tags in our database.

In order to be able to give a concrete statement about what tags are "good or bad" beside the general usage, the status of its documentation was chosen.

Therefore the lib parse the OSMwiki to get all possible information about each Tag and relation.

What Tagwatch needs:

  • Key/Tag name
  • possible Tag combinations specified in the wiki
  • short description of each Tag in every language
  • basic grouping of tags for a better overview
  • usage on nodes/ways/areas/relations

To get all information the does the following:


  • build a list of all Tag groups based on Category:Map_Features_template
  • go through all Template:Map_Features:<group> pages and parse the tables
  • go through all 'Template:<lang>Map_Features:<group> pages
  • go through all Category:<lang>:Keys categories and get the info for all keys (description, usage, image, possible values, combinations restrictions and so on)
  • go through all Category:<lang>:Tags categories get the information for all Tags that can be found there

At the end the script has all information that is available on the wiki (apart from the chaos on the proposal sub pages) The key to this methods are the Template:KeyDescription and Template:ValueDescription templates