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

update 'flipNumberAndStreetCountries' config #1344

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

missinglink
Copy link
Member

update the country-code array to cover more country codes where the label format is "{{street}} {{housenumber}}".
sourced from the ID Editor config: https://github.com/openstreetmap/iD/blob/master/data/address-formats.json

resolves #1343

…des where the label format is "{{street}} {{housenumber}}"
Copy link
Member

@Joxit Joxit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@missinglink
Copy link
Member Author

Yea I looked at that, it was the last one in the config, but my very unscientific approach was to google '{country} national library' and look at the address format returned.

For China I got 33 Zhongguancun S St, Zi Zhu Qiao, Haidian Qu, China, but maybe this is either incorrect or an odd case?

@missinglink missinglink requested review from Joxit and removed request for orangejulius September 3, 2019 09:46
@Joxit
Copy link
Member

Joxit commented Sep 3, 2019

Oh, you are right, it seems that when you write an address in Chinese, the housenumber is after the street, but when it's translated in English the housenumber is before the street.

For example the address of the French Embassy in China is:

法国驻华使馆
北京市朝阳区天泽路60号 100600

With the Chinese order:
法国驻华使馆: French Embassy in China
北京市: Beijing
朝阳区: Chaoyang District
天泽路: Tianze Road
60号: N°60
100600: postalcode ?

But we write in English: 60 Tianze Rd, San Yuan Qiao, Chaoyang Qu, Chine, 100600

This works almost like Japanese addresses 🤔

@missinglink
Copy link
Member Author

Oh yea that's super weird 😄
So I think its safest to merge this as-is since we don't have the 'smarts' to handle JPN and CHN properly?

@Joxit
Copy link
Member

Joxit commented Sep 3, 2019

I took the address from the embassy website in Chinese and French.

@missinglink
Copy link
Member Author

There is this cool lib https://github.com/wooorm/franc which I've been considering using for some time.

I just wanted to do this PR quickly to solve the linked issue but if anyone has time to do those countries properly using franc then we could improve how we handle them.

Copy link
Member

@Joxit Joxit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, LGTM 😄

@missinglink missinglink merged commit 6eae878 into master Sep 3, 2019
@missinglink missinglink deleted the flip_housenumber_street branch September 3, 2019 10:07
@orangejulius
Copy link
Member

Nice. It's good to have (hopefully) handled this completely rather than waiting for indivdiual PRs to come in.

orangejulius added a commit to pelias/acceptance-tests that referenced this pull request Sep 5, 2019
Thanks to pelias/api#1344 we hopefully now have
a definitive list of countries where the housenumber comes after the
street name.

This commit updates our acceptance tests accordingly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flip street name and number for Hungarian addresses
3 participants