Use a safe weed-detection buffer default - #250
Open
Renato L. de F. Cunha (renatolfc) wants to merge 1 commit into
Open
Use a safe weed-detection buffer default#250Renato L. de F. Cunha (renatolfc) wants to merge 1 commit into
Renato L. de F. Cunha (renatolfc) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Renato L. de F. Cunha (renatolfc)
August 22, 2026 18:46
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the weed-detection op’s default boundary buffering to be safe for geographic (WGS84) rasters, avoiding negative-degree buffering that can collapse geometries and break rasterization. This aligns the op’s defaults with the intent that buffers are meaningful primarily in projected CRS units.
Changes:
- Change the weed-detection op default
bufferfrom-50to0. - Add a pre-rasterization validation step that rejects buffers producing empty/invalid geometries in the raster CRS.
- Add a focused WGS84 regression test covering the new default and the invalid-buffer rejection path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ops/weed_detection/weed_detection.yaml | Updates the default buffer parameter to 0 to avoid unsafe behavior in geographic CRS. |
| ops/weed_detection/weed_detection.py | Validates buffered geometry before rasterization and reuses the buffered geometry for mask generation. |
| ops/weed_detection/test_weed_detection.py | Adds regression coverage for WGS84 default buffer behavior and invalid-buffer error handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Weed detection defaults
bufferto-50in raster CRS units. For the WGS84 raster attached to #139, that means negative 50 degrees and collapses the boundary before rasterization.This PR makes the generic default zero while preserving explicit projected-unit buffers. It also rejects a buffer that creates empty or invalid geometry before rasterization. A focused WGS84 regression covers both paths.
Closes #139.