| Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 12:54:49
|
john_es
Joined: 26/08/2010 12:29:41
Messages: 15
Offline
|
In which download are the Postal Codes?
I'd like to be able to search based on Postal Code and return City, State, Country...
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 13:13:45
|
geotree
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline
|
Just have a look to download page :
http://www.geonames.org/export/
There is a link to Postal Codes download :
http://download.geonames.org/export/zip
|
Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:02:53
|
john_es
Joined: 26/08/2010 12:29:41
Messages: 15
Offline
|
Thanks for the quick reply... I saw that but I wonder if I download the 800MB all countries list, that is a super set of what you pasted in above, right?
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:14:40
|
geotree
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline
|
There is one file per country
and a file allCountries containing ... all countries
|
Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:29:26
|
john_es
Joined: 26/08/2010 12:29:41
Messages: 15
Offline
|
Yep... let me be more specific.... what I was asking is,
is: http://download.geonames.org/export/dump/allCountries.zip
a super set of:
http://download.geonames.org/export/zip/allCountries.zip
or is there data in: http://download.geonames.org/export/zip/allCountries.zip that is not in the other?
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:42:41
|
geotree
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline
|
http://download.geonames.org/export/zip/
contains ONLY postal codes
when
http://download.geonames.org/export/dump/
contains all GeoNames records
For some countries like France, postal codes can also be found in
http://download.geonames.org/export/dump/alternateNames.zip
with language code = 'post'
|
Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:57:19
|
john_es
Joined: 26/08/2010 12:29:41
Messages: 15
Offline
|
OK, that makes sense... and I guess I have just one more question.
If I import the giant geonames database, i I follow the steps at:
http://forum.geonames.org/gforum/posts/list/732.page
to populate the other tables, have I duplicated work?
What would be the point of these extra tables if I have the giant geonames table?
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 26/08/2010 15:12:36
|
geotree
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline
|
Read this thread :
http://forum.geonames.org/gforum/posts/list/2033.page
to get everything (except postal codes) in your local MySQL database.
|
Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 16/10/2010 01:10:40
|
phoenix
Joined: 16/10/2010 01:08:02
Messages: 2
Offline
|
Hi,
How i can use postal codes in my local database ?
Thx
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 16/10/2010 08:45:19
|
geotree
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline
|
phoenix wrote:
How i can use postal codes in my local database ?
May you explain what you want to do with postal codes (form pre-filling ? form validation ? etc) and for which countries ?
|
Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 19/10/2010 17:42:39
|
phoenix
Joined: 16/10/2010 01:08:02
Messages: 2
Offline
|
I wont to write function that return the same information of " findNearbyPostalCodes "
I used this SQL query for latitude:40.5720500 and longitude: -74.6412700
mysql> SELECT *, (ACOS((SIN(40.5726013183594/57.295 * SIN(latitude/57.295 ) + (COS(40.5726013183594/57.295 * COS(latitude/57.295 * COS(longitude/57.2958 - (-74.6423034667969)/57.295 ))) * 3963 AS distance FROM geoname WHERE (latitude >= 40.5726013183594 - (10/111)) AND (latitude <= 40.5726013183594 + (10/111)) AND (longitude >= (-74.6423034667969) - (10/111))AND (longitude <= (-74.6423034667969) + (10/111)) ORDER BY distance ASC limit 5 \G
*************************** 1. row ***************************
geonameid: 5103137
name: Borough of Raritan
asciiname: Borough of Raritan
alternatenames:
latitude: 40.5720500
longitude: -74.6412700
fclass: A
fcode: ADMD
country: US
cc2:
admin1: NJ
admin2: 035
admin3:
admin4:
population: 0
elevation: 29
gtopo30: 27
timezone: America/New_York
moddate: 2007-02-14
distance: 0.0663497418948286
I used the webservice for the same data ( http://ws.geonames.org/findNearbyPostalCodes?lat=40.5726013183594&lng=-74.6423034667969 ) and i find the postal code, but in local i can't find this information, my question is in any table i found the postal code ?
Thx
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 22/10/2010 17:23:30
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
you have to download the data from the postal code directory (see link above). You are currently using the toponym files, which have postal codes for some countries in the alternatename table.
Marc
|
 |
|
|
 |
|
|