diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c323c233ff..b61ac949e7 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,6 +5,7 @@ on: - 'deprecated/**' - 'docs/**' - '.github/**' + - 'tools/3dtrees_csp_stand_segmentation/**' - '*' push: branches: @@ -14,6 +15,7 @@ on: - 'deprecated/**' - 'docs/**' - '.github/**' + - 'tools/3dtrees_csp_stand_segmentation/**' - '*' env: GALAXY_FORK: galaxyproject diff --git a/.github/workflows/pr_without_tool_change.yaml b/.github/workflows/pr_without_tool_change.yaml index edff41005f..4e88432116 100644 --- a/.github/workflows/pr_without_tool_change.yaml +++ b/.github/workflows/pr_without_tool_change.yaml @@ -4,6 +4,9 @@ name: Fallback # see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks on: pull_request: + paths-ignore: + - '.github/**' + - 'tools/3dtrees_csp_stand_segmentation/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/tools/3dtrees_csp_stand_segmentation/.shed.yml b/tools/3dtrees_csp_stand_segmentation/.shed.yml new file mode 100644 index 0000000000..20b1c28c89 --- /dev/null +++ b/tools/3dtrees_csp_stand_segmentation/.shed.yml @@ -0,0 +1,11 @@ +name: 3dtrees_csp_stand_segmentation +owner: bgruening +description: DTM generation and multi-segmentation forest inventory with optional CSP tree segmentation. +homepage_url: https://github.com/3dTrees-earth/3dtrees_CSP_StandSegmentation +long_description: | + Creates a DTM and forest inventories for one or more LAS instance dimensions. + Comparative Shortest Path segmentation can optionally add PredInstance_CSP. +remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools/3dtrees_csp_stand_segmentation +type: unrestricted +categories: +- "Geo Science" diff --git a/tools/3dtrees_csp_stand_segmentation/3dtrees_csp_stand_segmentation.xml b/tools/3dtrees_csp_stand_segmentation/3dtrees_csp_stand_segmentation.xml new file mode 100644 index 0000000000..df6c61219f --- /dev/null +++ b/tools/3dtrees_csp_stand_segmentation/3dtrees_csp_stand_segmentation.xml @@ -0,0 +1,357 @@ + + DTM generation and multi-segmentation forest inventory with optional comparative shortest path segmentation + + 0.2.0 + 2 + + + ghcr.io/3dtrees-earth/3dtrees_csp_standsegmentation:@TOOL_VERSION@ + + Rscript /opt/CspStandSegmentation/exec/run.R --version + + + + + + ^[A-Za-z][A-Za-z0-9_]*$ + + + + + + + + + + ^[A-Za-z][A-Za-z0-9_]*$ + + + ^[A-Za-z][A-Za-z0-9_]*$ + + + + + + ^-?[0-9]+(?:\.[0-9]+)?(?:,-?[0-9]+(?:\.[0-9]+)?)*$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + aoi_json + + + + + + + + any([s['species']['mode'] == 'provided' for s in segmentations]) + + + csp['enable'] == 'true' + + + csp['enable'] == 'true' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.1007/s10342-025-01796-z + 10.5281/zenodo.17294732 + + diff --git a/tools/3dtrees_csp_stand_segmentation/README.rst b/tools/3dtrees_csp_stand_segmentation/README.rst new file mode 100644 index 0000000000..11ac6a1699 --- /dev/null +++ b/tools/3dtrees_csp_stand_segmentation/README.rst @@ -0,0 +1,30 @@ +3Dtrees: CSP StandSegmentation +============================== + +Galaxy wrapper for DTM generation, repeatable multi-segmentation forest +inventory, and optional Comparative Shortest Path tree segmentation. + +The wrapper copies Galaxy's extensionless internal dataset to ``input.laz``, +the same pattern used by ``3dtrees_standardization/standard.xml``. This adds +temporary disk I/O and storage proportional to the compressed input size but +keeps the copy operation outside the R process's memory footprint. + +The default interface exposes the input, repeatable instance/species dimension +mapping, non-tree IDs, CSP mode and seed source, AOI, 0.2 m DTM resolution, and +random seed. Algorithm controls are grouped under **Keep defaults** and +**Fine-tune** sections. + +Inventory-only runs default to bounded 300 m spatial reads, a 5 m DTM buffer, +10 DTM workers, and 64 disk-backed instance partitions. DTM generation uses +spatial reads below 50 million points. For larger inputs it streams the source +in parallel, retains the minimum Z at each deterministic 0.1 m cell centre, +and runs CSF/TIN on that reduced surface in buffered 300 m tiles. These controls +are available under **Inventory memory settings**. CSP still reads the complete +cloud because its global voxel routing and point-cloud output must preserve +upstream behavior. + +Run validation from the ``galaxytools`` repository:: + + planemo lint tools/3dtrees_csp_stand_segmentation/3dtrees_csp_stand_segmentation.xml + planemo test tools/3dtrees_csp_stand_segmentation/3dtrees_csp_stand_segmentation.xml --docker + planemo shed_lint tools/3dtrees_csp_stand_segmentation diff --git a/tools/3dtrees_csp_stand_segmentation/test-data/mikro.laz b/tools/3dtrees_csp_stand_segmentation/test-data/mikro.laz new file mode 100644 index 0000000000..37743aacaf Binary files /dev/null and b/tools/3dtrees_csp_stand_segmentation/test-data/mikro.laz differ diff --git a/tools/3dtrees_csp_stand_segmentation/test-data/mikro_aoi.geojson b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_aoi.geojson new file mode 100644 index 0000000000..399f7ea141 --- /dev/null +++ b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_aoi.geojson @@ -0,0 +1,14 @@ +{ + "type": "Feature", + "properties": {"name": "mikro-west"}, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [416948.0, 5347395.0], + [416957.0, 5347395.0], + [416957.0, 5347412.0], + [416948.0, 5347412.0], + [416948.0, 5347395.0] + ]] + } +} diff --git a/tools/3dtrees_csp_stand_segmentation/test-data/mikro_fm_species.laz b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_fm_species.laz new file mode 100644 index 0000000000..7743ee9419 Binary files /dev/null and b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_fm_species.laz differ diff --git a/tools/3dtrees_csp_stand_segmentation/test-data/mikro_seeds.tsv b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_seeds.tsv new file mode 100644 index 0000000000..a68345d94c --- /dev/null +++ b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_seeds.tsv @@ -0,0 +1,3 @@ +X Y Z TreeID +416948.12 5347399.39 1.37 1 +416965.07 5347400.74 0.88 2 diff --git a/tools/3dtrees_csp_stand_segmentation/test-data/mikro_segmented.laz b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_segmented.laz new file mode 100644 index 0000000000..82bd6c5c7f Binary files /dev/null and b/tools/3dtrees_csp_stand_segmentation/test-data/mikro_segmented.laz differ