[GRASS-user] min and max coord values

Glynn Clements glynn at gclements.plus.com
Wed Jul 18 09:43:48 EDT 2007


Ivan Shmakov wrote:

> >>>>> "t" == temiz  <temiz at deprem.gov.tr> writes:
> 
>  t> I want to get min and max coord values from of catagorized raster
>  t> map.
> 
>  t> something like: r.stats -agn hey6 > gives minx maxx miny maxy
> 
>  t> is it possible ?
> 
>         You may use r.info to obtain the coordinates of the opposite
>         corners of the grid of the raster map.  Alternatively, you could
>         change the current region to the one of the raster map ($
>         g.region rast=MAP), then print it ($ g.region -p.)  (You're to
>         save the current region to a temporary file to be able to return
>         to it.)
> 
>         The above gives you the coordinates of the corners of the grid.
>         I know no easy way to obtain the coordinates of the corners of
>         the actual data (i. e., with the NULLs omitted.)

You can use "g.region zoom=..." for this.

The rast= option uses the bounds of the map itself, while zoom= uses
the smallest rectangle which encloses all of the non-null cells.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list