>  Docs Center  >  ENVI API  >  Application Control  >  ENVI::OpenVector



The OpenVector function method creates a new ENVIVector from a file or URI.


; Launch the application
e = ENVI()
; Open a shapefile
file = FILEPATH('states.shp', $
  SUBDIRECTORY = ['examples', 'data'])
; Create an ENVIVector from the shapefile data
vector = e.OpenVector(file)


Result = ENVI.OpenVector(URI [, Keywords=value])

Return Value

This method returns a reference to an ENVIVector.



Specify a scalar string that is a fully-qualified file path to a vector file or GeoPackage file on disk. Or, specify a catalog path to a remote geodatabase feature dataset (Windows 32-bit systems only). If you connect to a remote dataset that requires authentication, you must set the USERNAME and PASSWORD keywords.


Keywords are applied only during the initial creation of the object.


Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.


Set this keyword to a string with a valid password for opening a remote dataset that requires authentication.


Set this keyword to a string with a valid user name for opening a remote dataset that requires authentication.

Version History



ENVI 5.2, Service Pack 1

Added PASSWORD and USERNAME keywords

ENVI 5.3

Updated URI to include GeoPackage files

API Version


See Also

ENVI function, ENVIVector, ENVIVector::Close

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us