Changes between Version 59 and Version 60 of DevelopersGuide/DefaultPresets


Ignore:
Timestamp:
2020-07-23T12:01:32+02:00 (6 years ago)
Author:
skyper
Comment:

https; interwiki; better readable syntax

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/DefaultPresets

    v59 v60  
    33= Defaultpresets Guidelines
    44
    5 This page contains rough guidelines for the [source:trunk/resources/data/defaultpresets.xml defaultpresets] and new icons.
     5This page contains rough guidelines for the [source:/trunk/resources/data/defaultpresets.xml defaultpresets] and new icons.
    66
    77== New Tags and Values ==
     
    1414* world wide usage
    1515* Controversial cases (like `contact:phone=*` vs. `phone=*`) need to be decided case by case.
    16 * If a features is only mapped by a handful of specialists, it is better suited for an [wiki:Presets#PublishanewAvailablepresetsitem external preset]. Usually this includes tagging schemes restriced to one specific country, hobby, sport or profession. Instead of creating an own external preset you could also extend [wiki:Presets/NewTags].
     16* If a features is only mapped by a handful of specialists, it is better suited for an [wikitr:/Presets#PublishanewAvailablepresetsitem external preset]. Usually this includes tagging schemes restriced to one specific country, hobby, sport or profession. Instead of creating an own external preset you could also extend [wikitr:/Presets/NewTags].
    1717
    1818**Note**:
    1919* The goal of the internal preset is to support the tags and tagging schemas which are widly accepted and used by the community. It is ''not'' the goal to invent new tags or tagging schemas.
    20 * When investigating [https://taginfo.openstreetmap.org taginfo], also check **where** unusual values are used.
     20* When investigating [taginfo: taginfo], also check **where** unusual values are used.
    2121* You can use overpass API to load these object in JOSM and check in the history who created them.
    2222* See also [osmwiki:DE:Overpass_API/Beispielsammlung#User_f.C3.BCr_bestimmte_Tag-Kombination_ausgeben this example] to search for the last editor of an specific tag.
    23 * A useful tool to check tags is also [http://taghistory.raifer.tech/ taghistory]. If a tag is mapped e.g. 50 times per year global, then we usually don't need a preset for this tag. You can still always add tags manually via the [wiki:Help/Dialog/AddValue Add tag dialog].
     23* A useful tool to check tags is also [https://taghistory.raifer.tech/ taghistory]. If a tag is mapped e.g. 50 times per year global, then we usually don't need a preset for this tag. You can still always add tags manually via the [wikitr:/Help/Dialog/AddValue Add tag dialog].
    2424* When modifying the defaultpresets also the [source:josm/trunk/resources/styles/standard/elemstyles.mapcss main mappaint style] and maybe also [source:josm/trunk/resources/data/validator validator rules] should be changed for consistency.
    2525
    2626== New Icons ==
    27 * The file format must be '''svg''' for lossless scaling. (Technically png is supported too but all preset icons are svg since August 2016.)
    28 * The icon must be '''identifiable at a size of 16 pixels'''. This is the default size the icons are displayed in the [[Help/MapView|Map View]] on standard dpi (not hidpi) screens.
    29 * The '''license''' needs to be compatible with GPL3 (like PD or CC0). A good source for Icons is [http://openclipart.org openclipart.org] (all icons there are PD), [https://publicdomainvectors.org/ publicdomainvectors.org] (all icons CC0), [https://freesvg.org/ freesvg.org] (all icons CC0) or [http://osm-icons.org/wiki/Icons osm-icons.org] (a lot are CC0). You can also check if JOSM already has a fitting unused icon in one of its icon folders: [browser:josm/trunk/resources/images used icons] and [browser:josm/trunk/nodist/images unused icons].
     27* The file format must be **svg** for lossless scaling. (Technically png is supported too but all preset icons are svg since August 2016.)
     28* The icon must be **identifiable at a size of 16 pixels**. This is the default size the icons are displayed in the [wikitr:/Help/MapView Map View] on standard dpi (not hidpi) screens.
     29* The **license** needs to be compatible with GPL3 (like PD or CC0). A good source for Icons is [https://openclipart.org openclipart.org] (all icons there are PD), [https://publicdomainvectors.org/ publicdomainvectors.org] (all icons CC0), [https://freesvg.org/ freesvg.org] (all icons CC0) or [http://osm-icons.org/wiki/Icons osm-icons.org] (a lot are CC0). You can also check if JOSM already has a fitting unused icon in one of its icon folders: [browser:josm/trunk/resources/images used icons] and [browser:josm/trunk/nodist/images unused icons].
    3030* If the tag applies to nodes, the icon in the MapView and the icon of the preset should be the same if possible. (It is not possible when different features use the same preset, e.g. crossing=island and crossing=traffic_signals have different icons, but are handled in only one preset "Pedestrian Crossing".)
    31 * Icons with transparent background must '''not be only black or only white'''. Otherwise if one uses a black or white background (no aerial imagery as background) in the Map View black or white icons would be invisible. Workaround: if you want to use a black icon add a square white background to the icon instead of a transparent background or better use a white halo. [[BR]] Examples: [[Image(BlackWhiteIcon.png,middle)]] Colored icons are preferred though.
     31* Icons with transparent background must **not be only black or only white**. Otherwise if one uses a black or white background (no aerial imagery as background) in the Map View black or white icons would be invisible. Workaround: if you want to use a black icon add a square white background to the icon instead of a transparent background or better use a white halo. \\
     32 Examples: [[Image(BlackWhiteIcon.png,middle,link=)]] Colored icons are preferred though.
    3233* The icon should hide as less as possible in the mapview, so colourful icons with transparent background are preferred over black/white icons with square background.
    3334* The icon should be understandable in all countries.
    3435* Each preset should have its own icon and not borrow an existing icon from another preset so that you can know the tag from just seeing the icon in the mapview.
    3536* To test your icon against these requirements within JOSM the mappaint style [wikitr:/Styles/IconTester Icon tester] helps you.
     37
    3638=== Possible problems with svg in JOSM ===
    3739Please check if the svg file correctly works within JOSM.
     
    4042* There are some svg libraries which do not work with JOSM (the images get deformed). If you have such a file try the following workaround: create a new svg document with Inkscape, copy the svg data to this new file, resize the page to the data and save.
    4143* Resize your icon to 16px or an integer multiple size of it (not something like 458.1534) to avoid display inaccuracies due to rounding errors within java.
    42 * Check the code of the file in a text editor. Search for '''viewBox''' value in the beginning of the file. If the icon is, for example, in 16x16 pixels, and if you made it in Inkscape (at least this happens in 0.91 version) and have defined in Document Properties 16,00000 by 16,00000 pixels, probably in the file code you have these values '''viewBox="0 0 16.000002 16.000001"'''. Change it to '''viewBox="0 0 16 16"''' or you will have problems (see #12201 and the fix [o31865])
     44* Check the code of the file in a text editor. Search for **viewBox** value in the beginning of the file. If the icon is, for example, in 16x16 pixels, and if you made it in Inkscape (at least this happens in 0.91 version) and have defined in Document Properties 16,00000 by 16,00000 pixels, probably in the file code you have these values **viewBox="0 0 16.000002 16.000001"**. Change it to **viewBox="0 0 16 16"** or you will have problems (see #12201 and the fix [o31865])
    4345* svg icons are automatically cleaned up to reduce file size in the JOSM build. So there is no need to do this step manually before uploading svg files to svn. See comment:35:ticket:10479, comment:10:ticket:10877 and ticket:12201#comment:21 Uncleaned svgs are better for further editing.
    4446* Due to a bug in svgcleaner however, the svg code shouldn't contain arguments starting with special characters in style codes e.g. `-inkscape-font-specification:Sans;`. This can lead to color changes (see #13158).
    45 * If the icon icludes gradients, the offset needs to increase at every stop, i.e. two stops with the same offset are not allowed, see [https://github.com/blackears/svgSalamander/pull/4 svg salamander].
    46 * Some of the named problems can be detected by executing this [source:josm/trunk/scripts/geticons.pl script].
     47* If the icon includes gradients, the offset needs to increase at every stop, i.e. two stops with the same offset are not allowed, see [https://github.com/blackears/svgSalamander/pull/4 svg salamander].
     48* Some of the named problems can be detected by executing this [source:/josm/trunk/scripts/geticons.pl script].
    4749
    4850== See also ==
     
    5052
    5153----
    52 Back to [wiki:/DevelopersGuide Developers Guide][[BR]]
    53 Back to [wiki:Help Main Help]
     54Back to [wikitr:/DevelopersGuide Developers Guide] \\
     55Back to [wikitr:/Help Main Help]