#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
I get the following weird message: ERROR: Current region resolution
[20.00x20.00] lower than input map resolution [20.00x20.00]
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by neteler):
The code in question is in file_io.c:
{{{
if (window.ew_res < inhead.ew_res || window.ns_res < inhead.ns_res)
G_fatal_error(_("Current region resolution [%.2fx%.2f] lower than
input map resolution [%.2fx%.2f]! Needs to be at least identical or the
current region resolution lower than the input map resolution"),
window.ew_res, window.ns_res, inhead.ew_res,
inhead.ns_res);
}}}
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by hamish):
... or perhaps that 'g.region -a res=20' needs to be run in the mapset,
and the error message should use G_format_resolution() instead of %.2f
(which is unuseful for lat/lon)
what does "r.info -g input_map" and "g.region -p" say?
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by hamish):
ok so the two grids don't match (your dem map is not on multiples of 20m,
its grid is offset), and it is being resampled. what does the full r.info
say? (everything between the Type of map: and Range of data: lines)
was it a self-made DEM or did you import it from some 3rd party source?
(ie can you remake it on a cleaner grid without loss?)
also try "g.region -p rast=dem" before r.topidx so that the region and the
map perfectly align the map's (offset) grid.
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by hamish):
> G_fatal_error(_("Current region resolution [%.2fx%.2f] lower than
> input map resolution [%.2fx%.2f]! Needs to be at least identical or
> the current region resolution lower than the input map resolution"),
shouldn't that read "Needs to be at least identical or the current region
resolution '''higher''' than ..." ?
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by madi):
Replying to [comment:5 hamish]:
> ok so the two grids don't match (your dem map is not on multiples of
20m, its grid is offset), and it is being resampled. what does the full
r.info say? (everything between the Type of map: and Range of data: lines)
>
> was it a self-made DEM or did you import it from some 3rd party source?
(ie can you remake it on a cleaner grid without loss?)
>
> also try "g.region -p rast=dem" before r.topidx so that the region and
the map perfectly align the map's (offset) grid.
>
>
> Hamish
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by madi):
Replying to [comment:6 hamish]:
> > G_fatal_error(_("Current region resolution [%.2fx%.2f] lower than
> > input map resolution [%.2fx%.2f]! Needs to be at least identical or
> > the current region resolution lower than the input map resolution"),
>
> shouldn't that read "Needs to be at least identical or the current
region resolution '''higher''' than ..." ?
>
>
> Hamish
Now it works, and current region (20) is '''lower''' than dem resolution
(20.0012809).
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by hamish):
I think the old message could be confusing, the new one is
{{{
G_fatal_error(_("The current region resolution [%s x %s] is finer "
"than the input map's resolution [%s x %s]. "
"The current region resolution must be identical "
"to, or coarser than, the input map's resolution."),
}}}
with ew x ns resolution shown with G_format_resolution() instead of %.2f
which always rounds away the extra digits. Can you test and see if the new
version gives a more useful error when 'g.region res=20 -a' ?
#1597: r.topidx ERROR current region resolution
----------------------+-----------------------------------------------------
Reporter: madi | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Raster | Version: svn-develbranch6
Keywords: r.topidx | Platform: Linux
Cpu: x86-64 |
----------------------+-----------------------------------------------------
Comment(by madi):
Replying to [comment:11 hamish]:
> I think the old message could be confusing, the new one is
>
> {{{
> G_fatal_error(_("The current region resolution [%s x %s] is finer "
> "than the input map's resolution [%s x %s]. "
> "The current region resolution must be identical "
> "to, or coarser than, the input map's resolution."),
> }}}
>
> with ew x ns resolution shown with G_format_resolution() instead of %.2f
which always rounds away the extra digits. Can you test and see if the new
version gives a more useful error when 'g.region res=20 -a' ?
>
>
> thanks,
> Hamish
ERROR: The current region resolution [20 x 20] is finer than the input
map's resolution [20 x 20.0012809]. The current region resolution must be
identical to, or coarser than, the input map's resolution.