[GRASS-user] Help needed to spatially translate a raster map

Hi All:

Can someone suggest an efficient method to spatially translate a raster map? This is what I want to do is:

(1) within a specified map region, using v.random, randomly generate 500-1000 vector point locations.

(2) from each point in (1) reposition a raster map (center) from a known x,y to the new center

(3) perform some statistics between each of the new re-positioned raster maps and the original map

I just need help with (2). I think I could work this out on my own with some brute force, but maybe someone has an elegant approach??

Thank you,

Tom

Thomas Adams-2 wrote

Hi All:

Can someone suggest an efficient method to spatially translate a raster
map? This is what I want to do is:

(1) within a specified map region, using v.random, randomly generate
500-1000 vector point locations.
(2) from each point in (1) reposition a raster map (center) from a known
x,y to the new center
(3) perform some statistics between each of the new re-positioned raster
maps and the original map

I just need help with (2). I think I could work this out on my own with
some brute force, but maybe someone has an elegant approach??

Thank you,
Tom

_______________________________________________
grass-user mailing list

grass-user@.osgeo

https://lists.osgeo.org/mailman/listinfo/grass-user

What about r.region for step 2?

https://grass.osgeo.org/grass73/manuals/r.region.html

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Help-needed-to-spatially-translate-a-raster-map-tp5328050p5328066.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Dear Moritz & Helmut,

Thank you so much! This works perfectly – I had not even thought of using r.region!

Best,

Tom

···

On Sun, Jul 16, 2017 at 1:39 PM, Moritz Lennert <moritzlennert@posteo.net> wrote:

Le 16 juillet 2017 18:36:42 GMT+02:00, Thomas Adams <tea3rd@gmail.com> a écrit :

Hi All:

Can someone suggest an efficient method to spatially translate a raster
map? This is what I want to do is:

(1) within a specified map region, using v.random, randomly generate
500-1000 vector point locations.
(2) from each point in (1) reposition a raster map (center) from a
known
x,y to the new center
(3) perform some statistics between each of the new re-positioned
raster
maps and the original map

I just need help with (2). I think I could work this out on my own with
some brute force, but maybe someone has an elegant approach??

r.region ? Using original map’s r.info output to get nrows and ncols and then something like this (needs fine-tuning):

g.copy original,newmap
r.region newmap n=y+nrows/2 w=x-ncols/2 etc…

?

Moritz