[GRASS-dev] [bug #4451] (grass) New options for g.region

Hamish hamish_nospam at yahoo.com
Thu May 11 23:38:45 EDT 2006


> this bug's URL: http://intevation.de/rt/webrt?serial_num=4451
> ---------------------------------------------------------------------
> 
> Subject: New options for g.region
..
> The following patch adds options to g.region to set the number of rows
> and columns of the region.  Options are:
> 
> rows=
> cols=
> size=
> 
> rows= and cols= are self-explanatory, size= sets both rows and cols to
> the same value
> 
..
> +++ main.c	11 May 2006 19:41:27 -0000
..
> +	int ival;
> +	int row_flag=0, col_flag=0, depth_flag=0;
..
> +	parm.rows->key_desc    = "value";
..
> +	parm.rows->type        = TYPE_STRING;


why not use ->type = TYPE_INTEGER; and then skip key_desc?

Then the parser will ensure an integer was given and give a helpful
error message if not. Also you need to check that the value is >=1.

Will it adjust the region bounds or the resolution?



Hamish




More information about the grass-dev mailing list