Changeset 13788 in josm


Ignore:
Timestamp:
2018-05-19T17:45:18+02:00 (7 years ago)
Author:
Klumbumbus
Message:

fix #15877 - autofix roof:color and building:color to roof:colour and building:colour (as long as not both keay with different values are present)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/deprecated.mapcss

    r13786 r13788  
    557557}
    558558
    559 /* see #10329 */
     559/* see #10329, #15877 */
     560  /* simple key change */
    560561*[color][!colour] {
    561562  throwWarning: tr("{0} is deprecated", "{0.key}");
     
    563564  group: tr("deprecated tagging");
    564565  fixChangeKey: "color => colour";
    565 }
    566 *[color][colour][tag(color)=tag(colour)] {
    567   throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
     566  assertMatch: "way color=red";
     567  assertNoMatch: "way color=red colour=red";
     568}
     569area[building:color][!building:colour] {
     570  throwWarning: tr("{0} is deprecated", "{0.key}");
     571  suggestAlternative: "building:colour";
     572  group: tr("deprecated tagging");
     573  fixChangeKey: "building:color => building:colour";
     574  assertMatch: "way building:color=red";
     575  assertNoMatch: "way building:color=red building:colour=red";
     576}
     577area[roof:color][!roof:colour] {
     578  throwWarning: tr("{0} is deprecated", "{0.key}");
     579  suggestAlternative: "roof:colour";
     580  group: tr("deprecated tagging");
     581  fixChangeKey: "roof:color => roof:colour";
     582  assertMatch: "way roof:color=red";
     583  assertNoMatch: "way roof:color=red roof:colour=red";
     584}
     585  /* both tags with same value, remove color */
     586*[color][colour][color=*colour] {
     587  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
     588  suggestAlternative: "colour";
    568589  group: tr("deprecated tagging");
    569590  set samecolor;
     
    572593  assertNoMatch: "way color=red colour=green";
    573594}
     595area[building:color][building:colour]["building:color"=*"building:colour"] {
     596  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
     597  suggestAlternative: "building:colour";
     598  group: tr("deprecated tagging");
     599  set samebuildingcolor;
     600  fixRemove: "building:color";
     601  assertMatch: "way building:color=red building:colour=red";
     602  assertNoMatch: "way building:color=red building:colour=green";
     603}
     604area[roof:color][roof:colour]["roof:color"=*"roof:colour"] {
     605  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
     606  suggestAlternative: "roof:colour";
     607  group: tr("deprecated tagging");
     608  set sameroofcolor;
     609  fixRemove: "roof:color";
     610  assertMatch: "way roof:color=red roof:colour=red";
     611  assertNoMatch: "way roof:color=red roof:colour=green";
     612}
     613  /* both tags with different values, no autofix */
    574614*[color][colour]!.samecolor {
    575   throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
     615  throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
     616  suggestAlternative: "colour";
    576617  group: tr("deprecated tagging");
    577618  assertNoMatch: "way color=red colour=red";
    578619  assertMatch: "way color=red colour=green";
    579620}
    580 *[/:color/]{
     621*[building:color][building:colour]!.samebuildingcolor {
     622  throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
     623  suggestAlternative: "building:colour";
     624  group: tr("deprecated tagging");
     625  assertNoMatch: "way building:color=red building:colour=red";
     626  assertMatch: "way building:color=red building:colour=green";
     627}
     628*[roof:color][roof:colour]!.sameroofcolor {
     629  throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
     630  suggestAlternative: "roof:colour";
     631  group: tr("deprecated tagging");
     632  assertNoMatch: "way roof:color=red roof:colour=red";
     633  assertMatch: "way roof:color=red roof:colour=green";
     634}
     635  /* further more universal checks, no autofix */
     636*[/:color/][!building:color][!roof:color] {
    581637  throwWarning: tr("{0} is deprecated", "{0.key}");
    582638  suggestAlternative: ":colour";
    583639  group: tr("deprecated tagging");
    584640  assertNoMatch: "way color=red";
    585   assertMatch: "way roof:color=grey";
    586 }
    587 *[/color:/] {
     641  assertNoMatch: "way roof:color=grey";
     642  assertMatch: "way cycleway:surface:color=grey";
     643}
     644*[/color:/]  {
    588645  throwWarning: tr("{0} is deprecated", "{0.key}");
    589646  suggestAlternative: "colour:";
    590647  group: tr("deprecated tagging");
     648  assertNoMatch: "way color=red";
     649  assertMatch: "way color:back=grey";
    591650}
    592651
Note: See TracChangeset for help on using the changeset viewer.