Skip to content

Comments

raster: Work with any mask name (r.surf.contour, r.random.cells, r.random.surface)#4634

Merged
wenzeslaus merged 1 commit intoOSGeo:mainfrom
wenzeslaus:general-mask-name-for-surface-random
Nov 6, 2024
Merged

raster: Work with any mask name (r.surf.contour, r.random.cells, r.random.surface)#4634
wenzeslaus merged 1 commit intoOSGeo:mainfrom
wenzeslaus:general-mask-name-for-surface-random

Conversation

@wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Nov 1, 2024

Use Rast_mask_status instead of hardcoded name MASK for r.surf.contour, r.random.cells, and r.random.surface. Raster mask if present, is loaded in a special way in these tools. After this change, the name of the mask is retrieved from the library (that's the important part) and the library is at the same time used to test the presence of the mask (as opposed to testing presence of raster directly, but that's just more convenient rather than conceptual).

The change in r.random.surface code switching the if and else branches is to make it easier to write and more consistent with the other two.

@github-actions github-actions bot added raster Related to raster data processing C Related code is in C module labels Nov 1, 2024
@petrasovaa petrasovaa added this to the 8.5.0 milestone Nov 6, 2024
@wenzeslaus wenzeslaus merged commit 54d613f into OSGeo:main Nov 6, 2024
@wenzeslaus wenzeslaus deleted the general-mask-name-for-surface-random branch November 6, 2024 22:04
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Nov 11, 2024
…ndom.surface) (OSGeo#4634)

Use Rast_mask_status instead of hardcoded name MASK for r.surf.contour, r.random.cells, and r.random.surface. Raster mask if present, is loaded in a special way in these tools. After this change, the name of the mask is retrieved from the library (that's the important part) and the library is at the same time used to test the presence of the mask (as opposed to testing presence of raster directly, but that's just more convenient rather than conceptual).

The change in r.random.surface code switching the if and else branches is to make it easier to write and more consistent with the other two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module raster Related to raster data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants