Modify

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks 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 4 weeks 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)

Changed 4 weeks ago by taylor.smock

Attachment: 18085.patch added

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

comment:1 Changed 4 weeks ago by Don-vip

Milestone: 19.09

comment:2 Changed 4 weeks ago by Don-vip

Resolution: fixed
Status: newclosed

In 15323/josm:

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

comment:3 Changed 4 weeks ago by Klumbumbus

comment:4 in reply to:  3 Changed 4 weeks ago by taylor.smock

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.