[GRASS-user] fine to coarse resolution

Hello all,
I have rasters in a fine resolution, with values of 1 and null. I need to create, in a coarser resolution, new rasters where each cell gets the total number of non-null pixels from the fine resolution raster that are within the coarse pixel.

The clunky method I worked out uses r.out.xyz and r.in.xyz. Starting in the fine resolution, I export all (non-null) cell locations with r.out.xyz. Then I switch to the coarse resolution and do r.in.xyz with method=n. Seems to work, but is there anything better, more elegant?

Thanks,
Micha

···

Micha Silver
Arava Drainage Authority
+972-523-665918

You can use r.resamp.stats with aggregation method the sum

Paulo

···

On 15-04-16 09:02, Micha Silver wrote:

Hello all,
I have rasters in a fine resolution, with values of 1 and null. I need to create, in a coarser resolution, new rasters where each cell gets the total number of non-null pixels from the fine resolution raster that are within the coarse pixel.

The clunky method I worked out uses r.out.xyz and r.in.xyz. Starting in the fine resolution, I export all (non-null) cell locations with r.out.xyz. Then I switch to the coarse resolution and do r.in.xyz with method=n. Seems to work, but is there anything better, more elegant?

Thanks,
Micha

Micha Silver
Arava Drainage Authority
+972-523-665918

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

On Fri, Apr 15, 2016 at 9:20 AM, Paulo van Breugel
<p.vanbreugel@gmail.com> wrote:

You can use r.resamp.stats with aggregation method the sum

Yes - for details see also

https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_coarser_resolution

Markus

--
Markus Neteler
http://www.mundialis.de - free data with free software
http://courses.neteler.org/blog/

Thanks, I missed that.

···

On 04/15/2016 11:23 AM, Markus Neteler wrote:

On Fri, Apr 15, 2016 at 9:20 AM, Paulo van Breugel
[<p.vanbreugel@gmail.com>](mailto:p.vanbreugel@gmail.com) wrote:

You can use r.resamp.stats with aggregation method the sum

Yes - for details see also

[https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_coarser_resolution](https://grasswiki.osgeo.org/wiki/Interpolation#Resampling_of_raster_maps_to_coarser_resolution)

Markus

Micha Silver
Arava Drainage Authority
+972-523-665918