Customising JOSM Presets

From OpenStreetMap Wiki
Jump to: navigation, search

Template:En: aid box

General

JOSM provides a range of templates. Since each mapper only works with a subset of objects, it is sometimes useful to add presets to the list or to delete unused parts.

The basic templates are already built into JOSM. Additional templates are provided by third-parties, or you can make it yourself. Templates are stored in XML format. The examples on this page use a file called eg-presets.xml. Simply yourself (eg with Notepad or gedit and rename as XML), save to your local disk and in the JOSM settings (Edit - Preferences - Settings of the map projection and data interpretation ('Gitternetz' icon) - (tab) object templates - Active Object Template) specify the path. You can add as many template files as you like.

For more information about the control parameters can be found in the header of defaultpresets.xml.

It is important that the file is saved in UTF8 format, otherwise special characters are not displayed correctly.

Presets

The 'presets' tag is where you insert items or groups

<presets>
  <-! Items or groups ->
</ Presets>

Item

The 'item' tag describes a single preset. It has at least a name, optionally also an Icon.

<item name="Merker" icon="presets/Stop.png">
   <-! Descriptive elements here ->
</item>

Descriptive elements can be:

Group

The 'group' tag encloses one or more items. It has at least a name, optionally also a Icon.

<group name="HVV-Buslinien" icon="O:/OSM/busgroup.png">
   <- Here several items ->
</ Group>

Href

This can be assigned to the object, a link to the appropriate documentation can be accessed in the wiki.

Example:

<link href="http://wiki.openstreetmap.org/wiki/Tag:leisure=slipway" />

Used in the presentation of the Key href, then this link applies to all languages ​​as a base. To gain access to country-specific websites, separate keys are to be used. The keys are then locales preceded.

Example:

 <Link href = "http://wiki.openstreetmap.org/wiki/Tag:leisure=slipway"
       de.href = "http://wiki.openstreetmap.org/wiki/DE:Tag:leisure=slipway"
       fi.href = "http://wiki.openstreetmap.org/wiki/Fi:Tag:leisure=slipway"
 />

Key

Allows the object can be assigned a tag with value, it will not appear on the form.

Example:

<key key="amenity" value="restaurant" />

Text

Opportunity for free text entry for the user

Example:

<text key="name" text="Name:" default="" delete_if_empty="true" />

Used in the presentation of the Key text, then this applies to all languages ​​as a base. To be able to spend are also country-specific texts to use separate keys. The keys are then locales preceded.

In the default presets only English words are stored. The country-specific texts are controlled there over the translation package.

Example:

  <text key="name" text="Operator:" de.text="Betreiber:" default="" delete_if_empty="true" />

Space

Inserts a blank line in the dialog.

Example:

<SPACE />

Check

Querying a truth value (true / false)

Example:

<check key="fuel_octane_98" text="98 Octane" default="off" delete_if_empty="true" />

Combobox

Provides the user a selection list, this way typo at work can be avoided.

Example:

<combo key="tourism" text="Accomodation:" values="hotel,motel,guest_house" default="" delete_if_empty="true" />

Multiselect

Provides the user a selection list in which values ​​have already been assembled into a multi-selection.
The separator (delimiter) of the individual values ​​can be optionally specified with delimiter = "[x]". A default adjusted separator ";" can usually the Keywerte will be separated not used since then with this character.

Example:

<multiselect key="operator" delimiter="," text="operator" de.text="Betreiber the Halteposition" values="VAS,JES,VAS;JES" />

Description of the attributes of each item

Key

stands for the key being assigned to the object

Value

The value to be assigned to the key

  • Required attribute in key

Text

Caption element in it Formula

Default

Starting value

In check the value 'on' or 'off' should be.

Delete_if_empty

The key will be applied to the object only if it is set

Values

Default values ​​for a combobox, separated by commas (example).

Icon

The path to an icon.

The path is an absolute filename (example), or relative to the JAR file (example).

The icon should be in PNG format and be square. Furthermore, the background color should be transparent, as it might look strange in the toolbar otherwise.

Type

Description of what type of object the item is admissible
. Valid values ​​are: 'node' = a node, 'way' a distance 'closedway' an area, 'Relation' a relation. In dialogue with their symbols are shown.

Multiple values ​​are separated by commas ie allowed:

<item name="Fountain" icon="presets/spring.png" type="node,closedway">
   <-! Descriptive elements here ->
</ Item>
  • Optional attribute in item

Name

Text that is displayed in the menu or the toolbar

Use_last_as_default

Attribute to the values ​​of the last input to accept the default value automatically. Found, for example application in the detection of addresses.

Possible values ​​are true / false.

​​=== Display_values === A comma-separated list of values ​​to be an alternative for the entries of the parameter value shown. The order must match the value of. For German-speaking de.display_values ​​values ​​may alternatively be used (see also text).


Short_description

For each of the values ​​in the parameter display_value', a short description will be deposited and the sequence must match those of display_values here. The brief descriptions here are structured as follows:

<short_description> first description </ short_description>
...
<short_description> last description </ short_description>

(Where this information is displayed in JOSM? JOSM In 5667 they are at least not displayed. Below Detached works though.)

Alternatively, the list of options in a string parameter in a comma-separated list and the list of values, each with its own day is possible:

<combo key="" text="">
<list_entry value="erster Wert" display_value="ein Wert" short_description="erste Beschreibung" />
<list_entry value="zweiter Wert" display_value="ein other Wert" short_description="zweite Beschreibung" />
</ Combo>


Examples of presets

It does not always get a dialog so that tags can be assigned. There is always the key of only one key-value pair, then only the data is assigned.

One-click Example

<item name="1Click-bridge" de.name="1-Klick-Bruecke" icon="present/bridge.png" type="way,closedway">
    <key key="bridge" value="yes" />
    <key key="layer" value="1" />
</ Item>

Other examples of the collection of road data can be found in OneClick Preset.

Gas Station

<item name="Petrol / Gas Station">
    <link href="http://wiki.openstreetmap.org/wiki/DE:Tag:amenity=fuel" />
    <label text="Tankstelle" />
    <key key="amenity" value="fuel" />
    <combo key="name" text="Name" values="Shell,BP,Esso,Murco" default="" delete_if_empty="true" />
    <combo key="brand" text="Brand" values="Shell,BP,Esso,Murco" default="" delete_if_empty="true" />
    <check key="fuel:diesel" text="Diesel" delete_if_empty="true" />
    <check key="fuel:octane_91" text="Petrol 91 octane " delete_if_empty="true" />
    <check key="fuel:octane_95" text="Petrol 95 octane" delete_if_empty="true" />
    <check key="fuel:octane_98" text="Petrol 98 octane" delete_if_empty="true" />
    <check key="fuel:biogas" text="Biogas" delete_if_empty="true" />
    <check key="fuel:lpg" text="LPG" delete_if_empty="true" />
    <check key="fuel:hydrogen" text="Wasserstoff" delete_if_empty="true" />
    <check key="fuel:electricity" text="Charger for electric cars" delete_if_empty="true" />
    <optional>
       <text key="opening hours" text="Opening Hours" default="" delete_if_empty="true"/>
       <link href="http://wiki.openstreetmap.org/wiki/Key:opening_hours?uselang=en" />
       <check key="payment:maestro_card" text="Master-Card" default="off" delete_if_empty="true" />
       <check key="payment:banknotes" text="Cash" default="off" delete_if_empty="true" />
     </ Option>
</ Item>

Health & Beauty Shops

<item name="Chemist">
    <link href="http://wiki.openstreetmap.org/wiki/DE:Map_Features#Gesch.C3.A4fte" />
    <label text="Drogerie" />
    <key key="shop" value="chemist" />
    <text key="name" text="name" delete_if_empty="true" />
    <combo key="brand" text="Chain" values="Boots,Superdrug" default="" delete_if_empty="true" />
</ Item>

Bus stop of the Hamburg Transport Association

<item name="HVV Bushaltestelle">
    <link href="http://wiki.openstreetmap.org/wiki/DE:Tag:highway=bus_stop" />
    <label text="Bus Stop" />
    <key key="highway" value="bus_stop" />
    <text key="name" text="Schildname (name)" delete_if_empty="true" />
    <text key="network" text="Netz (network)" default="HVV" delete_if_empty="true" />
    <combo key="operator" text="Operator" values="VHH,HHA,PVG,KVG,AK,KVIP" default="" delete_if_empty="true" />
    <check key="shelter" text="Shelter" default="off" delete_if_empty="true" />
</ Item>

Bus Route of the Hamburg Transport Association (relation)

<item name="HVV-Buslinie" type="relation">
    <Link />
    <label text="HVV bus bearbeiten" />
    <key key="type" value="route" />
    <key key="route" value="bus" />
    <key key="network" value="HVV" />
    <text key="ref" text="Linie (ref)" delete_if_empty="true" />
    <text key="name" text="Name" default="HVV-Buslinie xxx" delete_if_empty="true" />
    <optional>
        <combo key="operator" text="Betreiber (operator)" values="VHH,HHA,PVG,KVG,AK,KVIP" default="HHA" delete_if_empty="true" />
        <text key="from" text="Von" delete_if_empty="true" />
        <text key="to" text="Nach" delete_if_empty="true" />
        <text key="note" text="Bemerkung" delete_if_empty="true" />
    </ Option>
</ Item>


Bike Rental (in conjunction with StadtRADHamburg)

see also # bicycle hire howto Map A

<item name="Fahrrad-Verleih">
    <link href="http://wiki.openstreetmap.org/wiki/DE:Howto_Map_A#Fahrrad-Verleih" />
    <label text="Fahrrad-Verleih" />
    <key key="amenity" value="bicycle_rental" />
    <text key="name" text="Name" delete_if_empty="true" />
    <text key="network" text="Betreiber" default="stadtradhamburg" delete_if_empty="true" />
    <Text key = "ref" text = "station no." default = "" delete_if_empty = "true" />
    <text key="capacity" text="Anzahl Stellplätze" default="" delete_if_empty="true" />
</ Item>


A list of the tags below to find is Category: Tags and [Tags by value] [: Category].

Milestones

<item name="Meilenstein">
    <link href="http://wiki.openstreetmap.org/wiki/DE:Howto_Map_A#Meilensteine" />
    <label text="Milestones" />
    <key key="historic" value="milestone" />
    <text key="name" text="Name" default="" delete_if_empty="true" />
    <text key="year" text="Jahr" default="" delete_if_empty="true" />
    <text key="ref" text="km" default="" delete_if_empty="true" />
    <check key="moved" text="No longer in original location" default="off" delete_if_empty="true" />
</ Item>

Cycling and footpath combinations

This template takes into account describes the various combinations of walking and cycling paths as in [1].

<annotations>
<group name="Fuss-Rad-Weg" icon="presets/cycleway.png">
free <item name="Fussweg-Rad (239+Zusatz)" icon="presets/cycleway.png">
<label text="Fussweg (Rad frei) bearbeiten"/>
<Link href = "http://wiki.openstreetmap.org/wiki/DE:Bicycle/overview_ways"
/>

<label text=" "/>
<key key="highway" value="path"/>
<key key="foot" value="designated"/>
<key key="bicycle" value="yes"/>
<label text=" "/>
<label text="Optional Attributes:" de.text="Zusatzinformationen:"/>
<label text=" "/>
<text key="name" text="Name" de.text="Name" default="" delete_if_empty="true"/>
<check key="oneway" text="Oneway" de.text="Einbahn" default="off" delete_if_empty="true"/>
<check key="bridge" text="Bridge" de.text="Brücke" default="off" delete_if_empty="true"/>
<check key="tunnel" text="Tunnel" de.text="Unterführung" default="off" delete_if_empty="true"/>
<check key="cutting" text="Cutting" de.text="Einschnitt" default="off" delete_if_empty="true"/>
<check key="embankment" text="Embankment" de.text="Damm/Rampe" default="off" delete_if_empty="true"/>
<Combo key = "layer" text = "layer" de.text = "level" values ​​= "5,4,3,2,1,0, -1, -2, -3, -4, -5" default = "" delete_if_empty = "true" />
<combo key="surface" text="Surface" de.text="Oberfläche" values="paved,unpaved,cobblestone" default="" delete_if_empty="true"/>
<text key="maxspeed" text="Max. speed (km/h)" de.text="max. speed (km/h)" default="" delete_if_empty="true"/>
<text key="width" text="Width (metres)" de.text="Breite (Meter)" default="" delete_if_empty="true"/>
</ Item>
<item name="Fuss-|Radweg (240)" icon="presets/cycleway.png">
<label text="Fuss-|Radweg bearbeiten"/>
<Link href = "http://wiki.openstreetmap.org/wiki/DE:Bicycle/overview_ways"
/>
<label text=" "/>
<key key="highway" value="path"/>
<key key="foot" value="designated"/>
<key key="bicycle" value="designated"/>
<key key="segregated" value="no"/>
<label text=" "/>
<label text="Optional Attributes:" de.text="Zusatzinformationen:"/>
<label text=" "/>
<text key="name" text="Name" de.text="Name" default="" delete_if_empty="true"/>
<check key="oneway" text="Oneway" de.text="Einbahn" default="off" delete_if_empty="true"/>
<check key="bridge" text="Bridge" de.text="Brücke" default="off" delete_if_empty="true"/>
<check key="tunnel" text="Tunnel" de.text="Unterführung" default="off" delete_if_empty="true"/>
<check key="cutting" text="Cutting" de.text="Einschnitt" default="off" delete_if_empty="true"/>
<check key="embankment" text="Embankment" de.text="Damm/Rampe" default="off" delete_if_empty="true"/>
<Combo key = "layer" text = "layer" de.text = "level" values ​​= "5,4,3,2,1,0, -1, -2, -3, -4, -5" default = "" delete_if_empty = "true" />
<combo key="surface" text="Surface" de.text="Oberfläche" values="paved,unpaved,cobblestone" default="" delete_if_empty="true"/>
<text key="maxspeed" text="Max. speed (km/h)" de.text="max. speed (km/h)" default="" delete_if_empty="true"/>
<text key="width" text="Width (metres)" de.text="Breite (Meter)" default="" delete_if_empty="true"/>
</ Item>
<item name="Rad-|Fussweg (241)" icon="presets/cycleway.png">
<label text="Rad-|Fussweg bearbeiten"/>
<Link href = "http://wiki.openstreetmap.org/wiki/DE:Bicycle/overview_ways"
/>
<label text=" "/>
<key key="highway" value="path"/>
<key key="foot" value="designated"/>
<key key="bicycle" value="designated"/>
<key key="segregated" value="yes"/>
<label text=" "/>
<label text="Optional Attributes:" de.text="Zusatzinformationen:" />
<label text=" "/>
<text key="name" text="Name" de.text="Name" default="" delete_if_empty="true"/>
<check key="oneway" text="Oneway" de.text="Einbahn" default="off" delete_if_empty="true"/>
<check key="bridge" text="Bridge" de.text="Brücke" default="off" delete_if_empty="true"/>
<check key="tunnel" text="Tunnel" de.text="Unterführung" default="off" delete_if_empty="true"/>
<check key="cutting" text="Cutting" de.text="Einschnitt" default="off" delete_if_empty="true"/>
<check key="embankment" text="Embankment" de.text="Damm/Rampe" default="off" delete_if_empty="true"/>
<Combo key = "layer" text = "layer" de.text = "level" values ​​= "5,4,3,2,1,0, -1, -2, -3, -4, -5" default = "" delete_if_empty = "true" />
<combo key="surface" text="Surface" de.text="Oberfläche" values="paved,unpaved,cobblestone" default="" delete_if_empty="true"/>
<text key="maxspeed" text="Max. speed (km/h)" de.text="max. speed (km/h)" default="" delete_if_empty="true"/>
<text key="width" text="Width (metres)" de.text="Breite (Meter)" default="" delete_if_empty="true"/>
</ Item>
</ Group>
</ Annotations>

Additional references