Ticket #12410: line_locate_point.patch
File line_locate_point.patch, 2.9 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/db/models/manager.py
88 88 def translate(self, *args, **kwargs): 89 89 return self.get_query_set().translate(*args, **kwargs) 90 90 91 def line_locate_point(self, *args, **kwargs): 92 return self.get_query_set().line_locate_point(*args, **kwargs) 93 91 94 def union(self, *args, **kwargs): 92 95 return self.get_query_set().union(*args, **kwargs) 93 96 -
django/contrib/gis/db/models/query.py
375 375 self.query.custom_select[geo_field] = custom_sel 376 376 return self._clone() 377 377 378 def line_locate_point(self, geom, **kwargs): 379 """ 380 Return a float between 0 and 1 representing the location of the 381 closest point on the LineString passed to the specified PointField. 382 """ 383 if SpatialBackend.postgis: 384 s = {'geom_args' : ('geom',), 385 'procedure_fmt' : '%(geom)s,%(geo_col)s', 386 'procedure_args' : {'geom': geom}, 387 } 388 else: 389 raise NotImplementedError('backend does not support line_locate_point') 390 return self._spatial_attribute('line_locate_point', s, **kwargs) 391 378 392 def union(self, geom, **kwargs): 379 393 """ 380 394 Returns the union of the geographic field with the given -
django/contrib/gis/db/backend/postgis/__init__.py
41 41 sym_difference=SYM_DIFFERENCE, 42 42 transform=TRANSFORM, 43 43 translate=TRANSLATE, 44 line_locate_point=LINE_LOCATE_POINT, 44 45 union=UNION, 45 46 unionagg=UNIONAGG, 46 47 version=(MAJOR_VERSION, MINOR_VERSION1, MINOR_VERSION2), -
django/contrib/gis/db/backend/postgis/query.py
84 84 SYM_DIFFERENCE = get_func('SymDifference') 85 85 TRANSFORM = get_func('Transform') 86 86 TRANSLATE = get_func('Translate') 87 LINE_LOCATE_POINT = get_func('Line_Locate_Point') 87 88 88 89 # Special cases for union, KML, and GeoJSON methods. 89 90 if MINOR_VERSION1 < 3: