1👍
Note that if you store your geom
field as a geography type, the Area
function should return square meters instead of degrees.
from django.contrib.gis.db import models as gis_models
class City(gis_models.Model):
geom = gis_models.PolygonField(geography=True)
…
cities = City.objects.annotate(area=Area('geom'))
cities[0].area.sq_m # square meters
- [Answered ]-Value is not in range with pandas
- [Answered ]-Implement a typeahead for manytomany field
- [Answered ]-Use managers in Factory-Boy for models
- [Answered ]-Django 1.10 error, 'NoneType' object is not callable
- [Answered ]-(beginner) First Django Web App – models.py
Source:stackexchange.com