[GRASS-user] Raster Map subset

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.
thanks,

--
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

                -K. Mullis

Hi Stephen,

I suggest you use spgrass6 package on R,
set your g.region using system(“g.region n= s= w= e=”)
on R and use readRAST6 to load your map
as SGDF. Of course, if you are under windows,
you know that depending the size of your grid
you will get troubles :slight_smile:

best

milton

2010/2/5 stephen sefick <ssefick@gmail.com>

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.
thanks,


Stephen Sefick

Let’s not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis


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

Wonderful- thank you very much.

Stephen

On Fri, Feb 5, 2010 at 6:31 PM, Milton Cezar Ribeiro
<miltinho.astronauta@gmail.com> wrote:

Hi Stephen,

I suggest you use spgrass6 package on R,
set your g.region using system("g.region n= s= w= e=")
on R and use readRAST6 to load your map
as SGDF. Of course, if you are under windows,
you know that depending the size of your grid
you will get troubles :slight_smile:

best

milton

2010/2/5 stephen sefick <ssefick@gmail.com>

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.
thanks,

--
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

                                                           \-K\. Mullis

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

--
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

                -K. Mullis

On Fri, 5 Feb 2010, stephen sefick wrote:

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.

Stephen,

   Yes, you can. This subject has come up several times in the past month or
so so the archives have a lot of options for you. One to look at closely is
v.in.region. After zooming to the area you want, run v.in.region and save
that vector map. You can then use it with the g.region command to limit the
displayed bounds of your raster map. You can use r.patch to make a new
raster map that's the size of the newly created vector map.

   Are you aware of r.topmodel within GRASS?

Rich

I am aware of r.topmodel in GRASS, but I am much more familiar with R
than GRASS, and the GRASS documentation is not as comprehensible as
that for R -- This is just because of my own bias and does not reflect
on anybody but me. I would love to try it in GRASS but I think I need
a tutorial. Any help would be greatly appreciated with this.

Stephen

On Fri, Feb 5, 2010 at 6:36 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Fri, 5 Feb 2010, stephen sefick wrote:

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.

Stephen,

Yes, you can. This subject has come up several times in the past month or
so so the archives have a lot of options for you. One to look at closely is
v.in.region. After zooming to the area you want, run v.in.region and save
that vector map. You can then use it with the g.region command to limit the
displayed bounds of your raster map. You can use r.patch to make a new
raster map that's the size of the newly created vector map.

Are you aware of r.topmodel within GRASS?

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

--
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

                -K. Mullis

On Fri, 5 Feb 2010, stephen sefick wrote:

I am aware of r.topmodel in GRASS, but I am much more familiar with R than
GRASS, and the GRASS documentation is not as comprehensible as that for R
-- This is just because of my own bias and does not reflect on anybody but
me. I would love to try it in GRASS but I think I need a tutorial. Any
help would be greatly appreciated with this.

Stephen,

   Well, don't look to me for that tutorial. I need to explore it myself for
my current project.

Rich

Rich Shepard wrote:

On Fri, 5 Feb 2010, stephen sefick wrote:

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.

Stephen,

  Yes, you can. This subject has come up several times in the past month or
so so the archives have a lot of options for you. One to look at closely is
v.in.region. After zooming to the area you want, run v.in.region and save
that vector map. You can then use it with the g.region command to limit the
displayed bounds of your raster map. You can use r.patch to make a new
raster map that's the size of the newly created vector map.

I'm not sure this is entirely correct. v.in.region saves the current *computational* region to a vector, not the area zoomed to. Setting the desired region first with g.region, I think, is the correct way to go. Then r.mapcalc can create a new raster, limited to the new smaller region.

  Are you aware of r.topmodel within GRASS?

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

--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il

There is probably a more eloquent way, but I have taken a vector watershed boundary, converted to a raster, and set as mask. Then used a r.mapcalc expression like "newMap=oldMap+0".

Mark

On Feb 6, 2010, at 3:23 AM, Micha Silver <micha@arava.co.il> wrote:

Rich Shepard wrote:

On Fri, 5 Feb 2010, stephen sefick wrote:

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this? I am going to use this as input into R for some
topmodel runs.

Stephen,

Yes, you can. This subject has come up several times in the past month or
so so the archives have a lot of options for you. One to look at closely is
v.in.region. After zooming to the area you want, run v.in.region and save
that vector map. You can then use it with the g.region command to limit the
displayed bounds of your raster map. You can use r.patch to make a new
raster map that's the size of the newly created vector map.

I'm not sure this is entirely correct. v.in.region saves the current *computational* region to a vector, not the area zoomed to. Setting the desired region first with g.region, I think, is the correct way to go. Then r.mapcalc can create a new raster, limited to the new smaller region.

Are you aware of r.topmodel within GRASS?

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

--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il

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

On Sat, Feb 6, 2010 at 1:16 AM, stephen sefick <ssefick@gmail.com> wrote:

Is there a way to get a subset of a larger raster map. I have zoomed
into an area and would like to make a raster map only containing that
area. Can I do this?

It is as simple as this:

d.zoom || g.region
g.region -p
r.mapcalc subset=original

I am going to use this as input into R for some topmodel runs.

I added the 'g.region -p' to check if the resolution is
messed up (personally, I dislike fractions of a pixel).

hope this helps,
Markus