mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-06-29 08:38:42 +02:00
Moved log out of loop
This commit is contained in:
parent
9c5782e6c8
commit
24bed2a73c
|
@ -150,11 +150,13 @@ def polylabel(polygon: Polygon, precision: float=0.5, debug: bool=False):
|
|||
if bbox_cell.min_dist > best_cell.min_dist:
|
||||
best_cell = bbox_cell
|
||||
|
||||
threshold: float = log10(cell_size) / 2.0
|
||||
|
||||
num_of_probes = cell_queue.qsize()
|
||||
while not cell_queue.empty():
|
||||
_, __, cell = cell_queue.get()
|
||||
|
||||
if cell.min_dist > best_cell.min_dist or (cell.center_dist < best_cell.center_dist and cell.min_dist > best_cell.min_dist - log10(cell_size) / 2.0):
|
||||
if cell.min_dist > best_cell.min_dist or (cell.center_dist < best_cell.center_dist and cell.min_dist > best_cell.min_dist - threshold):
|
||||
best_cell = cell
|
||||
|
||||
if debug:
|
||||
|
|
Loading…
Reference in a new issue