Mechanical edit proposal to correct addr:country=* to be ISO 3166-1 alpha-2

The wiki-page for addr:country=* is quite short but still clear. The value of addr:country=* should be the country-code according to ISO 3166-1 alpha-2. That means “DE” for Germany, “US” for the United States of America, “FR” for France and so on. These codes are always two-letters long and always uppder case.
Currently there are 2634 objects that have a addr:country with a different value:


Often the situation is still clear. There are for example 401x addr:country=Uganda instead of addr:country=UG in Uganda and 115x addr:country=USA instead of addr:country=US in the USA.

I started a MapRoulette-Challenge to clean this up:

To make the clean up more efficient I propose to change the value of addr:country=* in mass edits when:

  1. It is absolutely clear what the value of addr:country=* means. That is the case when it contains the full name of the country in any language or a different but still clear abbroviation.

and

  1. The meaning of the addr:country=*-value is plausible. That is the case when the obviouse meaning of the value in addr:country matches the location of the object.

I will group the edits by location. The mass-edits will not be started automatically. I propose to repeat the mass-edits when ever I see similar errors reappearing.

Examples for possible edits:

  1. All object with addr:country=Deutschland, addr:country=Germany, addr:country=DEU, addr:country=D, addr:country=Allemagne, … within the borders of Germany will be changed to addr:country=DE.
  2. All objects with addr:country=USA within the borders of the USA will be changed to addr:country=US.
  3. All objects with addr:country=中國 (Chinese name of China) within the borders of China will be cahnged to addr:country:CN)

As I am proposing to repeat the mass edit as needed I can not make a finite list of edits I will do. The list above contains theoretical examples. Some of these values are currently not included in OSM.

Examples for objects that won’t be automatically edited:

  1. An object with addr:country=France within the borders of Spain will not be changed automatically.
  2. An object with addr:country=restaurant will not be changed automatically.

For such objects manual review is requiered.

I am unsure on how to handle objects like these. addr:country=France on an object in Guadeloupe, an overseas department of France. Should that be changed to addr:country=FR (for France) or addr:country=GP (for Guadeloupe)?

What do you think about such mass-edits?

7 Likes

I just want to note that addr:country is typically not needed and redundant.

5 Likes

I know. Typically I do not add this tag because of that. Only in very rare cases like a building directly at the border between two countrys addr:country=* is not redundant. From that point of view we should possibly remove addr:country=* from most objects.

There was this discussion about the redundancy of addr:country=* here. addr:country=* got described as “redundent but harmless” or even “redundant but useful”.

If you feel the need to do something about this redundancy feel free to discuss that in a seperate thread. I just think that if we include addr:country=* in OSM we should use it in a unified way as described in the wiki.

3 Likes

I’ve done a few partial cleanups of addr:country before. I’m all in favour of a more thorough cleanup.

2 Likes

I documented the proposed edit on my wiki page:

https://wiki.openstreetmap.org/wiki/Automated_edits/Os-emmer#Mechanical_edit_to_correct_addr:country=*_to_be_ISO_3166-1_alpha-2

3 Likes

I fully support this. I have also done an addr:country=USAaddr:country=US cleanup before (linky), but clearly this is an ongoing problem and an automated solution is appropriate.

1 Like

As of now I wasn’t able to spot any opposing voices. I will wait a few more days before starting to mass-edit to give anyone the opportunity to argue against the mass-edit.

1 Like

As there was noone opposing I executed the first few changesets. Some of them are so small that they can barely be called “mass-edits”. As disussed I will repead such edits as I see the need for them.

These are the changesets:

I also updated the documentation in the wiki:
https://wiki.openstreetmap.org/wiki/Automated_edits/Os-emmer#Mechanical_edit_to_correct_addr:country=*_to_be_ISO_3166-1_alpha-2

2 Likes

8 days ago there where over 2600 objects where addr:country=* was not an upper-case 2-letter-code. After the mass-edits and some manual cleanup we are now down to currently 21 objects that I can currently not solve:

2 Likes