Skip to content

Navigation Menu

Sign in
Sign up

Postal Codes #31

jottinger started this conversation in General
Discussion options

Been wondering how postal codes would work - the problem is the formats for postal codes are so different, plus there are some regions that are too sparse to HAVE postal codes.

You must be logged in to vote

Replies: 1 comment

Comment options

Having a look here - https://en.wikipedia.org/wiki/List_of_postal_codes

It looks like a majority of countries opt for numeric post/zipcodes. The problem then is what postcode is it?

There would need to be some context or guidance.

postcodeService.lookup("90210"); // many results?
postcodeService.lookup("90210", Country.USA); //beverly hills, california

Alternative

Build individual datasets of postcodes for countries and allow users to decide what relevant postcodes they want.

Likelihood of someone needing Afghanisation postcodes vs. likelihood of someone needing postcodes of a developed country?

String USA_POSTCODES = "/location4j-usa-postcodes.bin";
String UK_POSTCODES = "/location4j-uk-postcodes.bin";
SearchLocationService.builder().addData(UK_POSTCODES, USA_POSTCODES).build();
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /