Skip to content
Prev 24398 / 29559 Next

MODIS package's runGdal() returns error: dataFormat='GTiff', format not supported

Hakim,
Your installation and mine share the same defect:
[1] TRUE
Error in correctPath(path) : object 'GTiff' not found
function (path = NULL)
{
    inW <- getOption("warn")
    on.exit(options(warn = inW))
    options(warn = -1)
    path <- correctPath(path)
    cmd <- paste0(path, "gdalinfo --formats")
    if (.Platform$OS == "windows") {
        driver <- try(shell(cmd, intern = TRUE), silent = TRUE)
    }
    else {
        driver <- try(system(cmd, intern = TRUE), silent = TRUE)
    }
    if (class(driver) == "try-error") {
        options(warn = inW)
        warning("No gdal installation found please install 'gdal' on your
system first!")
        return(FALSE)
    }
    if (length(grep(driver, pattern = "HDF4")) == 0) {
        return(FALSE)
    }
    else {
        return(TRUE)
    }
}
<bytecode: 0x7ddc970>
<environment: namespace:MODIS>
If we hard code:
[1] "Supported Formats:"

  [2] "  VRT -raster- (rw+v): Virtual Raster"

  [3] "  GTiff -raster- (rw+vs): GeoTIFF"

  [4] "  NITF -raster- (rw+vs): National Imagery Transmission Format"

  [5] "  RPFTOC -raster- (rovs): Raster Product Format TOC format"

  [6] "  ECRGTOC -raster- (rovs): ECRG TOC format"

  [7] "  HFA -raster- (rw+v): Erdas Imagine Images (.img)"

  [8] "  SAR_CEOS -raster- (rov): CEOS SAR Image"

  [9] "  CEOS -raster- (rov): CEOS Image"

 [10] "  JAXAPALSAR -raster- (rov): JAXA PALSAR Product Reader (Level
1.1/1.5)"

I am still looking for where correctPath() comes from as well as trying to
get my MRT recognized, but slowly slowly.
Seems we're looking at environment variables (MRT, and likely gdal_config)
and some other special sause that we've overlooked in installation of MODIS.
Chris

On Wed, May 18, 2016 at 8:53 AM, chris english <
englishchristophera at gmail.com> wrote: