osmose-backend icon indicating copy to clipboard operation
osmose-backend copied to clipboard

The tag area=yes is unnecessary is flagged twice for 1 'error' (since longer)

Open sekerob opened this issue 2 years ago • 12 comments

When mapping areas of landuse, the removal of the standard area=yes tag is occasionally forgotten as not required. It gets flagged with "landuse`, already make this an area". The same though gets also flagged with "highway={{2.value}} is unnecessary for area", which I think is incorrect.

Below a partial copy of the daily extract list of personal Osmose issues showing both errors refer to the same way link:

2416 3 3200 area 32001 E 14.09 42.33 w1090301726  (j) Tags, landuse, already make this an area. ✘ / ✔
2416 3 3200 area 32001 E 14.09 42.33 w1090301727  (j) Tags, landuse, already make this an area. ✘ / ✔
2416 3 3200 area 32001 E 14.09 42.33 w1090301728  (j) Tags, landuse, already make this an area. ✘ / ✔
2416 3 9010 unnecessary 9010001 E 14.09 42.33 w1090301726  (j) highway={{2.value}} is unnecessary for area ✘ / ✔
2416 3 9010 unnecessary 9010001 E 14.09 42.33 w1090301727  (j) highway={{2.value}} is unnecessary for area ✘ / ✔
2416 3 9010 unnecessary 9010001 E 14.09 42.33 w1090301728  (j) highway={{2.value}} is unnecessary for area
[2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [3200 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=3200)3200 area 32001 [E](https://osmose.openstreetmap.fr/en/issue/14aa81f2-4000-ba36-807c-2b0ef5e26c2c) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=3200&zoom=17&lat=42.3314214&lon=14.0855403&level=3&tags=&fixable=&issue_uuid=14aa81f2-4000-ba36-807c-2b0ef5e26c2c) [w1090301726](https://www.openstreetmap.org/way/1090301726) [ (j)](http://localhost:8111/load_object?objects=w1090301726) Tags, `landuse`, already make this an area. [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [3200 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=3200)3200 area 32001 [E](https://osmose.openstreetmap.fr/en/issue/d1a443ec-2942-0199-242e-9d4824075b42) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=3200&zoom=17&lat=42.3306285&lon=14.0870391&level=3&tags=&fixable=&issue_uuid=d1a443ec-2942-0199-242e-9d4824075b42) [w1090301727](https://www.openstreetmap.org/way/1090301727) [ (j)](http://localhost:8111/load_object?objects=w1090301727) Tags, `landuse`, already make this an area. [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [3200 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=3200)3200 area 32001 [E](https://osmose.openstreetmap.fr/en/issue/2868526c-af3f-3e02-447a-4795e430f4a0) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=3200&zoom=17&lat=42.3319822&lon=14.0871448&level=3&tags=&fixable=&issue_uuid=2868526c-af3f-3e02-447a-4795e430f4a0) [w1090301728](https://www.openstreetmap.org/way/1090301728) [ (j)](http://localhost:8111/load_object?objects=w1090301728) Tags, `landuse`, already make this an area. [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [3260 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=3260)3260 VAT 32601 [E](https://osmose.openstreetmap.fr/en/issue/7311bcaf-bca7-c1d8-de30-cb6b988c5d97) [14.09 42.34](https://osmose.openstreetmap.fr/map/#&item=3260&zoom=17&lat=42.3448432&lon=14.0852232&level=3&tags=&fixable=&issue_uuid=7311bcaf-bca7-c1d8-de30-cb6b988c5d97) [w1090414994](https://www.openstreetmap.org/way/1090414994) [ (j)](http://localhost:8111/load_object?objects=w1090414994) Invalid 'VAT identification number' [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 1 [4030 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=4030)4030 incompatible tags 900 [E](https://osmose.openstreetmap.fr/en/issue/47c3f1b8-cccf-a6da-d019-8362bffa24fb) [14.09 42.34](https://osmose.openstreetmap.fr/map/#&item=4030&zoom=17&lat=42.3448432&lon=14.0852232&level=1&tags=&fixable=&issue_uuid=47c3f1b8-cccf-a6da-d019-8362bffa24fb) [w1090414994](https://www.openstreetmap.org/way/1090414994) [ (j)](http://localhost:8111/load_object?objects=w1090414994) Conflict between tags: amenity, landuse [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [30376](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=30376) 1 [5080 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=5080)5080 similar name 1 [E](https://osmose.openstreetmap.fr/en/issue/e999fc19-3f12-f111-a352-bd52c5676e61) [14.25 42.44](https://osmose.openstreetmap.fr/map/#&item=5080&zoom=17&lat=42.4427321&lon=14.2548466&level=1&tags=&fixable=&issue_uuid=e999fc19-3f12-f111-a352-bd52c5676e61) [w146733624](https://www.openstreetmap.org/way/146733624) [ (j) ](http://localhost:8111/load_object?objects=w146733624)[w986769706](https://www.openstreetmap.org/way/986769706) [ (j)](http://localhost:8111/load_object?objects=w986769706) Via Monte sirente, Via Monte Sirente [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [9002 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=9002)9002 deprecated 9002017 [E](https://osmose.openstreetmap.fr/en/issue/cf2c3da6-1af5-d940-7365-a0ed566e24da) [14.07 42.33](https://osmose.openstreetmap.fr/map/#&item=9002&zoom=17&lat=42.3341058&lon=14.0746696&level=3&tags=&fixable=&issue_uuid=cf2c3da6-1af5-d940-7365-a0ed566e24da) [w379111157](https://www.openstreetmap.org/way/379111157) [ (j)](http://localhost:8111/load_object?objects=w379111157) The key service has an uncommon value. [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [9010 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=9010)9010 unnecessary 9010001 [E](https://osmose.openstreetmap.fr/en/issue/0a7329ce-d79c-7bd7-5449-b6d1de1fb0b2) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=9010&zoom=17&lat=42.3314214&lon=14.0855403&level=3&tags=&fixable=&issue_uuid=0a7329ce-d79c-7bd7-5449-b6d1de1fb0b2) [w1090301726](https://www.openstreetmap.org/way/1090301726) [ (j)](http://localhost:8111/load_object?objects=w1090301726) highway={{2.value}} is unnecessary for area [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [9010 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=9010)9010 unnecessary 9010001 [E](https://osmose.openstreetmap.fr/en/issue/81ae26a3-1c7e-90bb-7985-22297fda5bb9) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=9010&zoom=17&lat=42.3306285&lon=14.0870391&level=3&tags=&fixable=&issue_uuid=81ae26a3-1c7e-90bb-7985-22297fda5bb9) [w1090301727](https://www.openstreetmap.org/way/1090301727) [ (j)](http://localhost:8111/load_object?objects=w1090301727) highway={{2.value}} is unnecessary for area [✘ ](https://osmose.openstreetmap.fr/en/byuser/SekeRob#)/ [✔](https://osmose.openstreetmap.fr/en/byuser/SekeRob#) [2416](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&source=2416) 3 [9010 ](https://osmose.openstreetmap.fr/en/byuser/SekeRob?username=SekeRob&item=9010)9010 unnecessary 9010001 [E](https://osmose.openstreetmap.fr/en/issue/0dae7083-eadf-c899-2b31-2298484d7097) [14.09 42.33](https://osmose.openstreetmap.fr/map/#&item=9010&zoom=17&lat=42.3319822&lon=14.0871448&level=3&tags=&fixable=&issue_uuid=0dae7083-eadf-c899-2b31-2298484d7097) [w1090301728](https://www.openstreetmap.org/way/1090301728) [ (j)](http://localhost:8111/load_object?objects=w1090301728) highway={{2.value}} is unnecessary for area

sekerob avatar Aug 30 '22 13:08 sekerob

Not sure what your asking for. What is wrong for you and how it should be ?

Note, 9010xxx are from JOSM validator.

frodrigo avatar Aug 30 '22 13:08 frodrigo

When removing the area=yes tag for the landuse flagged issue, there's then also still the pin for the highway flag. When selecting that pin it shows still with the area=yes tag only to not show when opening the ID editor view. The area=yes tag for landuse was previously removed. No need for having 2 flags for the same issue. Highway flag for a landuse object seems wrong to me. Anyway, they always come in pairs.

sekerob avatar Aug 30 '22 13:08 sekerob

But both are independently interesting check. We cannot remove one, can we ?

There are not provided by the same analyser, so we cannot deals with both at the same time.

frodrigo avatar Aug 30 '22 14:08 frodrigo

Truly don't see why a landuse object has a highway check. Propose highway rule augmentation: If object is landuse, don't check for area.. Might speed up the analyser execution too and certainly reduces irritation with mappers who actually do follow Osmose. Less flags, more map rendering speed less bits to chug across the Wx3.

sekerob avatar Aug 30 '22 14:08 sekerob

@frodrigo

I think there are two issues mixing here:

  1. JOSM's mapcss rule and Osmose's plugin rule will produce a duplicate warning for area=yes together with one of building|landuse|natural|shop. These 4 trigger (as far as I see so far) always for exactly the same conditions in the Osmose test and the JOSM mapcss test, so I think they can be removed from the Osmose test.

  2. The second error is in the parsing of mapcss rules in Osmose, specifically this block:

way:closed[building][area?],
way:closed[landuse ][area?][!highway],
way:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway],
way:closed[natural ][area?],
way:closed[shop    ][area?] {
  throwWarning: tr("{0} is unnecessary for {1}", "{2.tag}", "{1.key}");
  group: tr("unnecessary tag");
  fixRemove: "{2.key}";
}

JOSM counts pseudo class selectors (like :closed) as a tag. Hence, if you have landuse=grass + area=yes, JOSM interprets it as {0.key} = :closed, {1.key}=landuse, {2.key}=area, giving the error area=yes is unnecessary for landuse.

Osmose on the other hand only seems to counts the [...]-selectors while parsing mapcss rules. Therefore, instead of the supposed error message, Osmose counts as {0.key} = landuse, {1.key}=area, {2.key}=highway, thereby producing the bogus messages highway (for the rules with [!highway]; nothing otherwise) is unnecessary for area.

Example mentioning to remove highway while no highway is present (but highway comes from [!highway] being counted as the {2.key}). From rule: way:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway], image

Example where no [!highway] exists in the rule. From rule: way:closed[natural ][area?], image

Famlam avatar Aug 30 '22 17:08 Famlam

@Famlam

Thanks for researching this, indeed buildings is another frequent one, as is natural that pops up quite a few times for me, natural not so much as those I map one by one. I map in batches, just outline the areas of say buildings. Then select all the outlines to get the building=xyz key and ctrl-select a previously tagged completed building. If I then forget to take the area=yes tag, ID Editor certainly does not warn for the redundancy (I've posted a feature request for ID in GitHub). Save, and voilà, a building group has landed in the OSM data with a no-use tag. That then causes presently in the Osmose levels listing the double shows.

MTIA for resolving this geweldig . PS I do not recollect to have seen this for the 'shop' key though, maybe leisure, but rarely, simply because they are mapped few and far between.

sekerob avatar Aug 30 '22 18:08 sekerob

Thank you @Famlam fo all of this details!

JOSM's mapcss rule and Osmose's plugin rule will produce a duplicate warning for area=yes together with one of building|landuse|natural|shop. These 4 trigger (as far as I see so far) always for exactly the same conditions in the Osmose test and the JOSM mapcss test, so I think they can be removed from the Osmose test.

Have some tags in JOSM and some in Osmose, under two diff items, not seam to me to be a good idea. Better improve JOSM et remove it completely from Osmose ?

The second error is in the parsing of mapcss rules in Osmose

Moved to it own issue #1535

frodrigo avatar Aug 31 '22 09:08 frodrigo

I would agree that would be a good solution. @Klumbumbus, would you be interested in adding the following rules to unnecessary.mapcss?

way:closed[boundary][area?],
way:closed[indoor][area?][!highway][indoor!=no],
way:closed[office][area?],
way:closed[place][area?][!highway],

(I didn't include geological and craft as that combination is virtually non-existent)

Famlam avatar Aug 31 '22 12:08 Famlam

How did you come to this list: boundary, indoor, office, place?

Klumbumbus avatar Aug 31 '22 17:08 Klumbumbus

I think all of them were added with the idea that they cannot be not an area by definition. (Technically indoor=wall can, but then that would imply a room without doors). I don't think they were associated with a specific issue (given that it's a redundant tag, rather than a tagging error). Also the number of false positives is extremely low, despite their "old age" in Osmose.

boundary (5142 cases with area=yes) was added in #21 (2014) and has 0 false positives reported to date indoor (12616 cases with area=yes) was added in https://github.com/osm-fr/osmose-backend/commit/357ac37c08715c33b1171fbde6716883f0147a7d (2019) and has 14 false positives reported to date, almost all in combination with highway=pedestrian office (1018 cases with area=yes) was added in #21 (2014) and has 0 false positives reported to date place (30616 cases with area=yes) was added in #21 (2014) and has 16 false positives reported to date, a large amount in combination with highway=pedestrian

(I've updated the comment above to exclude the highway=pedestrian cases)

Famlam avatar Aug 31 '22 18:08 Famlam

https://josm.openstreetmap.de/ticket/22338

Added to JOSM in https://josm.openstreetmap.de/changeset/18547/josm

Klumbumbus avatar Aug 31 '22 18:08 Klumbumbus

Great, thanks Klumbumbus!

So three more things to do:

  1. Fix #1535 (or temporary accept bad texts)
  2. Update JOSM rules in Osmose
  3. Remove the Osmose test

I've got a patch for the latter prepared

Famlam avatar Aug 31 '22 19:08 Famlam