Opened 7 years ago

Last modified 6 years ago

#17058 closed defect

Cannot add assertMatch/assertNoMatch declarations with inside() selector — at Initial Version

Reported by: Don-vip Owned by: Don-vip
Priority: normal Milestone: 18.12
Component: Core validator Version:
Keywords: mapcss Cc: naoliv

Description

From IRC it appears this is not possible to write this:

node[amenity=parking][inside(\"BR\")] {
  throwWarning: "foo";
  assertMatch: "node amenity=parking";
  assertNoMatch: "node amenity=restaurant";
}
[17:28:55] <vorpalblade> For the validator.mapcss, does anyone know how to write an assertMatch for specific countries, e.g. [inside("US")]?
[17:40:46] <@don-vip> vorpalblade take a look to Brazilian rules: https://github.com/OSMBrasil/validador-josm/blob/master/Rules_Brazilian-Specific.validator.mapcss
[17:43:55] <vorpalblade> They don't appear to have any assertMatch/assertNoMatch statements.
[18:00:29] <@don-vip> ah sorry I misunderstood. It's not possible, the "inside" keywork is only applicable to selectors
[18:01:07] <@don-vip> why would you want to use this in the assertMatch clause ? 
[18:09:40] <vorpalblade> I want to specify the location of the assertMatch -- I always get errors on assertMatches inside checks which specify countries. If I remove the inside("COUNTRY"), the errors stop.
[18:10:14] <vorpalblade> Example: *[name="TODO"][inside("US")] { throwError: tr("Name is TODO"); assertMatch: "node name=TODO"; }
[19:41:11] <@don-vip> ah, probably we create primitives at (0,0) for assert rules
[19:41:57] <@don-vip> we should create them at the centroid of the first country specified in an inside clause
[20:20:57] <vorpalblade> OK. Thanks. I thought that might be the case, and if it was, I thought there *might* be a way to specify the lat/lon of the primitive.
[22:36:58] <@don-vip> no I simply didn't think to it

This is because fake primitives created for the assertions are always located at (0,0) instead of the correct country.

Change History (0)

Note: See TracTickets for help on using tickets.