BERATools 0.3.9__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {beratools-0.3.9 → beratools-0.4.0}/.gitignore +1 -0
- {beratools-0.3.9 → beratools-0.4.0}/PKG-INFO +1 -1
- {beratools-0.3.9 → beratools-0.4.0}/beratools/__init__.py +2 -2
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_centerline.py +20 -8
- beratools-0.4.0/beratools/core/algo_check_seed_line.py +813 -0
- beratools-0.4.0/beratools/core/algo_check_seed_line_validate.py +388 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_common.py +24 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/logger.py +1 -0
- beratools-0.4.0/beratools/core/tool_geo_simplify.py +89 -0
- beratools-0.4.0/beratools/external/geo_simplify/geo-simplify-linux-x64 +0 -0
- beratools-0.4.0/beratools/external/geo_simplify/geo-simplify-win-x64.exe +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/beratools.json +35 -24
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/bt_data.py +13 -48
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/bt_gui_main.py +42 -7
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/tool_widgets.py +32 -14
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/canopy_footprint_absolute.py +22 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/centerline.py +69 -7
- beratools-0.4.0/beratools/tools/check_seed_line.py +870 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/ground_footprint.py +22 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/utility/spatial_common.py +169 -4
- beratools-0.4.0/beratools/utility/unit_conversion.py +119 -0
- beratools-0.3.9/beratools/core/algo_check_seed_line.py +0 -172
- beratools-0.3.9/beratools/tools/check_seed_line.py +0 -1524
- {beratools-0.3.9 → beratools-0.4.0}/LICENSE +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/README.md +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/cli/__init__.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/cli/entry.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/__init__.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_canopy_footprint_absolute.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_cost.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_dijkstra.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_line_grouping.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_merge_lines.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_seed_line_correction.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_split_with_lines.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_vertex_optimization.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/algo_vertex_preclean.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/canopy_threshold_relative.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/constants.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/line_footprint_functions.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/core/tool_base.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/__init__.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/polygon_centerline/LICENSE.md +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/polygon_centerline/UPSTREAM.md +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/polygon_centerline/__init__.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/polygon_centerline/_src.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/external/polygon_centerline/exceptions.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/BERALogo.ico +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/BERALogo.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/BERA_GUI_Main.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/BERA_Splash.gif +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/BERA_WizardImage.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/closed.gif +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/closed.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/gui.json +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/open.gif +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/open.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/tool.gif +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/assets/tool.png +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/geometry_types.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/gui/main.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/__init__.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/common.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/line_footprint_relative.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/tool_template.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/tools/vertex_optimization.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/utility/env_checks.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/beratools/utility/tool_args.py +0 -0
- {beratools-0.3.9 → beratools-0.4.0}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: BERATools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: An advanced forest line feature analysis platform
|
|
5
5
|
Project-URL: Homepage, https://github.com/appliedgrg/beratools
|
|
6
6
|
Author-email: AppliedGRG <appliedgrg@gmail.com>, Richard Zeng <richardqzeng@gmail.com>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
__author__ = """Applied Geospatial Research Group"""
|
|
2
2
|
__email__ = 'appliedgrg@gmail.com'
|
|
3
|
-
__version__ = '0.
|
|
3
|
+
__version__ = '0.4.0'
|
|
4
4
|
__license__ = "GPL-3.0-or-later"
|
|
5
5
|
__copyright__ = "Copyright (c) AppliedGRG"
|
|
6
6
|
__status__ = "Pre-Alpha"
|
|
7
7
|
__url__ = "https://github.com/appliedgrg/beratools"
|
|
8
|
-
__all__ = ["tools", "gui"]
|
|
8
|
+
__all__ = ["tools", "gui"]
|
|
@@ -99,7 +99,10 @@ def snap_end_to_end(in_line, line_reference, max_snap_dist=None):
|
|
|
99
99
|
if type(in_line) is sh_geom.MultiLineString:
|
|
100
100
|
in_line = sh_ops.linemerge(in_line)
|
|
101
101
|
if type(in_line) is sh_geom.MultiLineString:
|
|
102
|
-
|
|
102
|
+
algo_common.log_file_only(
|
|
103
|
+
f"algo_centerline: MultiLineString found {in_line.centroid}, pass.",
|
|
104
|
+
logger_name=__name__,
|
|
105
|
+
)
|
|
103
106
|
return None
|
|
104
107
|
|
|
105
108
|
pts = list(in_line.coords)
|
|
@@ -218,7 +221,7 @@ def find_centerline(poly, input_line, guided_strategy="main_route"):
|
|
|
218
221
|
effective_strategy = guided_strategy
|
|
219
222
|
|
|
220
223
|
if not poly:
|
|
221
|
-
|
|
224
|
+
algo_common.log_file_only("find_centerline: No polygon found")
|
|
222
225
|
return default_return
|
|
223
226
|
|
|
224
227
|
poly = shapely.segmentize(poly, max_segment_length=CenterlineParams.SEGMENTIZE_LENGTH)
|
|
@@ -252,11 +255,18 @@ def find_centerline(poly, input_line, guided_strategy="main_route"):
|
|
|
252
255
|
guided_strategy,
|
|
253
256
|
)
|
|
254
257
|
except Exception as e:
|
|
255
|
-
|
|
258
|
+
error_msg = str(e)
|
|
259
|
+
if error_msg == "endpoint-guided extraction failed for provided endpoints":
|
|
260
|
+
algo_common.log_file_only(f"find_centerline: {error_msg}")
|
|
261
|
+
else:
|
|
262
|
+
print(f"find_centerline: {e}")
|
|
256
263
|
centerline = None
|
|
257
264
|
|
|
258
265
|
if not centerline and guided_strategy in {"pairwise", "virtual_nodes", "direct_insert"}:
|
|
259
|
-
|
|
266
|
+
if guided_strategy == "pairwise":
|
|
267
|
+
algo_common.log_file_only("find_centerline: pairwise guidance failed, retrying main_route")
|
|
268
|
+
else:
|
|
269
|
+
print(f"find_centerline: {guided_strategy} guidance failed, retrying main_route")
|
|
260
270
|
try:
|
|
261
271
|
centerline = _extract_centerline_from_polygon(
|
|
262
272
|
poly,
|
|
@@ -305,7 +315,7 @@ def find_centerline(poly, input_line, guided_strategy="main_route"):
|
|
|
305
315
|
# Check centerline. If valid, regenerate by splitting polygon into two halves.
|
|
306
316
|
if not centerline_is_valid(centerline, input_line):
|
|
307
317
|
try:
|
|
308
|
-
|
|
318
|
+
algo_common.log_file_only("Regenerating line ...", logger_name=__name__)
|
|
309
319
|
centerline = regenerate_centerline(poly, input_line)
|
|
310
320
|
return centerline, CenterlineStatus.REGENERATE_SUCCESS
|
|
311
321
|
except Exception as e:
|
|
@@ -447,7 +457,9 @@ def regenerate_centerline(poly, input_line):
|
|
|
447
457
|
poly_split = sh_ops.split(poly_exterior, perp)
|
|
448
458
|
|
|
449
459
|
if len(poly_split.geoms) < 2:
|
|
450
|
-
|
|
460
|
+
algo_common.log_file_only(
|
|
461
|
+
"regenerate_centerline: polygon sh_ops.split failed, pass.", logger_name=__name__
|
|
462
|
+
)
|
|
451
463
|
return None
|
|
452
464
|
|
|
453
465
|
poly_1 = poly_split.geoms[0]
|
|
@@ -480,7 +492,7 @@ def regenerate_centerline(poly, input_line):
|
|
|
480
492
|
except Exception as e:
|
|
481
493
|
print(f"regenerate_centerline: {e}")
|
|
482
494
|
|
|
483
|
-
|
|
495
|
+
algo_common.log_file_only("Centerline is regenerated.", logger_name=__name__)
|
|
484
496
|
return sh_ops.linemerge(sh_geom.MultiLineString([center_line_1, center_line_2]))
|
|
485
497
|
|
|
486
498
|
|
|
@@ -531,7 +543,7 @@ class SeedLine:
|
|
|
531
543
|
|
|
532
544
|
# search for centerline
|
|
533
545
|
if len(lc_path_coords) < 2:
|
|
534
|
-
|
|
546
|
+
algo_common.log_file_only("No least cost path detected, use input line.", logger_name=__name__)
|
|
535
547
|
self.line["cl_status"] = CenterlineStatus.FAILED.value
|
|
536
548
|
return
|
|
537
549
|
|