[josm-dev] composing display name for relations from operator ref name from via to
Jiri Klement
jiri.klement at gmail.com
Fri Oct 21 07:39:31 BST 2011
Hi,
Extending name template to work with parent relations or members or
any other related primitives shouldn't be too difficult, general idea
is to add new construct that will have search expression to select
from which primitive should be tags taken and inner name template.
Query that gets name tag of parent relation with type=route can look like this:
!{parent this type=route '{name}'}
parent this type=route - normal search expression, only difference is
new keyword - this - that return primitive for which the name is
constructed
'{name}' - use value of name tag.
Of course, inner template is generic, it would be possible to do
something like this: (show ref of parent relation if available)
!{parent this type=route '{name}?{ ' ({ref}) ' | '' }'}
--
Jiri
On Fri, Oct 21, 2011 at 1:57 AM, Paul Hartmann <phaaurlt at googlemail.com> wrote:
> On 10/21/2011 12:00 AM, Jo wrote:
>> Hi Paul,
>>
>> He created a wiki page:
>>
>> http://josm.openstreetmap.de/wiki/NameTemplate
>>
>> Which I took the liberty to correct and beef up a little. I have no
>> idea if the order of items is still logically built up though, but it
>> should clarify the usage of the feature at least. He has been very
>> helpful to get me going, but he didn't change the wiki page any more.
>> I hope he's happy with it.
>
> Looks good, your improvements are very welcome!
>
>> Of course, now I asked him to go one step further and whether it's
>> possible to use tags from parent relations in the displayed name. (I
>> guess not, but it would be useful for route relations which are part
>> of network relations). In fact this is what one contributor in Belgium
>> proposes to have as the name of hiking node network routes. ZD 10-12
>> (Zuid-Dijleland from node 10 to node 12) and another user (old timer)
>> opposes this, since his reasoning is that these routes simply don't
>> have names. So the 10-12 has to go into 'note'. This then gives
>> problem in Potlatch, since they simply display the long integer ID, if
>> the route has no name, but that is another discussion altogether :-)
>
> I think inclusion of parent relation tags is too specialized and
> complicated for a general scheme. You could however write a
> (minimalistic) plugin, that handles the formatting.
> The necessary hooks are already implemented (see
> http://josm.openstreetmap.de/ticket/6535)
>
> Paul
>
> _______________________________________________
> josm-dev mailing list
> josm-dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/josm-dev
>
More information about the josm-dev
mailing list