views:

94

answers:

1

I'm trying to create a Django app that would take an inputted address and return a list of political races that person would vote in. I have maps of all the districts (PDFs). And I know that I can use geopy to convert an inputted address into coordinates. How do I define the voter districts in Django so that I can run a query to see what districts those coordinates fall in?

+1  A: 

This is a non-trivial problem too large in scope to answer in specific detail here. In short, you'll need to use GeoDjango (part of contrib). There is a section dedicated to importing spacial data.

Once you have your data loaded, you can use spacial lookups to find what district a particular coordinate intersects.

As to where to get the voter district data, you might start with www.data.gov's geodata catalog.

Chris Lawlor