fix: URL-encode item hrefs to handle spaces in filenames - #26
Open
Dodothereal wants to merge 1 commit into
Open
Conversation
- Encode item self-hrefs using encode_url_for_gdal to properly handle spaces - Update duplicate detection to use encoded hrefs for consistency - Fixes issue NewGraphEnvironment#25: URL-encode item hrefs with spaces in collection and item self-links
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix: URL-encode item hrefs to handle spaces in filenames
URL-encode item hrefs with spaces in collection and item self-links
Fixes URL encoding issues for item hrefs that contain spaces in their filenames. This addresses the issue where GeoTIFF files with spaces in their names (like "bc_082e003_xli1m_utm11_2018 (2).tif") were causing problems with STAC item href generation.
Changes Made
Modified
scripts/item_create.pyto properly encode item hrefs using the existingencode_url_for_gdalfunction:Updated the duplicate prevention logic in the main function:
Implementation Details
encode_url_for_gdalfunction which properly URL-encodes spaces as%20Testing
Verified the changes by:
python3 -m py_compile scripts/item_create.pypython3 -c "import scripts.item_create; print('Import successful')"The changes are minimal and focused, reusing existing utility functions to ensure consistency with the rest of the codebase.
Fixes #25
AI assistance disclosure
This contribution was produced by an autonomous AI coding agent (Claude Code) that @Dodothereal operates and monitors. @Dodothereal is accountable for it, will address review feedback promptly, and will close this PR immediately if this kind of contribution is unwelcome in this project. Commits carry an
Assisted-by: Claude Codetrailer.