Skip to content

Force runGdal to not authenticate the earthData login? #143

@CCheCastaldo

Description

@CCheCastaldo

I have downloaded some hdf4 files locally and am trying to work with them using MODIS::runGdal. However, despite telling MODISOptions to not check my earthdata login:

MODISoptions(
  localArcPath = path.expand("~/Downloads/MCD19A2_hdf"), 
  outDirPath   = path.expand("~/Downloads/MCD19A2_tiffs"),
  check_earthdata_login = FALSE
)

and also telling runGdal that the files are already downloaded:

MODIS::runGdal(
  product    = "MCD19A2",
  collection = "061",
  tileH      = 23,
  tileV      = 16,
  begin      = "2011012",
  end        = "2011012",
  SDSstring  = SDSstring,
  job        = "MAIAC_AOD_WV",  
  overwrite  = TRUE,
  download   = FALSE,  
  outProj    = "EPSG:3031",
  outFormat  = "GTiff",
  resampling = "near",    
  datum      = NA  
)

runGdal still errors out like this:

########################
outProj          =  +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs 
pixelSize        =  asIn 
resamplingType   =  near 
Output Directory =  /Users/wintermute/Downloads/MCD19A2_tiffs/MAIAC_AOD_WV 
########################
Error in .local(product, ...) : 
  Earthdata Login credentials could not be verified.
Please run MODISoptions(check_earthdata_login = TRUE) (default) and re-try.

Unfortunately, check_earthdata_login = TRUE always fails now since the API requires a token and not the password and MODIS seems unable to handle that. Is there a way to force runGdal and other MODIS functions not authenticate the earthdata login when working with local files?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions