https://github.com/dcwatson/django-places
A django model for US census place information.
https://github.com/dcwatson/django-places
Last synced: about 1 year ago
JSON representation
A django model for US census place information.
- Host: GitHub
- URL: https://github.com/dcwatson/django-places
- Owner: dcwatson
- Created: 2013-06-15T13:52:31.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-06-15T13:58:30.000Z (almost 13 years ago)
- Last Synced: 2025-02-15T13:48:03.651Z (over 1 year ago)
- Language: Python
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
django-places
=============
A django model for US census place information.
To populate the database, download the places file from:
http://www.census.gov/geo/maps-data/data/gazetteer2010.html
Then run the following command:
./manage.py loadplaces
Finding Places
==============
Place.objects.nearby(lat, lon, radius)
Returns a queryset of Places within the given radius of lat/lon.
Place.objects.closest(lat, lon, radius)
Returns the closest Place and the distance to the lat/lon, within
the given radius.
Place.distance_to(place)
Place.distance_to(lat, lon)
Returns the distance in miles between a Place and another Place
or lat/lon coordinates.
PlaceManager
============
You can use the PlaceManager in places.managers with any model that has
decimal fields named "longitude" and "latitude".