Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support addr:place tag in Address field #9603

Merged
merged 13 commits into from May 26, 2023
Merged

Support addr:place tag in Address field #9603

merged 13 commits into from May 26, 2023

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Apr 28, 2023

This adds support for the addr:place tag in the Address field (closes #2898).

image

A demo instance is available.

This changes the "Street" subfield of the Address field to a combined "Street / Place" input element which is little bit more clever:

  • If an address has no addr:street, but does have an addr:place, it is displayed
  • The dropdown offers not only nearby street names, but also nearby names of places1, which are made distinguishable by an icon
  • When selecting an option from the dropdown, the correct tag is used addr:street for streets, addr:place for places (and in case a different tag was previously present, it is removed automatically)2
  • When manually entering a string into the box, the correct tag will be used if the entered name matches a nearby street or place from the dropdown.
  • When manually entering a string which does not match any nearby street or place names, the addr:street tag is used as a fallback

Not all countries have this "enabled", as in some countries the use of place names in addresses is non-existent in OSM (e.g. Latvia), or use a special "non-standard" addressing scheme which allows for both addr:street and addr:place to be set at the same time (e.g. Czech Republic).

The following countries I'm currently unsure about, and would really appreciate some feedback by the local community how they would like to be handled in iD:

  • Taiwan has currently (iD v2.25.2) both addr:street and addr:place enabled (see Add Taiwan (R.O.C.) address format #3261), but I don't know whether this was just done as a hacky workaround to allow map either addr:street or adr:place (but never both), or if it is actually possible for an address in Taiwan to have both tags set at the same time. I assumed that the latter is the case, as before Add Taiwan (R.O.C.) address format #3261 was merged only 63 out of ~120k addresses had both tags in the country (for comparison: today the proportion is still pretty small, but the absolute number has increased significantly to 2.1k out of 1.5M). It would be nice if someone from the local community could confirm or deny this. //cc @david082321
  • In the US and Canada addr:place seems to be very rarely used, but one pattern I noticed is for addresses on sites which are only accessible by boat (example 1, 2). In this PR I have currently not enabled the addr:place tag for these countries (my reasoning for this was that offering place names in the dropdown list of the "street field" could be confusing if it is such a rare thing to see in an actual address). However, this could be enabled easily. It would be nice to hear from the community what approach would be preferred in the US and Canada.
  • The following countries also currently only the the "old" addr:street-only field, because they seem to not use addr:place in practice (and for these countries I had to make a decision because they already had localized address formats defined in iD): Australia, Finland, Iceland, Liechtenstein, the Netherlands, Norway, Monaco, Latvia, Peru, Bolivia, China, Ukraine, India (highlighted are the countries which I am a bit unsure about, similar to the US and Canada above, and would especially appreciate some feedback about). If further countries should be included in this list, it would be good to know what the local address format should look like (i.e. in which order the different parts of an address should be arranged into a typical list of "address rows").
  • The Czech Republic and Slovakia seem to be quite complicated in their own ways. For now, I disabled the feature in these two countries (i.e. left it untouched to the status quo) because at least in Czechia it is possible that both tags must be used at the same time. To not digress from this PR's main point: Let's discuss how the quite complicated local address schema in these countries can be better represented in iD in a separate issue.

Footnotes

  1. Map features with a place=* tag or boundary=administrative objects with admin_level>8

  2. Note that this implies that if an address had (for whatever reason — most probably a mapping mistake) both addr:street and addr:place, selecting any option from the dropdown would remove the other tag from the type which one has selected (e.g. when selecting a street name, the addr:place would be removed).

using the "old" `addr:street`-only field on some countries which don't appear to use place-based addresses (according to current use in the OSM database):
* Australia
* Finland
* Iceland
* Liechtenstein
* Netherlands
* Norway
* Monaco
* Latvia
* Peru
* Bolivia
* China
* Ukraine
* Taiwan (uses both addr:place and add:street in parallel!)
* India
* Canada
* United States
as in this case it is likely a mapping mistake where the "place" should actually be addr:city (or addr:suburb, etc.)
this assumes that the address format included both fields as a "hacky" workaround of iD's inability to choose between streets and places from a single field. This is (at the momemt) only based on the observation that before the format was introduced in iD in mid-2016, there were only a very small number of addresses in Taiwan with both tags, and the number increased only after iD started to show fields for both tags, and even today only a very small percentage of addresses have both tags set (approx 2.1k out of 1.6M).
@tyrasd tyrasd added the field An issue with a field in the user interface label Apr 28, 2023
@tyrasd tyrasd added this to the 2.26 milestone Apr 28, 2023
@1ec5
Copy link
Collaborator

1ec5 commented Apr 29, 2023

In the US and Canada addr:place seems to be very rarely used, but one pattern I noticed is for addresses on sites which are only accessible by boat (example 1, 2). In this PR I have currently not enabled the addr:place tag for these countries (my reasoning for this was that offering place names in the dropdown list of the "street field" could be confusing if it is such a rare thing to see in an actual address). However, this could be enabled easily. It would be nice to hear from the community what approach would be preferred in the US and Canada.

@blackboxlogic asked about using addr:place before using it in that import, specifically for addresses on islands that lack streets. In my opinion, it’s quite an edge case, and I don’t personally think it’s necessary to facilitate additional usage of that tag in the U.S. Just as addr:city doesn’t necessarily name a city (and doesn’t even necessarily name a place), I don’t think it’s strictly necessary for addr:street to be a street, as long as it’s whatever would go in the “street” slot of the standard address format. After all, many addresses on college campuses have the name of a walkway where a street name would normally be. There wasn’t very much discussion about it at the time, so I’d pose the question again in Slack or the forum before enabling addr:place for the U.S.

The U.S. has some alternative address formats that would probably require a more significant rearchitecture of this field. For example, some rural addresses use rural delivery route numbers, which have no established tagging, while others use P.O. boxes (addr:postbox).

Puerto Rico has a unique series of standard address formats. There’s some scattered usage of addr:place there, but addr:street is overwhelmingly common.

css/80_app.css Outdated Show resolved Hide resolved
modules/ui/fields/address.js Outdated Show resolved Hide resolved
modules/ui/fields/address.js Outdated Show resolved Hide resolved
@tyrasd tyrasd merged commit 0cb8210 into develop May 26, 2023
4 checks passed
@tyrasd tyrasd deleted the addr_place branch May 26, 2023 18:47
tyrasd added a commit to soshial/iD that referenced this pull request May 31, 2023
Andygol added a commit to Andygol/iD that referenced this pull request Aug 9, 2023
tyrasd pushed a commit that referenced this pull request Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
field An issue with a field in the user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support addr:place in the Address preset
2 participants