2008-08-06 02:13:06 +08:00
|
|
|
from django.db.models.manager import Manager
|
|
|
|
from django.contrib.gis.db.models.query import GeoQuerySet
|
|
|
|
|
|
|
|
class GeoManager(Manager):
|
|
|
|
"Overrides Manager to return Geographic QuerySets."
|
|
|
|
|
|
|
|
# This manager should be used for queries on related fields
|
|
|
|
# so that geometry columns on Oracle and MySQL are selected
|
|
|
|
# properly.
|
|
|
|
use_for_related_fields = True
|
|
|
|
|
|
|
|
def get_query_set(self):
|
2010-01-23 02:30:23 +08:00
|
|
|
return GeoQuerySet(self.model, using=self._db)
|
2008-08-06 02:13:06 +08:00
|
|
|
|
|
|
|
def area(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().area(*args, **kwargs)
|
|
|
|
|
|
|
|
def centroid(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().centroid(*args, **kwargs)
|
|
|
|
|
2009-07-15 10:20:51 +08:00
|
|
|
def collect(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().collect(*args, **kwargs)
|
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def difference(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().difference(*args, **kwargs)
|
|
|
|
|
|
|
|
def distance(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().distance(*args, **kwargs)
|
|
|
|
|
|
|
|
def envelope(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().envelope(*args, **kwargs)
|
|
|
|
|
|
|
|
def extent(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().extent(*args, **kwargs)
|
|
|
|
|
2009-11-17 02:49:00 +08:00
|
|
|
def extent3d(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().extent3d(*args, **kwargs)
|
|
|
|
|
2010-01-29 10:20:58 +08:00
|
|
|
def force_rhr(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().force_rhr(*args, **kwargs)
|
|
|
|
|
2010-01-29 10:46:07 +08:00
|
|
|
def geohash(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().geohash(*args, **kwargs)
|
|
|
|
|
2009-04-03 00:50:44 +08:00
|
|
|
def geojson(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().geojson(*args, **kwargs)
|
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def gml(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().gml(*args, **kwargs)
|
|
|
|
|
|
|
|
def intersection(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().intersection(*args, **kwargs)
|
|
|
|
|
|
|
|
def kml(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().kml(*args, **kwargs)
|
|
|
|
|
|
|
|
def length(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().length(*args, **kwargs)
|
|
|
|
|
|
|
|
def make_line(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().make_line(*args, **kwargs)
|
2009-12-22 23:18:51 +08:00
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def mem_size(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().mem_size(*args, **kwargs)
|
|
|
|
|
|
|
|
def num_geom(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().num_geom(*args, **kwargs)
|
|
|
|
|
|
|
|
def num_points(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().num_points(*args, **kwargs)
|
|
|
|
|
|
|
|
def perimeter(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().perimeter(*args, **kwargs)
|
|
|
|
|
|
|
|
def point_on_surface(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().point_on_surface(*args, **kwargs)
|
|
|
|
|
2010-01-29 10:46:07 +08:00
|
|
|
def reverse_geom(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().reverse_geom(*args, **kwargs)
|
2010-01-29 10:20:58 +08:00
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def scale(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().scale(*args, **kwargs)
|
|
|
|
|
2009-04-03 00:50:44 +08:00
|
|
|
def snap_to_grid(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().snap_to_grid(*args, **kwargs)
|
|
|
|
|
2008-08-06 02:13:06 +08:00
|
|
|
def svg(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().svg(*args, **kwargs)
|
|
|
|
|
|
|
|
def sym_difference(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().sym_difference(*args, **kwargs)
|
|
|
|
|
|
|
|
def transform(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().transform(*args, **kwargs)
|
|
|
|
|
|
|
|
def translate(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().translate(*args, **kwargs)
|
|
|
|
|
|
|
|
def union(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().union(*args, **kwargs)
|
|
|
|
|
|
|
|
def unionagg(self, *args, **kwargs):
|
|
|
|
return self.get_query_set().unionagg(*args, **kwargs)
|