#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)
Change History (5)
by , 6 years ago
| Attachment: | 18085.patch added |
|---|
comment:1 by , 6 years ago
| Milestone: | → 19.09 |
|---|
comment:4 by , 6 years ago
Replying to Klumbumbus:
Please add docu at wiki:Help/Styles/MapCSSImplementation.
I've added it, along with tag_regex.



New functions
uniqanduniq_listalong with a simple test to make certain they work.