coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
921 stars 375 forks source link

Cant get Brazil city by postal code #108

Closed asholok closed 8 years ago

asholok commented 8 years ago

I use:

zip_objs = PostalCode.objects.filter(code='90620-130', country__name='Brazil')
return City.objects.distance(zip_objs[0].location).order_by('distance')[0].name

Actually this code works for other country, or with code like '95630-000' but '90620-130' also valid code Logradouro/Nome: Bairro/Distrito: Localidade/UF: CEP: Rua Gomes Jardim Santana Porto Alegre/RS 90620-130 http://www.buscacep.correios.com.br/sistemas/buscacep/resultadoBuscaCepEndereco.cfm

Is some way exist to deal this problem? Thx.

coderholic commented 8 years ago

The postal codes are imported from the geonames allCountries.zip file, and that doesn't contain this code:

$ grep "^BR" allCountries.txt | grep 90620-
$

You can also confirm it's missing here: http://www.geonames.org/postalcode-search.html?q=90620-130&country=BR

Here's the information about the geonames postalcode sources http://www.geonames.org/postal-codes-sources.html, and for Brazil they reference http://forum.geonames.org/gforum/posts/list/813.page#4773. You could comment there, or email geonames.