Skip to content

Comments

Handle relative paths to STAC assets correctly#4603

Merged
hobu merged 3 commits intoPDAL:masterfrom
ibell13:stac-paths
Jan 6, 2025
Merged

Handle relative paths to STAC assets correctly#4603
hobu merged 3 commits intoPDAL:masterfrom
ibell13:stac-paths

Conversation

@ibell13
Copy link
Contributor

@ibell13 ibell13 commented Jan 1, 2025

Resolves #4594. If a path to the input Stac file was provided as test.vpc rather than ./test.vpc, StacUtils was unable to expand relative paths to the Stac item's assets. FileUtils::getDirectory() was returning / as the base directory, which got stuck on the front of the asset's relative path. Made sure HandleRelativePath() always feeds absolute paths to getDirectory().

@hobu hobu added this to the 2.8.4 milestone Jan 1, 2025
@hobu hobu added the bug label Jan 1, 2025
@hobu hobu requested a review from kylemann16 January 3, 2025 20:26
@hobu
Copy link
Member

hobu commented Jan 3, 2025

When @kylemann16 approves this we will backport it to 2.8

@kylemann16
Copy link
Member

Huh, didn't realize I overlooked this. It would be nice to have a test for this, but I don't see an easy way to inject one without mucking with the Support class.

Looks good to me though, tested the scenario from the issue.

@hobu hobu modified the milestones: 2.8.4, 2.9.0 Jan 6, 2025
@hobu hobu merged commit c1da309 into PDAL:master Jan 6, 2025
12 checks passed
@hobu
Copy link
Member

hobu commented Jan 6, 2025

The backport to 2.8-maintenance failed:

The process '/usr/bin/git' failed with exit code 128
stderr
error: commit 985a0d144c101544a0c1389b7283427be425c9f3 is a merge but no -m option was given.
fatal: cherry-pick failed

stdout
[backport-4603-to-2.8-maintenance f52d79edc] fix for stac relative paths
 Author: ibell13 <[email protected]>
 Date: Tue Dec 31 10:11:32 2024 -0600
 1 file changed, 3 insertions(+)
[backport-4603-to-2.8-maintenance b73578f70] handleRelativePath - return earlier if absolute
 Author: ibell13 <[email protected]>
 Date: Tue Dec 31 11:24:29 2024 -0600
 1 file changed, 4 insertions(+), 2 deletions(-)

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.8-maintenance 2.8-maintenance
# Navigate to the new working tree
cd .worktrees/backport-2.8-maintenance
# Create a new branch
git switch --create backport-4603-to-2.8-maintenance
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 36ac574be24ca1223ba3bd473e7953dd58e390a1,4b8605e4633480cc715e194a8a794a155bd6ec9a,985a0d144c101544a0c1389b7283427be425c9f3
# Push it to GitHub
git push --set-upstream origin backport-4603-to-2.8-maintenance
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.8-maintenance

Then, create a pull request where the base branch is 2.8-maintenance and the compare/head branch is backport-4603-to-2.8-maintenance.

hobu pushed a commit that referenced this pull request Jan 6, 2025
* fix for stac relative paths

* handleRelativePath - return earlier if absolute
@hobu
Copy link
Member

hobu commented Jan 6, 2025

picked back to 2.8-maintenance at 00cf41a

@hobu hobu modified the milestones: 2.9.0, 2.8.4 Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDAL not able to open VPC files created by PDAL_Wrench

3 participants