Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18085 closed enhancement (fixed)

[PATCH] Add method to get unique values in mapcss

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: 19.09
Component: Core mappaint Version:
Keywords: mapcss Cc:

Description

Lets say you want to compare ref tags from a way to ref tags in the parent relations.

If the way has ref=A9, int_ref=A9, and the parent relation has ref=A9, then a simple comparison will not work.

Example code:

  relation[type=route][route=road][ref] > way[ref][!regexp_test(concat("^(", join_list("|", uniq_list(split(";", join(";", tag_regex("ref")))), "|;?)+$"), join_list(";", uniq_list(sort_list(parent_tags("ref")))), "i")] {
    throwError: tr("Parent ref not in child ref");
  }

Notes on the sample mapcss code: It does not check to make certain that all parent refs are relevant to standard ref tagging schemes on ways (e.g., if the way is part of a tram route with a ref, it will trigger, even though most of the time tram route refs are not on the highway).

Attachments (1)

18085.patch (2.1 KB ) - added by taylor.smock 5 years ago.
New functions uniq and uniq_list along with a simple test to make certain they work.

Download all attachments as: .zip

Change History (5)

by taylor.smock, 5 years ago

Attachment: 18085.patch added

New functions uniq and uniq_list along with a simple test to make certain they work.

comment:1 by Don-vip, 5 years ago

Milestone: 19.09

comment:2 by Don-vip, 5 years ago

Resolution: fixed
Status: newclosed

In 15323/josm:

fix #18085 - Add method to get unique values in mapcss (patch by taylor.smock)

comment:3 by Klumbumbus, 5 years ago

in reply to:  3 comment:4 by taylor.smock, 5 years ago

Replying to Klumbumbus:

Please add docu at wiki:Help/Styles/MapCSSImplementation.

I've added it, along with tag_regex.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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