Skip to content

get_nearest_points returns point,distance instead of distance,point#4

Open
ronagrawal wants to merge 1 commit intogusdan:masterfrom
ronagrawal:patch-1
Open

get_nearest_points returns point,distance instead of distance,point#4
ronagrawal wants to merge 1 commit intogusdan:masterfrom
ronagrawal:patch-1

Conversation

@ronagrawal
Copy link

@ronagrawal ronagrawal commented Nov 16, 2016

With reference to :
This function returns point,distance

def get_nearest_points(self, center_point, radius, unit='km'):
"""
return list of geo points from circle with given center and radius
:param center_point: GeoPoint with center of search circle
:param radius: radius of search circle
:return: generator with tuple with GeoPoints and distance
"""
assert isinstance(center_point, GeoPoint),
'point should be GeoPoint instance'
for point in self.get_nearest_points_dirty(center_point, radius):
distance = point.distance_to(center_point, unit)
if distance <= radius:
yield point, distance

With reference to :
def get_nearest_points(self, center_point, radius, unit='km'):
              returns  : yield point, distance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant