[R-sig-Geo] Checking whether a file is a "good" raster

Jonathan Greenberg greenberg at ucdavis.edu
Thu Sep 8 22:25:15 CEST 2011


R-sig-geo'ers:

I'm trying to write a raster catalog function, and one thing I'm
running into is how to properly check if a file is a legitimate raster
format -- I'm defining "legit" as GDALinfo recognizing it as a
supported format, e.g. does not return:

Error in .local(.Object, ...) :
  `/pathto/myfile' not recognised as a supported file format.

I'm just looking for a TRUE/FALSE situation, at present (TRUE if
GDALinfo returns a valid response, FALSE if it returns the error
above).  Thoughts?

--j


-- 
Jonathan A. Greenberg, PhD
Assistant Project Scientist
Center for Spatial Technologies and Remote Sensing (CSTARS)
Department of Land, Air and Water Resources
University of California, Davis
One Shields Avenue
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307



More information about the R-sig-Geo mailing list