#16188 closed enhancement (fixed)
[PATCH] Add support for crossing of residential areas with something.
Reported by: | marxin | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.04 |
Component: | Core validator | Version: | latest |
Keywords: | Klumbumbus | Cc: | Klumbumbus |
Description
The patch makes detection of area more generic and adds support for residential areas.
Attachments (1)
Change History (17)
follow-up: 2 comment:1 by , 7 years ago
Component: | Core → Core validator |
---|---|
Keywords: | Klumbumbus added |
follow-up: 3 comment:2 by , 7 years ago
Replying to Don-vip:
Thanks for the patch!
I see some issues to fix before merging:
- the removal of mapcss rule means there are several use cases no longer detected (for example, two crossing industrial landuses). It should rather skip the residential value.
Can you please help me how to exclude landuse=residential in the mapcss. I'm not much familiar with that.
- the translations using string concatenation (
tr("Crossing " + types[0] + "s")
) won't work. The text to translate is statically extracted from source code. Full strings must be used.
Oh, you are right. I'm sending updated patch, but it doesn't scale much as one needs to explicitly handle all N*(N-1) possible values.
follow-up: 4 comment:3 by , 7 years ago
Cc: | added |
---|
Replying to marxin:
Can you please help me how to exclude landuse=residential in the mapcss. I'm not much familiar with that.
Probably something like that:
#mapcss area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse!=residential]
MapCSS expert in copy :)
follow-up: 5 comment:4 by , 7 years ago
OK, now that you added me in keywords and cc you got my attention ;)
Replying to Don-vip:
Probably something like that:
area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse!=residential]
Yes, simply add [landuse!=residential]
to exclude this tag, but I think you forgot/overwrote the last [landuse]
at the end of the selector:
area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse!=residential][landuse]
follow-up: 6 comment:5 by , 7 years ago
Replying to Klumbumbus:
OK, now that you added me in keywords and cc you got my attention ;)
Haha sorry I often do the mistake.
I think you forgot/overwrote the last
[landuse]
at the end of the selector:
This was intentional. [landuse!=residential]
implies we have a landuse value, different from residential, right?
comment:6 by , 7 years ago
Replying to Don-vip:
[landuse!=residential]
implies we have a landuse value, different from residential, right?
No, e.g. way[landuse!=residential]{}
matches a way tagged only with natural=wood
and an untagged way too
comment:7 by , 7 years ago
So can you please provide a final version of the mapcss change.
I'm bit confused which selector is the right one?
follow-up: 9 comment:8 by , 7 years ago
If I understand the changed Java test right, then the mapcss selector should change to:
area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse!=residential][landuse]
by , 7 years ago
Attachment: | 0001-Add-support-for-crossing-of-residential-areas-with-s.patch added |
---|
V3 of the patch
follow-up: 10 comment:9 by , 7 years ago
Replying to Klumbumbus:
If I understand the changed Java test right, then the mapcss selector should change to:
area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse!=residential][landuse]
Thanks for that. I verified it works for e.g. industrial landuses. Due to that I found one issue in my patch:
p.get("landuse") == "residential"
is different from
p.hasKey("landuse", "residential")
I'm attaching new version of the patch.
comment:10 by , 7 years ago
Replying to marxin:
p.get("landuse") == "residential"is different from
p.hasKey("landuse", "residential")
Yes the good call is:
p.hasTag("landuse", "residential")
p.hasKey("landuse", "residential")
means p
has landuse=*
or residential=*
comment:12 by , 7 years ago
Thanks for the patch! I have modified it a little bit to replace the string by an enum. I didn't test it much so I hope I didn't break anything.
comment:14 by , 7 years ago
Milestone: | → 18.04 |
---|
comment:15 by , 7 years ago
With #16264 I agree: we shouldn't raise a warning when a waterway crosses a residential area. This is quite common.
Thanks for the patch!
I see some issues to fix before merging:
tr("Crossing " + types[0] + "s")
) won't work. The text to translate is statically extracted from source code. Full strings must be used.