[GRASS-dev] r.resample.rst behavior does not match manual

The r.resample.rst manual states…

" Reinterpolation (resampling) is done to higher, same or lower resolution specified by the ew_res and ns_res parameters.”

The very next sentence states…

"All resulting raster maps are created using the settings of the current region (which may be different from that of the input raster map).”

So these two sentences contradict each other.

Additionally, I’ve got a 90m DEM that I want to resample to 30m. I’ve reset the region resolution to 30m. This is exactly the situation listed in the second sentence. Yet r.resample.rst gives the error:

“ERROR: Input map resolution differs from current region resolution!”

So what is the proper way to use this module? Whatever it is, the manual needs to be corrected.

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)

www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

Hi Michael,

The second sentence you cite from the manual seems indeed a bit imprecise.

It should probably say something like:

“The extent of all resulting raster maps is taken from the settings of the current region (which may be different from the extent of the input raster map). The resolution of the current region however has to follow cleanly the resolution of the input map”

Yet, the example in the manual is correct. It might be modified in order to highlight the module behavior named above by exchanging the first g.region command by something like:

g.region n= s= e= w= align=elevation.dem -p

(I do not have the sample data available, so I cannot guess reasonable extent values or another raster or vector map with a smaller extent)…

Cheers

Stefan

···

From: grass-dev-bounces@lists.osgeo.org [mailto:grass-dev-bounces@lists.osgeo.org] On Behalf Of Michael Barton
Sent: 30. august 2015 04:03
To: GRASS developers grass-developers grass-dev@lists.osgeo.org
Subject: [GRASS-dev] r.resample.rst behavior does not match manual

The r.resample.rst manual states…

" Reinterpolation (resampling) is done to higher, same or lower resolution specified by the ew_res and ns_res parameters.”

The very next sentence states…

"All resulting raster maps are created using the settings of the current region (which may be different from that of the input raster map).”

So these two sentences contradict each other.

Additionally, I’ve got a 90m DEM that I want to resample to 30m. I’ve reset the region resolution to 30m. This is exactly the situation listed in the second sentence. Yet r.resample.rst gives the error:

“ERROR: Input map resolution differs from current region resolution!”

So what is the proper way to use this module? Whatever it is, the manual needs to be corrected.

Michael


C. Michael Barton

Director, Center for Social Dynamics & Complexity

Professor of Anthropology, School of Human Evolution & Social Change

Head, Graduate Faculty in Complex Adaptive Systems Science

Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)

www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

Thanks for the clarification Stefan.

It sounds like, unlike other resampling commands (unless they, too, are in error), r.resample.rst needs to be run at the resolution of the original map, not the output map. The output resolution will be determined by the command, not by the region settings. This should go into the manual too, along with the revised text you suggested.

In a somewhat related question, do you have any idea how r.resample.filter works? The manual is not very informative and I couldn’t get any useful downscaling results (lower to higher resolution) with my spot tests.

r.resample.interp doesn’t seem to give expected results either. I’ll do a test with demo data when I have a few minutes this week. I did get very good downscaling results with r.resample.bspline, but it took a very long time.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Aug 30, 2015, at 12:54 AM, Blumentrath, Stefan <Stefan.Blumentrath@nina.no<mailto:Stefan.Blumentrath@nina.no>> wrote:

Hi Michael,

The second sentence you cite from the manual seems indeed a bit imprecise.
It should probably say something like:
“The extent of all resulting raster maps is taken from the settings of the current region (which may be different from the extent of the input raster map). The resolution of the current region however has to follow cleanly the resolution of the input map”

Yet, the example in the manual is correct. It might be modified in order to highlight the module behavior named above by exchanging the first g.region command by something like:

g.region n= s= e= w= align=elevation.dem -p
(I do not have the sample data available, so I cannot guess reasonable extent values or another raster or vector map with a smaller extent)…

Cheers
Stefan

From: grass-dev-bounces@lists.osgeo.org<mailto:grass-dev-bounces@lists.osgeo.org> [mailto:grass-dev-bounces@lists.osgeo.org] On Behalf Of Michael Barton
Sent: 30. august 2015 04:03
To: GRASS developers grass-developers <grass-dev@lists.osgeo.org<mailto:grass-dev@lists.osgeo.org>>
Subject: [GRASS-dev] r.resample.rst behavior does not match manual

The r.resample.rst manual states…

" Reinterpolation (resampling) is done to higher, same or lower resolution specified by the ew_res and ns_res parameters.”

The very next sentence states...

"All resulting raster maps are created using the settings of the current region (which may be different from that of the input raster map).”

So these two sentences contradict each other.

Additionally, I’ve got a 90m DEM that I want to resample to 30m. I’ve reset the region resolution to 30m. This is exactly the situation listed in the second sentence. Yet r.resample.rst gives the error:

"ERROR: Input map resolution differs from current region resolution!"

So what is the proper way to use this module? Whatever it is, the manual needs to be corrected.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, Center for Social Dynamics and Complexity;

On Mon, Aug 31, 2015 at 1:55 AM, Michael Barton <Michael.Barton@asu.edu> wrote:

Thanks for the clarification Stefan.

It sounds like, unlike other resampling commands (unless they, too, are in
error), r.resample.rst needs to be run at the resolution of the original
map, not the output map.

Yes. It has been implemented like that (not sure if there is any
technical reason), yet going a bit against the "normal" workflow.

The output resolution will be determined by the
command, not by the region settings. This should go into the manual too,
along with the revised text you suggested.

Stefan, Michael, please send a text snipped to me for the manual.

In a somewhat related question, do you have any idea how r.resample.filter
works? The manual is not very informative

True - thanks to my long term inbox I found material here
https://trac.osgeo.org/grass/ticket/1401#comment:8

and merged it into the manual page:
https://grass.osgeo.org/grass70/manuals/r.resamp.filter.html
https://grass.osgeo.org/grass71/manuals/r.resamp.filter.html

(please revise as needed).

and I couldn’t get any useful
downscaling results (lower to higher resolution) with my spot tests.

Adding some examples there would be important.

r.resample.interp doesn’t seem to give expected results either. I’ll do a
test with demo data when I have a few minutes this week. I did get very good
downscaling results with r.resample.bspline, but it took a very long time.

Perhaps time to expand
https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_finer_resolution
?

Markus

On Sun, Sep 6, 2015 at 3:26 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Aug 31, 2015 at 1:55 AM, Michael Barton <Michael.Barton@asu.edu>
wrote:
> Thanks for the clarification Stefan.
>
> It sounds like, unlike other resampling commands (unless they, too, are
in
> error), r.resample.rst needs to be run at the resolution of the original
> map, not the output map.

Yes. It has been implemented like that (not sure if there is any
technical reason), yet going a bit against the "normal" workflow.

This seems indeed to go totally against the normal work flow. If not for a
technical reason, would it be possible / desirable changing this?

> The output resolution will be determined by the
> command, not by the region settings. This should go into the manual too,
> along with the revised text you suggested.

Stefan, Michael, please send a text snipped to me for the manual.

> In a somewhat related question, do you have any idea how
r.resample.filter
> works? The manual is not very informative

True - thanks to my long term inbox I found material here
https://trac.osgeo.org/grass/ticket/1401#comment:8

and merged it into the manual page:
https://grass.osgeo.org/grass70/manuals/r.resamp.filter.html
https://grass.osgeo.org/grass71/manuals/r.resamp.filter.html

(please revise as needed).

> and I couldn’t get any useful
> downscaling results (lower to higher resolution) with my spot tests.

Adding some examples there would be important.

> r.resample.interp doesn’t seem to give expected results either. I’ll do a
> test with demo data when I have a few minutes this week. I did get very
good
> downscaling results with r.resample.bspline, but it took a very long
time.

Perhaps time to expand

https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_finer_resolution
?

Markus
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Thanks for all the responses and fixes. I should have some time in the next week to look at these.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Sep 6, 2015, at 6:26 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Aug 31, 2015 at 1:55 AM, Michael Barton <Michael.Barton@asu.edu> wrote:

Thanks for the clarification Stefan.

It sounds like, unlike other resampling commands (unless they, too, are in
error), r.resample.rst needs to be run at the resolution of the original
map, not the output map.

Yes. It has been implemented like that (not sure if there is any
technical reason), yet going a bit against the "normal" workflow.

The output resolution will be determined by the
command, not by the region settings. This should go into the manual too,
along with the revised text you suggested.

Stefan, Michael, please send a text snipped to me for the manual.

In a somewhat related question, do you have any idea how r.resample.filter
works? The manual is not very informative

True - thanks to my long term inbox I found material here
#1401 (r.series for time series) – GRASS GIS

and merged it into the manual page:
r.resamp.filter - GRASS GIS manual
r.resamp.filter - GRASS GIS manual

(please revise as needed).

and I couldn’t get any useful
downscaling results (lower to higher resolution) with my spot tests.

Adding some examples there would be important.

r.resample.interp doesn’t seem to give expected results either. I’ll do a
test with demo data when I have a few minutes this week. I did get very good
downscaling results with r.resample.bspline, but it took a very long time.

Perhaps time to expand
Interpolation - GRASS-Wiki
?

Markus

On Sun, Sep 6, 2015 at 1:01 PM, Michael Barton <Michael.Barton@asu.edu>
wrote:

Thanks for all the responses and fixes. I should have some time in the
next week to look at these.

Please see also my comments in "r.in.lidar: height aboveground" where I say:

r.resamp.rst should honor the resolution of the data since we are
resampling from that resolution or at least it should have a flag for it.
Similarly to r.in.lidar, we often want to resample to match some existing
raster which we can only do using region.

Does somebody think my idea is worth creating a patch? Did somebody looked
to the source code already?

Best,
Vaclav

https://lists.osgeo.org/pipermail/grass-dev/2015-September/076188.html

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

> On Sep 6, 2015, at 6:26 AM, Markus Neteler <neteler@osgeo.org> wrote:
>
> On Mon, Aug 31, 2015 at 1:55 AM, Michael Barton <Michael.Barton@asu.edu>
wrote:
>> Thanks for the clarification Stefan.
>>
>> It sounds like, unlike other resampling commands (unless they, too, are
in
>> error), r.resample.rst needs to be run at the resolution of the original
>> map, not the output map.
>
> Yes. It has been implemented like that (not sure if there is any
> technical reason), yet going a bit against the "normal" workflow.
>
>> The output resolution will be determined by the
>> command, not by the region settings. This should go into the manual too,
>> along with the revised text you suggested.
>
> Stefan, Michael, please send a text snipped to me for the manual.
>
>> In a somewhat related question, do you have any idea how
r.resample.filter
>> works? The manual is not very informative
>
> True - thanks to my long term inbox I found material here
> https://trac.osgeo.org/grass/ticket/1401#comment:8
>
> and merged it into the manual page:
> https://grass.osgeo.org/grass70/manuals/r.resamp.filter.html
> https://grass.osgeo.org/grass71/manuals/r.resamp.filter.html
>
> (please revise as needed).
>
>> and I couldn’t get any useful
>> downscaling results (lower to higher resolution) with my spot tests.
>
> Adding some examples there would be important.
>
>> r.resample.interp doesn’t seem to give expected results either. I’ll do
a
>> test with demo data when I have a few minutes this week. I did get very
good
>> downscaling results with r.resample.bspline, but it took a very long
time.
>
> Perhaps time to expand
>
https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_finer_resolution
> ?
>
> Markus

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Sun, Aug 30, 2015 at 9:54 AM, Blumentrath, Stefan
<Stefan.Blumentrath@nina.no> wrote:

Hi Michael,

The second sentence you cite from the manual seems indeed a bit imprecise.

It should probably say something like:

“The extent of all resulting raster maps is taken from the settings of the
current region (which may be different from the extent of the input raster
map). The resolution of the current region however has to follow cleanly the
resolution of the input map”

I have added a modified version of above suggestion to the manual in
https://trac.osgeo.org/grass/changeset/66163

Further improvements are always welcome.

Markus