Know region of the city from the zip code

Asked

Viewed 4,277 times

0

I wonder if anyone has solved a similar problem: in my system has a form and a zip code field, when the user type the zip code wanted to know the region of it is north, west, east and etc.... I saw that in the post office does not report anything related to the region, someone can give me a light?

Example: the user will type the zip code : 01505-010 and the system will tell which region of the city is this zip code

1 answer

0


Create a table with the information:

Rondônia  RO  NORTE
Acre  AC  NORTE
Amazonas  AM  NORTE
Roraima   RR  NORTE
Pará  PA  NORTE
Amapá AP  NORTE
Tocantins TO  NORTE
Maranhão  MA  NORDESTE
Piauí PI  NORDESTE
Ceará CE  NORDESTE
Rio Grande do Norte   RN  NORDESTE
Paraíba   PB  NORDESTE
Pernambuco    PE  NORDESTE
Alagoas   AL  NORDESTE
Sergipe   SE  NORDESTE
Bahia BA  NORDESTE
Minas Gerais  MG  SUDESTE
Espírito Santo    ES  SUDESTE
Rio de Janeiro    RJ  SUDESTE
São Paulo SP  SUDESTE
Paraná    PR  SUL
Santa Catarina    SC  SUL
Rio Grande do Sul RS  SUL
Mato Grosso do Sul    MS  CENTRO OESTE
Mato Grosso   MT  CENTRO OESTE
Goiás GO  CENTRO OESTE
Distrito Federal  DF  CENTRO OESTE

Ai when you know the state search in this table the region. This can be within a json and javascript performs the region search by state, or within the database.

Below the structure of the post office zip database. These would be the possible data to be extracted through the CEP.

inserir a descrição da imagem aqui

  • Sorry if I didn’t detail it correctly, but it’s the city area

  • I changed the answer. I believe that this is not possible by the postcode base.

  • If it helped you, mark as the answer to the question. Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.