osmose-backend
osmose-backend copied to clipboard
The tag area=yes is unnecessary is flagged twice for 1 'error' (since longer)
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 |
Not sure what your asking for. What is wrong for you and how it should be ?
Note, 9010xxx are from JOSM validator.
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.
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.
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.
@frodrigo
I think there are two issues mixing here:
-
JOSM's mapcss rule and Osmose's plugin rule will produce a duplicate warning for
area=yes
together with one ofbuilding|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. -
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],
Example where no [!highway]
exists in the rule. From rule: way:closed[natural ][area?],
@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.
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
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)
How did you come to this list: boundary, indoor, office, place?
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)
https://josm.openstreetmap.de/ticket/22338
Added to JOSM in https://josm.openstreetmap.de/changeset/18547/josm
Great, thanks Klumbumbus!
So three more things to do:
- Fix #1535 (or temporary accept bad texts)
- Update JOSM rules in Osmose
- Remove the Osmose test
I've got a patch for the latter prepared