views:

38

answers:

1

I would like to implement a location based search, based on the geonames zip code dump. For that, I want to use geodjango, but I have no idea how to implement the geonames data for lookup. I don't want to use an external webservice.

Maybe someone already has realized that and has some inspirations for me?

+1  A: 

http://geodjango.org/hg/geonames/

Dane Springmeyer
Looks good, I will try that - thanks!
sewid
I tried that, the README says to execute: $ ./manage.py compress_geonames but I get "Unknown command: 'compress_geonames'". Did I miss something? I added the code as an application, included it in settings.py, ...
sewid
Found my error, missed to copy some files from the management/commands subfolder. Another try...
sewid
Another problem: the load_geonames.py tries to import "from django.contrib.gis.db.backend.postgis.creation import get_cmd_options", but there is no backend.postgis.creation. There is only a backends.postgis.creation in the current django version. Is this example outdated and if yes, is it possible to use it with the current django version? Sorry for all those "stupid" questions, I am new to django and am searching and searching for informations...
sewid
I solved this problem by hardcoding the database name in this script. Then, the include is not required. But when importing the data, I get "ERROR: value too long for type character varying(6)". It seems, that this example application is not compatible to current django versions :-(
sewid