Template:Osm-query2/doc

From OpenStreetMap Wiki
Jump to: navigation, search


Documentation

Note: This template replaces the Template:Osm-query, which was designed for the first versions of Query-to-map. The now used mapnik-database is incompatible and it is necessary to use this new template.

This template requests points-, lines- and areas-object-types from the Wikimedias Toolserver and displays them on a map, which can be combined with a list of the selected objects. It's possible to ask for a name and/or any key/value pair in combination with a bounding box. Following parameters can be used:

Inputparameter

  • name= name of the relation, way, node or area (should have the same result as provided by the Template:Osm-query-name)
  • key= name of the asked key.
  • value= value of the asked key


Outputparameter

  • types= points (node), lines (relation and way) and areas (if left blank:"points-lines-areas")
  • list= if a list is requested by using "yes", then a list of the selected objects is shown in addition to the map (if left blank:"no"). This parameter has no effect (empty list) if relations are requested.
  • bbox= bounding box (mandatory)
  • desc= Output description in the wiki (if left blank, the name-parameter will be used as description; if it is blank as well, the key-parameter and value-parameter will be used). In any case the prefix "map" or "list/map" will be added by the template, which depends on the list-parameter.


Empty complete template

You can also use short forms. See examples below.

{{osm-query2
 |name=
 |key=
 |value=
 |types=
 |list=
 |bbox=
 |desc=
 }} 

Examples

Example way with list-output

{{osm-query2
 |key=tree_lined
 |value=yes
 |list=yes
 |bbox=7.1,50.8,7.2,50.95
 |desc=Tree lined street near Lohmar
 }} 

Result: list/map: Tree lined street near Lohmar


Result if desc is blank: list/map: tree_lined=yes


Example way

{{osm-query2
 |name=Bahntrassenradweg Bergisch Born - Marienheide
 |types=lines
 |bbox= 7.25,51.07,7.54,51.17
 }}  

Result: map: Bahntrassenradweg Bergisch Born - Marienheide


Example way combined with a filter key/value and list

The list has only one value because the object is selected by unique name

{{osm-query2
 |name=Bahntrassenradweg Bergisch Born - Marienheide
 |key=railway
 |value=abandoned
 |types=lines
 |list=yes
 |bbox= 7.25,51.07,7.54,51.17
 |desc=Rail Trail Bergisch Born - Marienheide only abandoned railway
 }}  

Result: list/map: Rail Trail Bergisch Born - Marienheide only abandoned railway


Example relation plus points

{{osm-query2
 |key=network
 |value=VRS
 |types=lines-points
 |bbox= 7.2,50.8,7.6,51.0
 |desc=public transport network vrs
 }}  

Result: map: public transport network vrs


Example nodes

{{osm-query2
 |key=amenity
 |value=restaurant
 |types=points
 |list=yes
 |bbox= 7.15,50.86,7.25,50.88
 |desc=Restaurants
 }}  

Result: list/map: Restaurants


Example areas

{{osm-query2
 |key=building
 |value=yes
 |types=areas
 |list=yes
 |bbox= 7.15,50.86,7.25,50.88
 }}  

Result: list/map: building=yes