TransforMap / transformap-viewer

https://viewer.transformap.co/
Do What The F*ck You Want To Public License
10 stars 16 forks source link

Country-Specific Address display #15

Open species opened 8 years ago

species commented 8 years ago

In some countries, an address is written in the form

in others

This should be switchted dependent on the country the POI is in. Is there somewhere a list of the different address formats worldwide?

matt-wallis commented 8 years ago

Is this what you're looking for? https://en.wikipedia.org/wiki/Address_(geography)#Mailing_address_format_by_country It specifies address formats for 62 countries, so clearly it is not exhaustive. Maybe there's a sensible default for countries not mentioned here?

josefkreitmayer commented 8 years ago

Thx @matt-wallis we went throug it, and found quite some specifics for the countries we were working with up to now:

species commented 8 years ago

Does anyone know of a machine-readable version of this list? We're using OpenStreetMap's addr:* scheme, as it allows more flexibility than e.g. schema.org's PostalAddress.

This could be a good starting point for a new library to transform addresses into a country-specific format for display. @tyrasd would it make sense to start a small library on this, or is there already one?

tyrasd commented 8 years ago

Does anyone know of a machine-readable version of this list?

iD has country specific address field ordering (intended for user input, but requirements for output should be quite symetrical, I'd think): https://github.com/openstreetmap/iD/blob/master/data/address-formats.json

Italy: also has region in the address

@josefkreitmayer: You mean the abbreviated province (e.g. BZ), not the region. Also, it's not as common anymore nowadays.

josefkreitmayer commented 8 years ago

@josefkreitmayer: You mean the abbreviated province (e.g. BZ), not the region. Also, it's not as common anymore nowadays.

Apparently it is a must "[postal code + city + province code]". I verified the information here:

It is not mandatory for big cities.