[fix] same options for geohash-based index
This commit is contained in:
@@ -277,7 +277,7 @@ class GeohashPolygonIndex(PolygonIndex):
|
|||||||
lat, lon = (bbox[1] + bbox[3]) / 2.0, (bbox[0] + bbox[2]) / 2.0
|
lat, lon = (bbox[1] + bbox[3]) / 2.0, (bbox[0] + bbox[2]) / 2.0
|
||||||
self.index_point(lat, lon, geohash_level)
|
self.index_point(lat, lon, geohash_level)
|
||||||
|
|
||||||
def get_candidate_polygons(self, lat, lon, all_levels=False):
|
def get_candidate_polygons(self, lat, lon, return_all=False):
|
||||||
candidates = []
|
candidates = []
|
||||||
code = geohash.encode(lat, lon)
|
code = geohash.encode(lat, lon)
|
||||||
for level, area in self.GEOHASH_PRECISIONS:
|
for level, area in self.GEOHASH_PRECISIONS:
|
||||||
@@ -285,7 +285,7 @@ class GeohashPolygonIndex(PolygonIndex):
|
|||||||
if not indices:
|
if not indices:
|
||||||
continue
|
continue
|
||||||
candidates.extend(indices)
|
candidates.extend(indices)
|
||||||
if not all_levels:
|
if not return_all:
|
||||||
break
|
break
|
||||||
return candidates
|
return candidates
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user