Modify

Opened 8 years ago

Last modified 2 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 Klumbumbus)

What steps will reproduce the problem?

  1. add Presets/NewTags
  2. modify the internal preset by adding the following line to e.g. the church preset: <preset_link preset_name="Building" />
  3. add the modified preset below the NewTags preset in the preset list in the preferences
  4. restart josm
  5. 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 Klumbumbus, 8 years ago

Description: modified (diff)

comment:2 by Klumbumbus, 8 years ago

In 10111/josm:

see #9203, see #12716 - add a preset link to the "Building" Preset to some amenities/leisures, which often use a whole building

comment:4 by skyper, 4 years ago

Keywords: tagging preset link added

So at least the order to search for could be changed:

The best order would be:

  1. the preset
  2. defaultpresets
  3. 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:5 by skyper, 4 years ago

I added a warning and a link, please, remove if fixed:
TaggingPresets

comment:6 by simon04, 4 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:8 by Klumbumbus, 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

comment:9 by SimonPoole, 2 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.

in reply to:  9 comment:10 by taylor.smock, 2 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>

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Klumbumbus.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.