-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mapcss [functionresult() <= functionresult()]
gives bad results with numbers
#1882
Comments
It seems that the following mapcss passes all tests in JOSM: node[a][b][tag("a") > tag("b")] {
throwError: tr("{0}-{1}", "{0.tag}", "{1.tag}");
assertNoMatch: "node a=3 b=6";
assertNoMatch: "node a=X b=Y";
assertNoMatch: "node a=3a b=6a";
assertNoMatch: "node a=3a b=6";
assertNoMatch: "node a=3 b=6a";
assertMatch: "node b=3 a=6";
assertMatch: "node b=3 a=12"; /* Fails in Osmose */
assertNoMatch: "node b=X a=Y"; /* Fails in Osmose */
assertNoMatch: "node b=3a a=6a"; /* Fails in Osmose */
assertNoMatch: "node b=3a a=6"; /* Fails in Osmose */
assertNoMatch: "node b=3 a=6a"; /* Fails in Osmose */
}
node[a > 2] {
throwError: tr("{0}", "{0.tag}");
assertMatch: "node a=3";
assertNoMatch: "node a=X";
assertNoMatch: "node a=1";
} Which seems to imply that the way to interpret (Technically it's also what the wiki says: "Comparison for numeric values.") This is already implemented as such for selectors like |
Ok. It should not be hard to change that. |
Agree, it's on my planning for tonight :) |
See osm-fr#1882 : always use numerical comparison for `<` / `>` / `<=` / `>=`
See #1882 : always use numerical comparison for `<` / `>` / `<=` / `>=`
way 680531945 has the following tags
Having the following mapcss selector from combinations.mapcss in JOSM (where you can temporarily replace
area
byway
until that PR has been merged)JOSM will not warn.
Osmose will show the following message:
So apparently JOSM does a numeric comparison (11 > 9), while Osmose does a string ("11" < "9") comparison for
[tag("building:levels") <= tag("building:min_level")]
Similar for way 680531956 with
height = 104
andmin_height = 96
.Maybe we'll have to do some checks with
"value".isdecimal()
or similar in the redefinition of<=
(etcetera) in mapcss_lib.py.The text was updated successfully, but these errors were encountered: