Hi,
I am new user to Grass and GIS. I would like to clip(crop) a raster so that I
can extract a smaller map from a larger area where I want to focus the
analysis. I highly appreciate anyone directing me ragarding the command that
can be used to do that.
Thanks,
Ashu
On Tue, 6 May 2003 aguru2@unlserve.unl.edu wrote:
Hi,
I am new user to Grass and GIS. I would like to clip(crop) a raster so that I
can extract a smaller map from a larger area where I want to focus the
analysis. I highly appreciate anyone directing me ragarding the command that
can be used to do that.
I think g.region will help, since it lets you change both the raster
extent (and resolution if you need that too) for subsequent analysis,
until you change the window back.
Thanks,
Ashu
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no
aguru2@unlserve.unl.edu wrote:
I am new user to Grass and GIS. I would like to clip(crop) a raster so that I
can extract a smaller map from a larger area where I want to focus the
analysis. I highly appreciate anyone directing me ragarding the command that
can be used to do that.
Almost all raster commands do this automatically. GRASS raster
commands normally operate upon the current region, which can be set
and queried using g.region.
Any maps which are created have their bounds and resolution determined
by the current region; any maps which are read are automatically
cropped, padded (with nulls) and/or resampled according to the current
region settings.
--
Glynn Clements <glynn.clements@virgin.net>
However, if you want only a raster map on the current region, after doing
a g.region, you do a: r.mapcalc "new_map=old_map"
This will crop old_map to the region and store it into new_map
Laurent BESSON
On Tue, 6 May 2003, Glynn Clements wrote:
aguru2@unlserve.unl.edu wrote:
> I am new user to Grass and GIS. I would like to clip(crop) a raster so that I
> can extract a smaller map from a larger area where I want to focus the
> analysis. I highly appreciate anyone directing me ragarding the command that
> can be used to do that.Almost all raster commands do this automatically. GRASS raster
commands normally operate upon the current region, which can be set
and queried using g.region.Any maps which are created have their bounds and resolution determined
by the current region; any maps which are read are automatically
cropped, padded (with nulls) and/or resampled according to the current
region settings.
--
******************************************************
* Laurent BESSON * Laboratoire de Cartographie *
* * Universite de Bourgogne *
* * Dijon, France *
* ***********************************
* * Equipe ingenierie informatique*
* * et Bases de Donnees *
* * Laboratoire LE2I *
* * Universite de Bourgogne *
* * Dijon, France *
******************************************************
* "S'aimer, ce n'est pas se regarder l'un l'autre, *
* c'est regarder ensemble dans la même direction. *
* Antoine de Saint-Exupéry *
******************************************************
Laurent BESSON wrote:
> > I am new user to Grass and GIS. I would like to clip(crop) a raster so that I
> > can extract a smaller map from a larger area where I want to focus the
> > analysis. I highly appreciate anyone directing me ragarding the command that
> > can be used to do that.
>
> Almost all raster commands do this automatically. GRASS raster
> commands normally operate upon the current region, which can be set
> and queried using g.region.
>
> Any maps which are created have their bounds and resolution determined
> by the current region; any maps which are read are automatically
> cropped, padded (with nulls) and/or resampled according to the current
> region settings.However, if you want only a raster map on the current region, after doing
a g.region, you do a: r.mapcalc "new_map=old_map"This will crop old_map to the region and store it into new_map
You can also use r.resample, which is intended for this purpose.
Although, when the expression is a single map, r.mapcalc now does most
of what r.resample does; i.e. it will copy the categories, colour
table and history. However, unlike r.mapcalc, r.resample will "crop"
the category list and colour table to include only those categories
which actually occur in the output map.
However, just because you can produce a cropped map, it doesn't follow
that you should (the original poster may have been assuming that it
was necessary to generate a new map, when usually it isn't). Where
possible, you should just modify the region settings and use the
original map.
Whenever you generate a new map, you may lose information and/or
accuracy, but you will never gain them. In particular, if you resample
a map which was generated by resampling another map, the end result
will be less accurate than if you were to resample the original map.
--
Glynn Clements <glynn.clements@virgin.net>