<div dir="ltr"><div><br><br>On Wed, Nov 30, 2016 at 7:35 PM, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br>><br>><br>><br>> Le 29 novembre 2016 22:33:39 GMT+01:00, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> a écrit :<br>> > For<br>> >reprojection, something like <a href="http://r.in.xyz">r.in.xyz</a> could work:<br>><br>> I'm currently going through this process and it raises a series of issues:<br>><br>><br>> ><br>> >1. convert raster cells to vector points with raster cell value as<br>> >vector z<br>> >value.<br>><br>> I use r.to.vect for this. The -b flag allows +/- fast conversion, but it takes into account all cells. It would be great to have a flag telling it to only convert non-null cells. Or at least a hint to set a mask, which seems to have the desired effect.<br><br></div>r.to.vect converts only non-null cells, no mask needed, at least for me in trunk.<br><div>><br>><br>> >2. reproject these vector points to the target location<br>><br>> I locally modified v.proj to add a 'Don't build topology' flag.<br>><br>> Is there any indication against this ?<br><br></div><div>No.<br></div><div>><br>> >3. export the vector points with v.out.ascii format=point<br>> >4. import the exported points with <a href="http://r.in.xyz">r.in.xyz</a> method=sum<br>><br>> This works nicely.<br>><br>> Thanks ! If I find the time I will wrap this into a r.proj.aggregate (?) script...<br>><br>><br>><br>> ><br>> >The method options of <a href="http://r.in.xyz">r.in.xyz</a> could be added to r.proj for spatial<br>> >aggregation, but that would mean that most of the code of <a href="http://r.in.xyz">r.in.xyz</a><br>> >would<br>> >need to be copied to r.proj, then adapted. That would be an interesting<br>> >enhancement, also considering that gdalwarp offers as resampling<br>> >methods<br>> >near, bilinear, cubic, cubicspline, lanczos, average, mode, max, min,<br>> >med,<br>> >Q1, Q3.<br>><br>> But it doesn't offer sum....<br><br></div><div>True, but it offers statistical aggregates. And for average, you need to have the sum internally anyway, then divide by the cell count (number of source cells falling into the current target cell), at least this is how I imagine how average would be calculated.<br></div><div><br></div><div>Markus M<br></div><div>><br>> Moritz<br>><br></div></div>