[GRASS-dev] get_row.c: output north/east values? G__.window structure

Glynn Clements glynn at gclements.plus.com
Tue Aug 26 09:10:06 EDT 2008


Markus Neteler wrote:

> I try to understand an issue mentioned on grass-user but get only enigmatic
> error messages:
> 
> v.extrude -t bldg_cmcl  out=bldg_cmcl_3d height=15
> elev=el_D792_6m --o
> WARNING: Vector map <bldg_cmcl_3d> already exists and will be overwritten
> 
> WARNING: Reading raster map <el_D792_6m at PERMANENT> request for row 220803
>          is outside region
> ERROR: Problem reading raster map
> 
> The error is issued in function compute_window_row() in
> lib/gis/get_row.c
> 
>     /* check for row in window */
>     if (row < 0 || row >= G__.window.rows) {
>         G_warning(_("Reading raster map <%s@%s> request for row %d is outside region"),
>                   fcb->name, fcb->mapset, row);
> 
>         return -1;
>     }
> 
> Would it be possible to add something like raster_row_error() in
> lib/gis/sample.c
> ?
> 
> Then I could just check with g.region what's going on with my maps.
> The row number warning is rather useless to the end user.

Any warning generated there is useless to the end user, as it
indicates a bug in the code. It's the caller's responsibility to avoid
requesting rows which lie outside the current region.

> I tried but got lost in G__.window ...

You're looking in the wrong place.

I've committed fixes to a number of bugs in G_get_raster_sample(). 
Apart from trying to read invalid rows, it was deliberately reading
the wrong rows at the edge of the region, and pretending that nulls
were zero (they aren't; just because you would like a definite (i.e. 
non-null) answer, that doesn't mean that you can have one).

I've also fixed v.sample to deal with the fact that the result may be
null.

v.extrude and v.drape also use that function, so they may need similar
changes.

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


More information about the grass-dev mailing list