Questions tagged [postal-code]

A postal code is a series of letters and/or digits which is useful to identify the a particular region within a postal address. Once postal codes were introduced, other applications became possible.

A postal code is a series of letters and/or digits which is useful to identify the a particular region within a postal address. Once postal codes were introduced, other applications became possible.

In February 2005, 117 of the 190 member countries of the Universal Postal Union had postal code systems. Countries that do not have national systems include Ireland and Panama. Although Hong Kong and Macau are now Special Administrative Regions of China, each maintains its own long-established postal system, which does not utilize postal codes for domestic mail, and no postal codes are assigned to Hong Kong and Macau. Mail between Hong Kong, Macau and mainland China is treated as international.

399 questions
11
votes
4 answers

ZIP / Postal Code + Country to Geo Coordinates

What is the most complete, precise and reliable way to get the coordinates (latitude / longitude) of a given ZIP / Postal Code of a given country? I need to make a lot of requests, so a high API limit rate (maybe even absent) would be…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
9
votes
4 answers

Calculate (road travel) distance between postcodes/zipcodes python

I have a csv file with start and end postcodes (UK equivalent of US zipcodes) and would like to compute simple distance, road travel distance and travel time between the two. I guess the way to go would be to use Google maps in one way or another. I…
famargar
  • 3,258
  • 6
  • 28
  • 44
8
votes
4 answers

Retrieving a fully qualified street address from ZIP / postal code

I have a form in which my users need to enter the following location data: Full address line (street address, apartment, suite, unit, building, floor) House number City State / province / region ZIP / Postal code Country To simplify the completion…
Tom
  • 8,536
  • 31
  • 133
  • 232
8
votes
1 answer

UK Postcode Regex

I'm looking to be able to validate UK Postcodes, and ideally, I would like the following cases to pass: W1 W12 WC1 WC1A WC12 W1 6BT W12 6BT WC1 6BT WC1A 6BT WC12 6BT W16BT W126BT WC16BT WC1A6BT WC126BT I have the following regex patterns: ^(GIR…
JustinMoser
  • 545
  • 2
  • 6
  • 25
7
votes
2 answers

Integrating address verification based on pincode and vice versa for Indian Pincode

We are trying to build address validator and was wondering if storing the data can become obsolete or will be a maintenance task. Adding a API would rather be long lasting. There are not many resources which are kept updated I have checked below…
Mahesh_Loya
  • 2,743
  • 3
  • 16
  • 28
7
votes
1 answer

php fzaninotto Faker - How to Generate Only 5 Digit Zip Code?

Is there a way to generate a 5 digit zip code/postcode using fzaninotto's Faker? His provided function to do so, $faker->postcode, does not offer parameters to limit its size, so it often gives a 9-digit postcode instead of 5, e.g., 10278-4159…
Koolstr
  • 464
  • 1
  • 10
  • 20
7
votes
1 answer

Dynamic Postcode Validation

I need to validate postcode in a specific format that was given to me, per country basis. For example: $postcode_validation = array ( 'Australia' => array('NNNN'), 'Bahrain' => array('NNN', 'NNNN'), 'Netherlands' =>…
Latheesan
  • 23,247
  • 32
  • 107
  • 201
7
votes
4 answers

Find all localities/regions of a city

I have tried to find a lot over the Internet but I am unable to get a perfect utility/API for my requirement. I am looking for a utility that, given a city name, provides all the localities/regions of that city. (Would be great if alongwith the…
ayan_2587
  • 833
  • 2
  • 11
  • 21
6
votes
3 answers

Python, Regular Expression Postcode search

I am trying to use regular expressions to find a UK postcode within a string. I have got the regular expression working inside RegexBuddy, see below: \b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\b I have a bunch of addresses and want to grab…
RailsSon
  • 19,897
  • 31
  • 82
  • 105
6
votes
3 answers

Javascript UK Postcode Validation

Possible Duplicate: UK Postcode Regex (Comprehensive) I have the following code for validating postcodes in javascript: function valid_postcode(postcode) { postcode = postcode.replace(/\s/g, ""); var regex = /[A-Z]{1,2}[0-9]{1,2}…
dai.hop
  • 741
  • 3
  • 11
  • 14
5
votes
6 answers

Regular Expression for England only Postcode

I have an Asp.Net website and I want to use a RegularExpressionValidator to check if a UK postcode is English (i.e. it's not Scottish, Welsh or N.Irish). It should be possible to see if the postcode is English by using just the letters from the…
Robbie
  • 18,750
  • 4
  • 41
  • 45
5
votes
5 answers

PHP - Postcode check if it's covered

I am currently developing a website for an electrical company. They would like some sort of postcode check on there. It would somehow work like this: User enters postcode See if we cover it display results. But I have never worked with postcodes…
ryryan
  • 3,890
  • 13
  • 43
  • 72
5
votes
1 answer

Postal Code model field shows up as State list in Admin

Not sure, but I think this may be a bug? Here is my model: class Property(models.Model): Name = models.CharField(max_length=40) Description = models.TextField(default="Description Not Available") Address = models.CharField(max_length=60,…
Kerry Hatcher
  • 601
  • 6
  • 17
5
votes
2 answers

r Regular expression for extracting UK postcode from an address is not ordered

I'm trying to extract UK postcodes from address strings in R, using the regular expression provided by the UK government here. Here is my function: address_to_postcode <- function(addresses) { # 1. Convert addresses to upper case addresses =…
Amy M
  • 967
  • 1
  • 9
  • 19
5
votes
4 answers

Blank space in UK postal code

Is there a way to know where the blank space has to be, in an UK postal code, if the user doesn't write the postal code with the blank space? For example, if the input is: EC1A1BB, W1A0AX, M11AE, B338TH, CR26XH, DN551PT then the output must be:…
iusmar
  • 339
  • 1
  • 6
  • 15
1
2
3
26 27