Enhanced node determination in grdmask for polygon input#6289
Merged
PaulWessel merged 6 commits intomasterfrom Feb 1, 2022
Merged
Enhanced node determination in grdmask for polygon input#6289PaulWessel merged 6 commits intomasterfrom
PaulWessel merged 6 commits intomasterfrom
Conversation
Member
|
I think this sentence in the module description should be updated to acknowledge the option to have more values in the output grid with -Nz:
|
Member
Author
|
OK, made a change. |
maxrjones
approved these changes
Jan 31, 2022
maxrjones
reviewed
Feb 8, 2022
| /* Here we will have to consider the x coordinates as well (or known_side is set) */ | ||
| #ifdef _OPENMP | ||
| #pragma omp parallel for private(col,xx,side,ij) shared(n_columns,GMT,Grid,do_test,yy,S,known_side,row,Ctrl,z_value,mask_val) | ||
| #pragma omp parallel for private(col,ij,xx,side,z_to_set) shared(n_columns,Grid,row,Ctrl,node_is_set,GMT,do_test,yy,S,known_side,z_value,mask_val) |
Member
There was a problem hiding this comment.
The new test maskmode.sh fails on Linux when OpenMP support enabled. I have not checked if it's the same on macOS, but I would assume so. There's also a compiler warning that z_to_set may be uninitialized. @PaulWessel do you notice anything obvious wrong with the OpenMP implementation here? Otherwise I can debug.
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.
This PR adds a new -Cmode option to grdmask, more or less the same -C option offered in grdblend. There, it controls which grids contribute to the final output node (instead of blending, a single grid's node will prevail) while here it selects the single polygon whose z-value sets the node. The -C option determines which polygon:
The actual z-value is controlled by -N. With default -Co we retain backwards compatibility while other modes offer new capabilities. A new script (maskmode.sh based on ogrtest.sh) was added which shows the output for the 4 different modes. I used awk to shuffle some polygon z-values so that the effect of all modes can be seen: