Skip to content

Refactor boundary detection to avoid cells on both sides of the shared edge are flagged as "boundary cells"#3

Open
crazyzlj wants to merge 1 commit intoswat-model:masterfrom
crazyzlj:bug_fixed_for_qswatplus
Open

Refactor boundary detection to avoid cells on both sides of the shared edge are flagged as "boundary cells"#3
crazyzlj wants to merge 1 commit intoswat-model:masterfrom
crazyzlj:bug_fixed_for_qswatplus

Conversation

@crazyzlj
Copy link

@crazyzlj crazyzlj commented Feb 2, 2026

For example, as shown in the figure below, if an HRU boundary aligns perfectly with a grid edge, the cells on both sides are flagged as 'boundary cells.' Actually, only the cell to the right (in this instance) should be classified as such. So, I recommend creating an inner boundary of the HRUs using a very small buffer (e.g., 1e-5, since the data must be with a projected coordinate system) first, and then perform the spatial join operation.

Image

…e bouuundary line with HRUs are all defined as "boundary"

Updated boundary detection logic by creating an internal boundary and adjusting spatial joins to identify true boundary cells.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant