>  Docs Center  >  Using ENVI  >  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) and ENVI vector files (.evf). 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

  • Create a new layer by selecting File > New > Vector Layer from the menu bar.
  • Each layer may contain only one Record Type (for example, points).
  • You can select a Source Data file when creating an new layer to define the new layer’s extents and map projection using an existing file.
  • ENVI performs Real-Time Ortho for vector layers created on top of an RPC image. The vector layers will contain projected coordinates that can display with other projected imagery, and projected vector layers will display on top of an existing RPC image without reprojecting the RPC image.
  • When the layer has been modified, the icon next to the layer name in the Layer Manager becomes shaded Dirty vector layer icon. The icon shading is removed once the layer is saved.
  • Save layer changes by right-clicking in the Image window view and selecting Save.
  • Save layer changes to a new file by right-clicking in the Image window and selecting Save As. Also use Save As when saving a new vector layer for the first time.
  • Saving the new layer creates a new attribute table, which consists of the numeric attribute RECORD_ID.
  • To hide a vector layer in a view, disable the check box for that layer in the Layer Manager. To show the layer, enable the check box. Or, right-click on the View icon in the Layer Manager and select Show All Layers and Hide All Layers to show/hide all layers at once.
  • To rename a layer, right-click its name and select Rename Item. Enter the new name in the Rename Item dialog and press the Enter key to accept it or press the Esc key to cancel. (Linux and Macintosh users should click the green check icon to accept the new name or click the red X icon to cancel.)
  • To remove a vector layer from the Layer Manager, right-click on the layer and select Remove. This removes the layer from the Layer Manager, but the file remains open and you can access it for redisplay from the Data Manager.
  • If you have multiple views displayed, you can drag-and-drop vector layers from the Layer Manager to any one of those views in the display or to the corresponding view icons in the Layer Manager. This creates a copy of the layer(s) to populate the views.
  • To add a vector layer to a new view, right-click on a filename in the Data Manager and select Open Selected Dataset in New View.
  • Each time you open a new vector file, the layer appears at the top of the Layer Manager and becomes the selected layer. The purpose of a selected layer is to allow you to apply a display enhancement (transparency, etc.) to that layer only, without affecting other layers. To select a layer, click its name in the Layer Manager.
  • If an Esri® shapefile is open in both ArcMap™ and ENVI and you change that layer in ArcMap (for example, move vertices), you can refresh the layer in ENVI to see the changes. To refresh in ENVI, the layer must first be saved in ArcMap. Refresh with one of the following:

  • In the Layer Manager, right-click the Esri layer and select Refresh.
  • In the Data Manager, right-click the Esri layer and select Refresh.

    The layer closes and reopens. Refreshing the layer moves it to the top of the order in the Layer Manager. If you have multiple views of the Esri layer open in the Image window, the layer will close in all views that contain that it and reopen in the active view.

Create Vector Layers from ASCII Data

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 ENVIASCIIToVectorTask.

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

  • In the active layer, click the Vectors drop-down on the toolbar and select Vector Create, then click on the image where you want to add the vector.
  • Create polygons or polylines by clicking and dragging to draw them, or click at intervals to add vertices one at a time.
  • Use the right-click menu options to accept vectors when they are drawn.
  • Multipoint vectors can be added only to a vector file that is designated a multipoint file.
  • Group or ungroup vectors by selecting them and using the right-click menu options.
  • Editing a vector layer with an associated attribute table does not change the existing attribute values. Depending on the type of edits you make, this may mean the values in that record are no longer valid.
  • Vector layers originating from a geodatabase or referenced by an Esri® layer are not editable; however, you can access and edit the source data for an Esri layer.

Edit or Delete Vectors

Vector edit or delete options include: deleting a record, moving a polyline or polygon vertex, adding or deleting a polyline or polygon vertex, grouping or ungrouping records. joining polylines, merging or splitting polylines or polygons, smoothing polygons, rectangulating polygons. and removing polygon holes.

  • To edit or delete polygon or polyline records in the active layer, click the Vectors drop-down on the toolbar and select Vector Edit.
  • To edit or delete points in the active layer, click the Vectors drop-down on the toolbar and select Vertex Edit.
  • Select a record by clicking on it.
  • Select multiple records by using Ctrl+click, or by clicking and dragging to draw a box around the records.
  • Use the right-click menu to choose edit or delete options for the selected record(s).

Change Properties for Vectors 

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.

  • Use the top table to edit the display properties of a selected attribute.
  • The Fill Interior property is disabled for any polygon layer that is the active layer, when the Vector Edit or Vertex Edit tool is in use.
  • When you display a vector file for the first time, the Vector Properties dialog assigns a default fill color of red for all attributes.
  • To change the fill color for all values for the selected attribute, select the Solid Color option from the Color Table drop-down list. Otherwise, select different color options as needed. For example, you could assign different colors to different road types such as dirt, multi-lane, etc. A preview of the currently selected color table is displayed below the drop-down list.
  • For polygon shapefiles, if the Fill Interior property is set to True and you select an option from the Color Table drop-down list (besides Solid Color), the Line Color property in the top table is automatically set to black. You can change this if needed. If the Fill Interior property is set to False and you select a color table, the outlines of the polygons are colored according to the selected color table.
  • If the Fill Interior property is set to True for polygon shapefiles, the fill is temporary disabled if you use the Pan, Fly, or Rotate tools to move around the display.
  • If the attribute has more than 256 unique values, the selected color table is equally divided among the number of attributes, creating a color gradient. Select the Cycle Color Table option if you want the color table to repeat itself with each iteration of 256 unique values.
  • Click Apply to commit your changes to the Image window.

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:

  • The Attribute Values list only shows 256 values at a time. Click the and buttons to navigate through pages of attribute values. Or, click the and buttons to go to the first or last page of values. The window to the right of the buttons indicates the range of records you are currently viewing.
  • Clicking the Attribute Value Index button displays a dialog that divides all of the unique attribute values into smaller categories, to help you quickly locate a specific attribute value. The following example shows unique "name" attribute values for world airports. In the Attribute Value Index dialog, suppose you want to find the Hong Kong International Airport. Click on the value before Hong Kong, which in this case is Halifax Int'l. The Attribute Value Index dialog shows a more detailed level of values that start with that selection. Click Hong Kong Int'l. At this point, you can edit the vector properties for Hong Kong Int'l, or you can continue to find other attribute values. In the Attribute Value Index dialog, click the Prev Level button if needed to return to the previous group of values.

Save Vector Symbology

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

If a vector or Esri feature class 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.

Zoom Options

  • To zoom to the full extent of a given vector layer, right-click on the layer name in the Layer Manager and select Zoom to Layer.
  • Selecting Full Extent from the Zoom drop-down menu or clicking the Zoom to Full Extent button in the main toolbar zooms to the combined extents of all layers for the current view.
  • If a vector layer is georeferenced, the Zoom To drop-down list in the main toolbar displays options for Map Scale:

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