管理管理地理数据的django应用程序。
django-geo的Python项目详细描述
管理管理地理数据的django应用程序。 它使用由django mptthttps://github.com/django mptt/django mptt/
geo不是要取代gis,而是要管理所有的案例 具有严格/惰性层次结构的管理树。
型号
- 国家
- 面积
- 位置
- 管理区域类型
- 货币
示例
Three levels
italy=Country.objects.get(iso_code='IT')regione,__=italy.administrativeareatype_set.get_or_create(name='Regione')provincia,__=italy.administrativeareatype_set.get_or_create(name='Provincia',parent=regione)comune,__=italy.administrativeareatype_set.get_or_create(name='Comune',parent=provincia)lazio,__=AdministrativeArea.objects.get_or_create(country=italy,name='Lazio',type=regione)roma_provincia,__=AdministrativeArea.objects.get_or_create(country=italy,name='Provincia di Roma',type=provincia,parent=lazio)roma_comune,__=AdministrativeArea.objects.get_or_create(country=italy,name='Comune di Roma',type=comune,parent=roma_provincia)city,__=LocationType.objects.get_or_create(description='CITY')roma,__=Location.objects.get_or_create(country=italy,name='Roma',type=city,area=roma_comune)
两个级别
us=Country.objects.get(iso_code='US')state,__=italy.administrativeareatype_set.get_or_create(name='State')county,__=italy.administrativeareatype_set.get_or_create(name='County',parent=state)ny,__=AdministrativeArea.objects.get_or_create(country=us,name='New York',type=state)columbia,__=AdministrativeArea.objects.get_or_create(country=us,name='Columbia',type=county,parent=ny)city,__=LocationType.objects.get_or_create(description='CITY')hudson,__=Location.objects.get_or_create(country=us,name='Hudson',type=city,area=columbia,is_administrative=True)
链接
Stable | |||
Development | |||
Project home page: | https://github.com/saxix/django-geo | ||
Issue tracker: | https://github.com/saxix/django-geo/issues?sort | ||
Download: | http://pypi.python.org/pypi/django-geo/ | ||
Documentation: | https://django-geo.readthedocs.org/en/latest/ |