Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] r.mapcalc.tiled creates no-data rows at tile borders, when using default patch_backend option #2678

Closed
linakrisztian opened this issue Dec 2, 2022 · 1 comment · Fixed by #2736
Labels
bug Something isn't working
Milestone

Comments

@linakrisztian
Copy link

Name of the addon
r.mapcalc.tiled

Describe the bug
When using r.mapcalc.tiled with the default patch option patch_backend="RasterRow" rows of no-data occur at tile borders.
When using patch_backend="r.patch" non of these no-data rows occur.

To Reproduce
Steps to reproduce the behavior:

  1. create GRASS location with EPSG:25832
  2. import provided test data: r.import input=/path/to/testmap_zeros.tif output=testmap_zeros
  3. set region: g.region raster=testmap_zeros
  4. use r.mapcalc.tiled with default patch option: r.mapcalc.tiled expression="patch_RasterRow=testmap_zeros+1" nprocs=10 patch_backend="RasterRow"
  5. for comparison: use r.mapcalc.tiled with r.patch option: r.mapcalc.tiled expression="patch_rpatch=testmap_zeros+1" nprocs=10 patch_backend="r.patch"
  6. zoom to & check tile borders: patch_RasterRow include data-gap rows at tile borders; patch_rpatch does not include data-gap rows at tile borders

Expected behavior
Default patch option should not create no-data rows at tile borders

Screenshots
patch_RasterRow__data_gap_zoomed
patch_rpatch__no_data_gaps_zoomed
On the screenshots, you can see a zoomed section of the maps produced in step 4. and 5. The map created with default patch option (patch_RasterRow) contains the no-data rows.

System description (please complete the following information):

  • Operating System: Linux Mint 20.3 Cinnamon
  • GRASS GIS version: GRASS 8.3.dev

Additional context
grass_example.zip

@linakrisztian linakrisztian changed the title [Bug] [Bug] r.mapcalc.tiled creates no-data rows at tile borders, when using default patch_backend option Dec 2, 2022
@neteler neteler added the bug Something isn't working label Dec 2, 2022
@petrasovaa
Copy link
Contributor

This is a problem in GridModule, specifically it seems some kind of floating point issue related to computing row number from north:
https://github.com/OSGeo/grass/blob/main/python/grass/pygrass/utils.py#L194

@petrasovaa petrasovaa transferred this issue from OSGeo/grass-addons Dec 2, 2022
petrasovaa added a commit that referenced this issue Feb 16, 2023
Fixes #2678 by avoiding unnecessary nsew <-> row,col conversions
@neteler neteler added this to the 8.3.0 milestone Feb 16, 2023
ninsbl pushed a commit to ninsbl/grass that referenced this issue Feb 17, 2023
Fixes OSGeo#2678 by avoiding unnecessary nsew <-> row,col conversions
petrasovaa added a commit that referenced this issue May 11, 2023
Fixes #2678 by avoiding unnecessary nsew <-> row,col conversions
neteler pushed a commit to nilason/grass that referenced this issue Nov 7, 2023
Fixes OSGeo#2678 by avoiding unnecessary nsew <-> row,col conversions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants