Skip to content

Remove inline ArcPy compression and add GDAL backfill tool#9

Open
erin-glen wants to merge 3 commits intopreprocessing/disturbancesfrom
codex/remove-compression-settings-from-scripts
Open

Remove inline ArcPy compression and add GDAL backfill tool#9
erin-glen wants to merge 3 commits intopreprocessing/disturbancesfrom
codex/remove-compression-settings-from-scripts

Conversation

@erin-glen
Copy link
Owner

Summary

  • remove the inline LZW compression context from ArcPy raster export helpers
  • update documentation to reflect uncompressed outputs
  • add a GDAL-based utility for retroactive compression of existing disturbance rasters

Testing

  • python -m py_compile gdal_compress_outputs.py

https://chatgpt.com/codex/tasks/task_e_68fd10b0ab3c8320bfb3571a75ad8a88

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +62 to +63
with tempfile.NamedTemporaryFile(dir=directory, prefix=f".{base}", suffix=".tmp.tif", delete=False) as tmp:
tmp_path = tmp.name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve permissions when overwriting rasters

When compressing with --overwrite, the raster is rewritten via NamedTemporaryFile and os.replace. Temporary files are created with mode 0o600, and os.replace brings those restrictive permissions along. Any raster that originally had broader read permissions (e.g., shared data at 0644) will become owner‑only after compression, breaking downstream access for other users or services. Consider copying the original file’s mode to the temporary output before replacing, or using shutil.copymode so that compression doesn’t silently revoke access.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant