[R-sig-Geo] Problem with ignoring background value

Roger Bivand Roger.Bivand at nhh.no
Sun May 25 23:26:10 CEST 2008

On Sun, 25 May 2008, Ophelia Wang wrote:

> Hi all,
> I've been having troubles to get rid of background values (255) of 
> aerial photo mosaics (.img) in Erdas Imagine. I've tried "mosaic" (which 
> has options of ignore certain input and output background and 0 values), 
> "rescale" (ignore 0 and 255), ArcGIS copy raster (ignore 0 and 255), 
> etc. etc. Everything that has an option to ignore both 0 and 255 that 
> I've tried.
> None of those worked in terms of removing the white background of the 
> aerial photo mosaics. I have nearly 50 images, so I can't manually 
> create AOI and then subset each mosaic based on AOI.

There are (at least) two things mixed up here. One concerns the actual 
values, the other their graphical representation. You could script a loop 
to set SpatialGridDataFrame variables meeting your conditions to NA, which 
would display as transparent in many R graphics devices, but getting the 
missing values across to other systems might need patience. A combination 
of R and Python might get them into Arc - R to set to NA and export, then 
Python or VBA to import the file with NAs into Arc. Do you need to crop 
them too?


> Any suggestions? Thanks for you help.
> Ophelia

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no

More information about the R-sig-Geo mailing list