GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Postal code dbase schema  XML
Forum Index -> Postal Codes
Author Message
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
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 ;
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?
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..
seek



Joined: 07/12/2007 14:36:57
Messages: 4
Offline

please HELP!!!!

any IDEAS for any index or keys??

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

[WWW]
 
Forum Index -> Postal Codes
Go to:   
Powered by JForum 2.1.5 © JForum Team