Zip code reverse lookup to supply city and state default values

Events happening in the community are now at Drupal community events on www.drupal.org.
chowdah's picture

I'm building a directory and have created a (CCK) content type that collects location info using Location and Gmap. I have a lot of entries and would like to auto-populate the city and state fields in the location input by providing just the zip code . Is this possible or would there be a module out there that might do this?

I have created the zip code table in the data base using the zip_codes.us.mysql file that's included with the location module.

Comments

I'm not aware of an existing

criznach's picture

I'm not aware of an existing module - that doesn't mean it doesn't exist though...

Check out geonames.org. They provide a list of named places with location. You could use your zip code table to find the geographic center of the zip code, then pull the closest city name from the geonames data.

I already have the zip code

chowdah's picture

I already have the zip code data I need (it comes with the location module and can be found in the 'database' folder of the location module's file structure).

Yes - that, the geonames.org

criznach's picture

Yes - that, the geonames.org data, and a possibly a small custom module should be all you need. You might be able to import the geonames data into nodes/locations, but it's a big dataset so that might be overkill.

Hey, thats exactly what I am

gugki's picture

Hey, thats exactly what I am also looking for.
Some kind of ajax enhancement of location module which searchs for citys when zip code is entered (optimal would be vise-versa).
No one seen sth like this yet? :(

I am looking for this as well

RKopacz's picture

I am looking for this as well. Surprised it isn't anywhere to be found..

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: