mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-09-29 22:19:11 +02:00
Moved log out of loop
This commit is contained in:
parent
9c5782e6c8
commit
24bed2a73c
1 changed files with 3 additions and 1 deletions
|
@ -150,11 +150,13 @@ def polylabel(polygon: Polygon, precision: float=0.5, debug: bool=False):
|
||||||
if bbox_cell.min_dist > best_cell.min_dist:
|
if bbox_cell.min_dist > best_cell.min_dist:
|
||||||
best_cell = bbox_cell
|
best_cell = bbox_cell
|
||||||
|
|
||||||
|
threshold: float = log10(cell_size) / 2.0
|
||||||
|
|
||||||
num_of_probes = cell_queue.qsize()
|
num_of_probes = cell_queue.qsize()
|
||||||
while not cell_queue.empty():
|
while not cell_queue.empty():
|
||||||
_, __, cell = cell_queue.get()
|
_, __, 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
|
best_cell = cell
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Reference in a new issue