How to Programmatically Read ESRI Shapefiles into Classic ENVI
There are a couple of different ways to programmatically open ESRI Shapefiles in ENVI. The recommended method is using the IDLffShape object. One can read in the shape data as well as the attribute information using this object.
There is also an undocumented ENVI routine called ENVI_ARC_SHAPE_CONVERT that opens ESRI Shapefiles and converts them to EVF files. This routine is less desirable, even though it is what ENVI does under the hood, because it automatically converts the Shapefiles to EVF, and because it does not handle the Shapefile attributes if any are present. ENVI_ARC_SHAPE_CONVERT can be called like this:
envi_arc_shape_convert, in_names=in_names,out_names=out_names, $
l_names=l_names, proj=proj
If a customer really needs to use this method for some reason that we can't currently forsee, they can then get at the attribute information using:
dbase_read_file, name, records, field_info
. . . where name is the name of the DBF file, records will be an anonymous structure of the attributes, and field_info is an array of structures explaining the format of each column. Each row (record) in the DBF file corresponds to a record in the EVF file.