How to use Django for effective geolocation?

django, geolocation, iphone, python

Solution

Take a look at GeoDjango and PostGIS.

GeoDjango will give you the ability to store geo informations and do distance lookups.

You also could use OSMGeoAdmin or django-location-field to help you easily fill the location fields.

Problem

I want to do the following. I want to create an app that does the following - Restaurants put in the address where they are located. - Person A opens up the app and sees the number of miles each restaurant is from his/her present location sorted by nearest. How can I do this in the most effective way? If the restaurant gives me their address, should I be converting that address to longitude/latitude points, and then somehow using that to get the distance from the person A current location? But how do I do this so effectively so that if there are 1000 addresses in the database, I can efficiently sort all of these addresses - nearest to person A first- without taking too much time? Thanks! I am using django.

Original source