Repository navigation
Add 3dtrees_trajectory 1.0.0 (trajectory estimation and occlusion mapping) #2137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bc36c0e
feat(trajectory): add Galaxy tool wrapper
kgerb df3ce32
fix(trajectory): exit_code errors, shorter help, creator and citations
kgerb ed76c7f
Apply suggestion from @bgruening
bgruening f7917f8
fix(trajectory): count delivered paths from 1, cite Karney by DOI
kgerb df486df
Merge branch 'master' into 3dtrees_trajectory
kgerb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: 3dtrees_trajectory | ||
| owner: bgruening | ||
| description: Estimate a lidar sensor trajectory and map occlusion from standardized point clouds. | ||
| homepage_url: https://github.com/3dtrees-earth/3dtrees_trajectory | ||
| long_description: | | ||
| Estimates a flight or walking path from standardized airborne or mobile | ||
| lidar and maps occlusion from the estimated path or a delivered trajectory. | ||
| remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools/3dtrees_trajectory | ||
| type: unrestricted | ||
| categories: | ||
| - Geo Science |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| <tool id="3dtrees_trajectory" name="3Dtrees: Trajectory and Occlusion" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.2"> | ||
| <description>estimate a lidar sensor path and map occlusion</description> | ||
| <macros> | ||
| <token name="@TOOL_VERSION@">1.0.0</token> | ||
| <token name="@VERSION_SUFFIX@">0</token> | ||
| </macros> | ||
| <requirements> | ||
| <container type="docker">ghcr.io/3dtrees-earth/3dtrees_trajectory:@TOOL_VERSION@</container> | ||
| </requirements> | ||
| <version_command>python /src/run.py --version</version_command> | ||
| <command detect_errors="exit_code"><![CDATA[ | ||
| #if $delivered_trajectory | ||
| #for $i, $path in enumerate($delivered_trajectory) | ||
| ln -s '$path' 'path_${i + 1}.csv' && | ||
| #end for | ||
| #end if | ||
| python /src/run.py | ||
| #for $cloud in $point_cloud | ||
| '$cloud' | ||
| #end for | ||
| -o trajectory.csv | ||
| --occlusion-copc occlusion.copc.laz | ||
| --occlusion-cog occlusion.tif | ||
| #if $dtm | ||
| --dtm '$dtm' | ||
| #end if | ||
| #if $delivered_trajectory | ||
| --trajectory | ||
| #for $i, $path in enumerate($delivered_trajectory) | ||
|
kgerb marked this conversation as resolved.
Resolved
|
||
| 'path_${i + 1}.csv' | ||
| #end for | ||
| #end if | ||
| --voxel $voxel | ||
| --interval $interval | ||
| $full | ||
| --threads "\${GALAXY_SLOTS:-10}" | ||
| ]]></command> | ||
| <inputs> | ||
| <param name="point_cloud" type="data" format="las,laz" multiple="true" label="Standardized LAS/LAZ point cloud" help="Select one dataset or a list from the same acquisition in collection order."/> | ||
| <param argument="--dtm" type="data" format="tiff" optional="true" label="Digital terrain model" help="Select a GeoTIFF in the point cloud's CRS. Without it, ground height is estimated from the lowest returns."/> | ||
| <param name="delivered_trajectory" argument="--trajectory" type="data" format="csv,tabular" multiple="true" optional="true" label="Delivered trajectories" help="One or more comma-separated 3Dtrees trajectories with time,x,y,z. Occlusion uses these positions when supplied."/> | ||
| <param argument="--voxel" type="float" value="0.5" min="0.25" max="2" label="Voxel size (m)" help="Occlusion voxel edge and COG height-band step. Smaller voxels need much more memory and time (0.25 m is about 8 times the grid of 0.5 m)."/> | ||
| <param argument="--interval" type="float" value="0.5" min="0.1" max="5" label="Path sampling interval (s)" help="Seconds between estimated path positions."/> | ||
| <param argument="--full" type="boolean" truevalue="--full" falsevalue="--sample" checked="true" label="Use all pulses" help="Fit the path from every pulse (default), streamed with bounded memory. Uncheck to fit from a sample of about 40 million pulses."/> | ||
| </inputs> | ||
| <outputs> | ||
| <data name="trajectory_csv" format="csv" from_work_dir="trajectory.csv" label="${tool.name} on ${on_string}: Trajectory CSV"/> | ||
| <data name="occlusion_copc" format="laz" from_work_dir="occlusion.copc.laz" label="${tool.name} on ${on_string}: Occlusion COPC"/> | ||
| <data name="occlusion_cog" format="tiff" from_work_dir="occlusion.tif" label="${tool.name} on ${on_string}: Occlusion COG"/> | ||
| </outputs> | ||
| <tests> | ||
| <test expect_num_outputs="3"> | ||
| <param name="point_cloud" value="mikro.laz" ftype="laz"/> | ||
| <output name="trajectory_csv" ftype="csv"> | ||
| <assert_contents> | ||
| <has_line line="# format: 3dtrees-trajectory/estimated"/> | ||
| <has_line line="# crs: EPSG:32632"/> | ||
| <has_line line="# method: scan_angle"/> | ||
| <has_line line="# quality: rough"/> | ||
| <has_line line="time,x,y,z,roll,pitch,yaw,name"/> | ||
| <has_line line="439113281.631579,416921.3332,5347368.2164,534.2064,,,,"/> | ||
| <has_line line="439113288.779648,416963.6009,5347360.0818,523.3352,,,,"/> | ||
| <has_n_lines n="31"/> | ||
| <has_n_columns n="8" sep="," comment="#"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_copc" ftype="laz"> | ||
| <assert_contents> | ||
| <has_size value="42449" delta="4000"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_cog" ftype="tiff"> | ||
| <assert_contents> | ||
| <has_size value="92209" delta="9000"/> | ||
| </assert_contents> | ||
| </output> | ||
| </test> | ||
| <test expect_num_outputs="3"> | ||
| <param name="point_cloud" value="mikro_part1.laz,mikro_part2.laz" ftype="laz"/> | ||
| <param name="dtm" value="mikro_dtm.tif" ftype="tiff"/> | ||
| <param name="delivered_trajectory" value="mikro_delivered.csv" ftype="csv"/> | ||
| <output name="trajectory_csv" ftype="csv"> | ||
| <assert_contents> | ||
| <has_line line="# crs: EPSG:32632"/> | ||
| <has_line line="# delivered_path_files: 1"/> | ||
| <has_line line="# delivered_path_coverage: 0.9795"/> | ||
| <has_line line="# delivered_path_miss_flag: true"/> | ||
| <has_line line="439113281.631579,416921.3332,5347368.2164,534.2064,,,,"/> | ||
| <has_n_lines n="35"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_copc" ftype="laz"> | ||
| <assert_contents> | ||
| <has_size value="57256" delta="5000"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_cog" ftype="tiff"> | ||
| <assert_contents> | ||
| <has_size value="94122" delta="9000"/> | ||
| </assert_contents> | ||
| </output> | ||
| </test> | ||
| <test expect_num_outputs="3"> | ||
| <param name="point_cloud" value="mikro.laz" ftype="laz"/> | ||
| <param name="voxel" value="1.0"/> | ||
| <param name="interval" value="1.0"/> | ||
| <param name="full" value="false"/> | ||
| <output name="trajectory_csv" ftype="csv"> | ||
| <assert_contents> | ||
| <has_line line="439113281.522253,416920.6645,5347367.9305,534.7074,,,,"/> | ||
| <has_line line="439113289.321535,416967.6024,5347355.5529,527.3675,,,,"/> | ||
| <has_n_lines n="24"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_copc" ftype="laz"> | ||
| <assert_contents> | ||
| <has_size value="17854" delta="2000"/> | ||
| </assert_contents> | ||
| </output> | ||
| <output name="occlusion_cog" ftype="tiff"> | ||
| <assert_contents> | ||
| <has_size value="44269" delta="4500"/> | ||
| </assert_contents> | ||
| </output> | ||
| </test> | ||
| </tests> | ||
| <help><![CDATA[ | ||
| Estimate the flight or walking path of a moving lidar scanner (ULS or MLS). | ||
| Use the standardized LAS/LAZ files from one acquisition, in collection order. | ||
| All files must share the same metric coordinates and GPS clock. Preserve | ||
| GPS time, return metadata, scan angles, point sources and scanner channels. | ||
| The tool fits a path from multi-return pulse lines or usable scan angles. | ||
| Single-return data without usable scan angles needs a delivered moving path. | ||
|
|
||
| An optional digital terrain model (e.g. the 3Dtrees Raster DTM) sets the ground. | ||
| It may have no CRS; nodata and uncovered cells use the lowest-hit ground estimate. | ||
| A delivered path may be in any EPSG CRS and is converted to the point cloud's CRS; | ||
| "local" in its header or in the outputs means the point cloud's own coordinates. | ||
| One or more delivered paths may be given; each part of the cloud uses the path | ||
| that covers its time and fits best. | ||
| Both occlusion outputs use 0.5 m voxels by default. | ||
|
|
||
| **Outputs** | ||
|
|
||
| - **Trajectory CSV** with estimated positions, their GPS times and quality metadata. | ||
| - **Occlusion COPC** with voxel classes, traversal counts and height above ground. | ||
| - **Occlusion COG** with the occluded fraction by height band and an unobserved-column band. | ||
|
|
||
| With a delivered path, the tool uses it for occlusion and still tries to | ||
| estimate the trajectory outputs. Those outputs can be empty if fitting fails. | ||
| If occlusion cannot run (for example on a COPC instead of the standardized | ||
| LAS/LAZ, or a delivered path that covers too little of the flight), the job | ||
| fails with the reason. | ||
|
|
||
| Details, exit codes and resources: https://github.com/3dTrees-earth/3dtrees_trajectory | ||
| ]]></help> | ||
| <creator> | ||
| <person name="Kilian Gerberding" url="https://orcid.org/0009-0002-5001-2571"/> | ||
| <organization name="3Dtrees-Team, University of Freiburg" url="https://github.com/3dTrees-earth"/> | ||
| </creator> | ||
| <citations> | ||
| <citation type="bibtex"> | ||
| @misc{3dtrees_trajectory, title = {3Dtrees: Trajectory}, author = {3Dtrees-Project}, year = {2026}, url = {https://github.com/3dTrees-earth/3dtrees_trajectory}} | ||
| </citation> | ||
| <citation type="doi">10.1016/j.rse.2016.10.023</citation> | ||
| <citation type="doi">10.3390/rs11192258</citation> | ||
| <citation type="bibtex"> | ||
| @misc{karney2022trajectory, author = {Karney, Charles F. F.}, title = {Sensor trajectory estimation by triangulating lidar returns}, year = {2022}, eprint = {2208.12116}, archivePrefix = {arXiv}, url = {https://arxiv.org/abs/2208.12116}} | ||
|
kgerb marked this conversation as resolved.
Resolved
|
||
| </citation> | ||
| </citations> | ||
| </tool> | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # format: 3dtrees-trajectory/1 | ||
| # crs: EPSG:32632 | ||
| # vertical_crs: unknown | ||
| # time_system: gps_sow | ||
| # gps_week: unknown | ||
| time,x,y,z | ||
| 439113281.631579,416921.3332,5347368.2164,534.2064 | ||
| 439113282.193037,416925.6916,5347369.0537,530.9626 | ||
| 439113282.762160,416926.7844,5347361.6543,540.4820 | ||
| 439113283.285525,416930.0696,5347362.4902,538.0745 | ||
| 439113283.809468,416935.2950,5347363.8272,533.5628 | ||
| 439113284.312444,416936.9307,5347362.0613,535.7046 | ||
| 439113284.802986,416939.5002,5347361.0556,535.9763 | ||
| 439113285.217357,416942.1496,5347361.3069,534.3264 | ||
| 439113285.730468,416941.4181,5347440.6005,545.8830 | ||
| 439113286.218921,416946.3036,5347448.9436,555.5854 | ||
| 439113286.709215,416960.6096,5347431.1403,526.1040 | ||
| 439113287.254766,416955.9663,5347357.9952,533.0096 | ||
| 439113287.773837,416959.1738,5347359.5234,528.8955 | ||
| 439113288.276586,416961.7993,5347358.3803,528.6405 | ||
| 439113288.779648,416963.6009,5347360.0818,523.3352 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.