Skip to content

System Overview

BERA Tools is organized into clear layers:

  • beratools/modules: one folder per module (mapping, pc2products, raster2products, ...) with its tool entry points, their algorithms and its tools.json; the PC2Products LiDAR tools (rpy_*.py) call R processing in r_scripts_collection.r
  • beratools/core: frame code: tool running, the tool registry and user-built pipelines (pipeline.py)
  • beratools/cli: the bt command
  • beratools/gui: desktop GUI and parameter widgets
  • beratools/utility: shared helpers (arguments, environment checks, spatial helpers)

Design principles

  • Separation of concerns: tool wrappers stay lightweight; heavy logic stays in each module's algo_*.py files.
  • Single source of tool metadata: GUI and CLI parameter behavior derives from tool configuration.
  • Consistent execution model: tools support CLI and GUI call modes with shared runtime behaviors.

Module responsibilities

  • modules/<module>/<tool>.py: validate/collect inputs, call the module's algorithms, write outputs.
  • modules/<module>/algo_*.py: geometric/raster algorithms, optimization, line processing.
  • modules/<module>/tools.json: the module's tools and their parameters, merged by core/registry.py.
  • modules/pc2products/rpy_*.py: validate inputs, check R packages, call the tool's R function through rpy2.
  • modules/pc2products/r_interface.py, modules/pc2products/r_common.py: locate R and connect rpy2.
  • core/tool_base.py: multiprocessing shared by the tools.
  • core/pipeline.py: save, load, link and run pipelines of tool steps.
  • cli/*: the bt subcommands, built from tool metadata.
  • gui/*: exposes tools and parameters for interactive use.

See also: Execution Pipeline