This function returns a value of 1 if a catalog path (supplied as an argument) points to an an ArcGIS geodatabase, and it returns a value of 0 otherwise.

Syntax


value = ENVI_IS_GDB(CatalogPath, [GDB_TYPE=variable])

Arguments


CatalogPath

A catalog path is one that ArcGIS recognizes; it includes the name of the geodatabase plus a raster dataset within the geodatabase. Set CatalogPath to a string value. Following are some examples of valid catalog paths.

ArcGIS File geodatabase:

Local: 'C:\data\core\CoreGeodatabase10.gdb\S068W013d_Clip'

Universal Naming Convention (UNC) path: '\\ags10\data\CoreGeodatabase10.gdb\S068W013d_clip'

ArcGIS Enterprise geodatabase:

ArcCatalog: 'Database Connections\ags10-sde.sde\sde.sde.s068w013d_Clip'

Local: 'C:\Documents and Settings\user\Application Data\Esri\Desktop10.0\ArcCatalog\ags10-sde.sde\sde.sde.s068w013d_Clip'

UNC path: '\\ags10\data\ags10-sde.sde\sde.sde.s068w013d_clip'

Keywords


GDB_TYPE

If CatalogPath points to an ArcGIS geodatabase, then GDB_TYPE is set to GDB_FILE or GDB_ENTERPRISE; otherwise it is set to ' ' (null).

Example


Run the following program using ENVI + IDL, and replace the inputFile variable with a real-world dataset.

PRO test_if_gdb
  compile_opt idl2
  ;
  ; First restore all the base save files.
  ;
  envi, /restore_base_save_files
  ;    
  ; Initialize ENVI in the batch mode   
  ; and send all errors and warnings
  ; to the file batch.txt.
  ;
  envi_batch_init, log_file='batch.txt'
  ;  
  ; Open the input file 
  ;
  inputFile = 'C:\Sample.gdb\sample'
  ;
  ; Test if this is a geodatabase
  ;
  is = envi_is_gdb(inputFile, gdb_type=gdb_type)
  print, is
  print, gdb_type
  ;
  ; Exit ENVI
  ;
  envi_batch_exit
END

Result

       1
 
GDB_FILE

API Version


3.7