Author |
Message |
08/12/2007 23:40:06
|
vanvemden
Joined: 05/12/2007 00:50:12
Messages: 2
Offline
|
Mark,
Thank you for the link to the postal code dbase download it got by email. I am trying to find the MYSQL dbase schema for the postal codes, like you posted for the geonames (http://forum.geonames.org/gforum/posts/list/80.page) but I'm unable to find it. I'm also wondering what you are using as a key, as the postal code dbase for the US contains duplicate entries for the zip (e.g. zip 36203 is used for two entries Oxford (AL) and Anniston (AL)).
Thank in advance you for your expertise.
Marco
|
|
|
10/12/2007 11:10:22
|
seek
Joined: 07/12/2007 14:36:57
Messages: 4
Offline
|
Try this:
CREATE TABLE `zip_codes` (
`country_code` VARCHAR( 2 ) NOT NULL ,
`postal_code` VARCHAR( 10 ) NOT NULL ,
`place_name` VARCHAR( 180 ) NULL ,
`admin_name1` VARCHAR( 100 ) NULL ,
`admin_code1` VARCHAR( 20 ) NULL ,
`admin_name2` VARCHAR( 100 ) NULL ,
`admin_code2` VARCHAR( 20 ) NULL ,
`admin_name3` VARCHAR( 100 ) NULL ,
`latitude` DOUBLE NOT NULL DEFAULT '0',
`longitude` DOUBLE NOT NULL DEFAULT '0',
`accuracy` DOUBLE NOT NULL DEFAULT '0'
) ENGINE = MYISAM ;
|
|
|
10/12/2007 14:54:29
|
vanvemden
Joined: 05/12/2007 00:50:12
Messages: 2
Offline
|
Thanks for the response, but how about the primary key and maybe some indexes?
|
|
|
14/12/2007 11:02:31
|
seek
Joined: 07/12/2007 14:36:57
Messages: 4
Offline
|
i would say country_code and postal_code are primary keys..
i dont know yet which could be indexes..
maybe has another user an optimized answer..
|
|
|
21/12/2007 17:27:33
|
seek
Joined: 07/12/2007 14:36:57
Messages: 4
Offline
|
please HELP!!!!
any IDEAS for any index or keys??
|
|
|
21/12/2007 18:36:26
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
I would say it depends on what you want to do. There is no standard answer for this, every application will have different needs. We at GeoNames don't have use keys on the postal codes and we have only an index on the lat/lng for reverse geocoding.
Cheers
Marc
|
|
|
|
|