Opened 9 years ago
Last modified 3 years ago
#12716 new defect
<preset_link>: prefer target in current source, then search in defaultpresets, then search in other external presets
Reported by: | Klumbumbus | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | template_report tagging preset link | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- add Presets/NewTags
- modify the internal preset by adding the following line to e.g. the church preset:
<preset_link preset_name="Building" />
- add the modified preset below the NewTags preset in the preset list in the preferences
- restart josm
- open the church preset
What is the expected result?
the internal building preset is linked
What happens instead?
the building preset from the external NewTags preset is linked
Please provide any additional information below. Attach a screenshot if possible.
As different preset files maybe use the same preset item names this can lead to unwanted behavior depending on the users order of his presets. (There is also no way to reorder your presets like you can do with mappaint styles.)
<preset_link preset_name="..." />
should only match preset items from "its own" preset file and not from other preset files.
I'm currently working on improving the internal preset by linking the building preset in some amenity presets. However this bug blocks it.
URL:http://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2016-03-31 23:51:13 +0200 (Thu, 31 Mar 2016) Build-Date:2016-04-01 01:32:11 Revision:10092 Relative:URL: ^/trunk Identification: JOSM/1.5 (10092 de) Windows 7 32-Bit Memory Usage: 247 MB / 742 MB (125 MB allocated, but free) Java version: 1.8.0_77-b03, Oracle Corporation, Java HotSpot(TM) Client VM VM arguments: [-Djava.security.manager, -Djava.security.policy=file:C:\Program Files\Java\jre1.8.0_77\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files\josm-latest-bla.jnlp, -Djnlpx.remove=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=256m,768m, -Djnlpx.splashport=56489, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.vmargs=LURqYXZhLnV0aWwuQXJyYXlzLnVzZUxlZ2FjeU1lcmdlU29ydD10cnVlAA==] Dataset consistency test: No problems found Plugins: - AddrInterpolation (31772) - DirectDownload (31934) - DirectUpload (31949) - HouseNumberTaggingTool (31772) - Mapillary (32040) - OpeningHoursEditor (31772) - Tracer2 (32042) - apache-commons (31895) - apache-http (31895) - buildings_tools (31895) - editgpx (31772) - imagery_offset_db (32046) - log4j (31895) - measurement (31895) - photo_geotagging (31895) - photoadjust (32016) - reverter (32005) - tag2link (31910) - tagging-preset-tester (31895) - terracer (31895) - turnrestrictions (31895) - undelete (31895) - utilsplugin2 (32099) - wikipedia (32114) Tagging presets: - D:\Stefan\OSM\JOSMSVN\data\defaultpresets.xml - D:\Stefan\OSM\TestNew\newpresets.xml - https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1 - https://josm.openstreetmap.de/josmfile?page=Presets/OneClick&zip=1 - https://josm.openstreetmap.de/josmfile?page=Presets/StolpersteineLight&zip=1 Map paint styles: - D:\Stefan\OSM\JOSMSVN\styles\standard\elemstyles.mapcss - D:\Stefan\OSM\TestNew\newicons.mapcss - D:\Stefan\OSM\eigene styles\SpecificBuildingValues\SpecificBuildingValues.mapcss - D:\Stefan\OSM\eigene styles\Tourenplanung.mapcss - D:\Stefan\OSM\eigene styles\area-symbol.zip - D:\Stefan\OSM\patches\old MPs\dataquality.mapcss - http://www.freietonne.de/ft_icons/josm/FreieTonne_rules_presets_zip.php - http://www.openrailwaymap.org/styles/standard.mapcss - https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/DestinationSignRelation&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/HiDPISupport&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lit&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/MaxspeedIcons&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/NewHighwayColors&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/ShowID&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface&style&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Traffic_signs&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/sac_scale&zip=1 - https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.mapcss Validator rules: - D:\Stefan\OSM\TestNew\new.validator.mapcss - https://raw.githubusercontent.com/stefan-a-bauer/josm-validators/master/mtb.validator.mapcss
Attachments (0)
Change History (10)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:4 by , 5 years ago
Keywords: | tagging preset link added |
---|
So at least the order to search for could be changed:
The best order would be:
- the preset
- defaultpresets
- other external presets
To completely fix this problem, some way to differ between items with same name
is needed, like the *_context
attributes for translation. A new source_name
attribute for item
or source
for preset_link
.
comment:6 by , 5 years ago
Summary: | don't link preset items from other preset files → <preset_link>: prefer target in current source, then search in defaultpresets, then search in other external presets |
---|
comment:7 by , 5 years ago
comment:8 by , 4 years ago
There is another problem: even group names are catched which creates dead links in the preset window.
Worked around one more: https://josm.openstreetmap.de/wiki/Presets/Historical_Objects?action=diff&version=214
follow-up: 10 comment:9 by , 3 years ago
This is an issue that is long overdue to be addressed, I just ran in to it again today and it makes preset_link far less useful than it could be.
Internally in Vespucci we reference preset items (for example in the most recently used preset item list) via an object that models the path to the item from the root of the relevant preset, the only thing really missing here is agreement on a textual representation of the path for use in preset_link elements. This for example could be a URI based format using an appropriate scheme (josm-preset ?), this potentially could also allow for cross preset references by optionally using an "authority" like field to reference the preset name (which would also solve the issue of search order mentioned above). The only real downside is that group/item names using reserved characters would have to be encoded, but that is likely only a small number.
A backwards compatible way of adding this would be to support an uri attribute on the preset_link element.
URI proposal:
josm-preset:[//<preset name>][/]<path>
making the root / optional allows for relative references to items.
comment:10 by , 3 years ago
Replying to SimonPoole:
A backwards compatible way of adding this would be to support an uri attribute on the preset_link element.
URI proposal:
josm-preset:[//<preset name>][/]<path>making the root / optional allows for relative references to items.
I've just been looking at adding parent
to present_link
for the Name Suggestion Index (see #15217), since it would make it fairly easy to link an NSI preset to a JOSM preset, and then using that for autocomplete.
An example of your URI proposal would be something like this:
<item name="Road Restrictions" icon="presets/vehicle/restriction/maxspeed.svg" type="node,way,closedway,multipolygon" preset_name_label="true" > <text key="maxspeed" text="Max. speed (km/h)" /> <preset_link preset_name="josm-preset://defaultpresets/Access Restrictions" /> </item>
In 10111/josm: