Vectors

Vectors are points, multipoints, polylines, or polygons used to mark areas of interest within an image. Use the Vector toolbar buttons to work with vectors. For additional details on vectors, see Vector Records Background.

ENVI supports shapefiles (.shp, excluding Z and M polygons), GeoJSON (.json, .geojson read-only support), and ENVI vector files (.evf) and OGC GeoPackage vector file (.gpkg). See Vector Auxiliary Files Background for a list and description of the auxiliary files that ENVI creates on your local drive when opening vector files for the first time.

See the following sections:

Create and Save Vector Layers as Shapefiles

Create Vector Layers from ASCII Data as Shapefiles

You can create point, multi-point, polyline, or polygon vector layers from ASCII text files or comma-separated value (CSV) files that contain data and geolocation values. An example is creating a point-based shapefile from an ASCII file that contains GPS records. You can only create new vector layers from ASCII data; you cannot add records to an existing vector layer.

You can write a script to create vector layers from ASCII data using the ASCIIToVector task.

If the data contain a combination of numeric and text values, they must be separated by commas. If the data consist entirely of numeric values, they can be separated by spaces or commas. You can add records to a new or existing ROI. ENVI will ignore any header information or column labels.

Tip: The ENVI Feature Counting Tool provides an option to export feature counts to CSV files or ASCII reports.

Follow these steps:

  1. Create a new layer by selecting File > New > Vector Layer from the menu bar. The Create New Vector Layer dialog appears.
  2. Enter an optional Layer Name.
  3. From the Record Type drop-down list, select the type of vector record to create. The choices are Point, Multipoint, Polyline, or Polygon (default).
  4. In the Source Data list, select the source data that will define the new layer’s extents and map projection.
  5. Click OK.
  6. Select the vector layer in the Layer Manager to make it the active layer. The Create Vector tool becomes active in the ENVI toolbar.
  7. Right-click in the Image window and select Import from ASCII. The Select Input Coordinates File dialog appears.
  8. Select an ASCII text file (.txt) or CSV file (.csv) with the records you want to import and click Open. The Import from ASCII dialog appears.
  9. The File Preview section shows the columns of data that were imported; for example:

  10. In the X field of Data Columns, select the column number that contains longitudes or eastings.
  11. In the Y field of Data Columns, select the column number that contains latitudes or northings.
  12. Using the example above, the X field is column #3 since that column contains longitudes. The Y field is column #2 since that column contains latitudes:

  13. Select the Coordinate System of the imported ASCII data. See Select Coordinate Systems for further instructions. The default is Geographic Lat/Lon WGS-84.
  14. Click OK.

Add Vectors

You can add vectors to shapefiles and EVFs only.

Edit or Delete Vectors

You can edit or delete vectors in shapefiles and EVFs only. The options include: delete a record, move a polyline or polygon vertex, add or delete a polyline or polygon vertex, group or ungroup records. join polylines, merge or split polylines or polygons, smooth polygons, rectangulate polygons. and remove polygon holes.

Change Properties for Vectors 

Changing properties works for all supported vector types. The properties of a vector layer are displayed below the ENVI Toolbox; for example:

You can edit the basic properties directly in this panel.

To edit the display properties for a given attribute, right-click on a vector layer in the Layer Manager and select Properties. In the Vector Properties dialog, select an attribute name from the Attribute drop-down list. The Attribute Values section on the left side of the Vector Properties dialog lists the unique values for that attribute.

Attribute Values

To edit the display properties of a specific attribute value, select the value in the Attribute Values list. Use the bottom table to edit the color properties for that value.

Here are some tips for working with vector files that have more than 256 unique attribute values:

Save Vector Symbology

Saving vector symbology is supported for shapefiles and GeoJSON. Once you have modified the display properties of a vector layer, you can save the symbology settings for later use. Click the Symbology drop-down list and select Save/Update Symbology File. ENVI saves the symbology to a .evs file with the same root name as the vector file. By default, the symbology file is written to the same directory as the vector file. However, when that directory is read-only, the symbology file is written to the Auxiliary File Directory.

Each time you reopen the vector file, ENVI applies the styles defined in the associated symbology file (if it is present). You can select Save/Update Symbology File after making further changes. Or, if you do not like the changes you have made, select Apply Default Symbology to revert back to the styles defined in the symbology file.

To delete the symbology file completely, select Delete Symbology File. The vector layer then uses ENVI's default colors and styles.

View Attributes for Vectors

Viewing attributes works for all supported vector types. If a vector layer has an associated attribute table, you can open and view the attributes. Right-click on the layer name in the Layer Manager and select View Attributes to open the Attribute Viewer.

Filter by Attributes

Filtering by attributes works for all supported vector types. If a vector layer has an associated attribute table, you can filter the records by one or more attributes. Right-click the layer name in the Layer Manager and select Filter Records by Attributes to open the Filter by Attributes dialog.

Zoom Options

Zoom options work for all supported vector types.