[GRASS-user] r.mapcalc trouble

Glynn Clements glynn at gclements.plus.com
Sun Mar 11 15:05:26 EDT 2007


Tyler Smith wrote:

> I'm having some trouble with clipping a group of raster maps. I tried
> the following:
> 
> na_ecoreg is a vector map covering all of north america
> clipper is a manually digitized vector map that touches all the areas
> of na_ecoreg that I want to clip the rasters with
> wc_mean_temp_dry is a worldclim raster map covering the whole area
> 
> #-------
> v.select ainput=na_ecoreg binput=clipper output=eco_clip
> v.to.rast input=eco_clip output=eco_clip use=val value=1
> r.mapcalc mean_temp_dry_clip='if(wc_mean_temp_dry && eco_clip,
>   wc_mean_temp_dry, null())'
> #-------
> 
> I've done this for eight raster maps. Some of the maps I've produced
> are fine, but others show null raster pixels in the clipped raster
> that are not in the source raster map. The null pixels are not present
> in the eco_clip raster map either. What could be causing this?

Are you taking into account that any cells which are zero in
wc_mean_temp_dry will be null in the result?

Or did you mean to use:

	!isnull(wc_mean_temp_dry) && !isnull(eco_clip)

as the test expression?

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




More information about the grass-user mailing list