Ticket #11854: django-trunk-rev16840-azimuth-version1.diff
File django-trunk-rev16840-azimuth-version1.diff, 2.6 KB (added by , 13 years ago) |
---|
-
django/contrib/gis/db/backends/postgis/operations.py
### Eclipse Workspace Patch 1.0 #P django-trunk
163 163 'overlaps' : PostGISFunction(prefix, 'Overlaps'), 164 164 'contains' : PostGISFunction(prefix, 'Contains'), 165 165 'intersects' : PostGISFunction(prefix, 'Intersects'), 166 'azimuth' : PostGISFunction(prefix, 'Azimuth'), 166 167 'relate' : (PostGISRelate, basestring), 167 168 } 168 169 … … 242 243 self.gis_terms = dict([(term, None) for term in gis_terms]) 243 244 244 245 self.area = prefix + 'Area' 246 self.azimuth = prefix + 'Azimuth' 245 247 self.bounding_circle = BOUNDINGCIRCLE 246 248 self.centroid = prefix + 'Centroid' 247 249 self.collect = prefix + 'Collect' -
django/contrib/gis/db/models/query.py
58 58 # TODO: Do we want to support raw number areas for geodetic fields? 59 59 raise Exception('Area on geodetic coordinate systems not supported.') 60 60 return self._spatial_attribute('area', s, **kwargs) 61 62 def azimuth(self, geom, **kwargs): 63 return self._geomset_attribute('azimuth', geom, **kwargs) 61 64 62 65 def centroid(self, **kwargs): 63 66 """ … … 565 568 # Finally, setting the extra selection attribute with 566 569 # the format string expanded with the stored procedure 567 570 # arguments. 571 572 #print settings 573 #print "model_att:", fmt % settings['procedure_args'] 574 #print "select_params:", settings['select_params'] 568 575 return self.extra(select={model_att : fmt % settings['procedure_args']}, 569 576 select_params=settings['select_params']) 570 577 -
django/contrib/gis/db/models/manager.py
14 14 15 15 def area(self, *args, **kwargs): 16 16 return self.get_query_set().area(*args, **kwargs) 17 18 def azimuth(self, *args, **kwargs): 19 return self.get_query_set().azimuth(*args, **kwargs) 17 20 18 21 def centroid(self, *args, **kwargs): 19 22 return self.get_query_set().centroid(*args, **kwargs)