Vector Overlay and GIS Analysis With ENVI - Tutorial of ENVI Software - Completely GIS, GPS, and Remote Sensing Lecture Material - facegis.com
Vector Overlay and GIS Analysis With ENVI

Overview of This Tutorial

This tutorial introduces ENVI's vector overlay and GIS analysis capabilities using vector data from ESRI's Maps and Data CD-ROM and a simulated 4-meter resolution Space Imaging/EOSAT multispectral dataset and associated vector data of Gonzales, California, USA. Data courtesy of ESRI and Space Imaging/EOSAT. Part 1 of this tutorial uses ESRI's data to demonstrate stand-alone vector GIS analysis, including input of ArcView Shape Files and associated .dbf attribute files, display in vector windows, viewing/editing of attribute data, point-and-click spatial query, and math/logical query operations. Part 2 of this tutorial uses the Space Imaging/EOSAT data to demonstrate use of ENVI's combined image display/vector overlay and analysis capabilities, including cursor tracking with attribute information, point-and-click query, and heads-up digitizing and vector layer editing. Also demonstrated are generation of new vector layers using math/logical query operations and raster-to-vector conversion of ENVI Regions of Interest (ROI) and/or classification images. Finally, the exercise demonstrates ENVI's vector-to-raster conversion, using vector query results to generate ROIs for extraction of image statistics and area calculations. It is assumed that the user already as a basic grasp of GIS analysis concepts.


Data Sources and Files Used in this Tutorial

The data used in this tutorial are provided courtesy of the Environmental Systems Research Institute Inc. and Space Imaging/EOSAT and may not be redistributed without explicit permission from those organizations.

ESRI Data and Maps Version 1 CD-ROM

Example data used in Part 1 of this tutorial come from the ESRI Data and Maps Version 1 CD-ROM distributed with ARCView Version 3.0. BSC is an ESRI Business Partner and strives to maintain import/export compatibility with ESRI GIS products and data formats, including ARCView Shape files and ARC/INFO export files (.e00, non-compressed).

Space Imaging EOSAT Carterra Agriculture Sampler Data

Example images and vector data used in Part II of this tutorial are from the Space Imaging EOSAT Carterra Agriculture Sampler CD-ROM (Copyright © 1997, Space Imaging EOSAT), and are used with their explicit permission. This sample data set covers an agricultural area near Gonzales, California, USA; the north-central portion of the Palo Escrito Peak, CA USGS 7.5 minute quadrangle. The digital imagery are simulated data products designed to be similar to the space-based image data products that will be collected and distributed by Space Imaging EOSAT in early 1998. They are provided by Space Imaging EOSAT to give current and future users of digital imagery a early look at the imagery products that they will be collecting from orbit. These simulated data sets provide a reasonable example of the types of information that will be extractable from the future Space Imaging EOSAT imagery products. The imagery data sets were generated from digital image data collected by an air-borne multispectral scanner. The air-borne data were geometrically rectified, solar corrected and mosaicked at a spatial resolution simulating the future CARTERRA data products. There are, however, both radiometric and geometric differences between these data and satellite-based products planned for delivery. Please see the Carterra Sampler readm.txt file included in the SI_EOSAT subdirectory for additional information.

Required Files

You must have the ENVI TUTORIALS & DATA CD-ROM mounted on your system to access the files used by this tutorial, or copy the files to your disk.

The files used in Part 1 of this tutorial are contained in the ESRI_GIS subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.

Files used in Part 2 of this tutorial are contained in the SI_EOSAT subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.

Required Vector GIS Files for Part 1

CITIES.SHP (.shx, .dbf, .evf)	USA Cities Points 
STATES.SHP (.shx, .dbf, .evf) USA States Polygons) 

Optional Vector GIS Files for Part 1

COUNTIES.SHP (.shx, .dbf,.evf) USA Counties Polygons) 
DRAINAGES.SHP (.shx,.dbf,.evf) USA Drainage Polygons) 
RIVER.SHP (.shx, .dbf, .evf) USA Rivers Polylines) 
ROADS.SHP (.shx, .dbf, .evf) USA Roads Polylines) 
STATES.VEC	ENVI Vector Template
ALASKA.VEC	ENVI Vector Template
HAWAII.VEC	ENVI Vector Template

Required Image Files for Part 2

0826_MS.IMG	4-meter Multispectral data 
0826_MS.HDR	ENVI Header for Above
CAN_TMR.IMG	Canon City TM data
CAN_TMR.HDR	ENVI Header for Above
CAN_SAM.IMG	Canon City SAM Classification
CAN_SAM.HDR	ENVI Header for Above
CAN_SV.IMG	Sieved Classification (threshold=5)
CAN_SV.HDR	ENVI Header for Above
CAN_CLMP.IMG	Clumped (5 x 5) after Sieve
CAN_CLMP.HDR	ENVI Header for Above
CAN_TM1.ROI	Canon City TM ROI #1
CAN_TM2.ROI	Canon City TM ROI #2

Required Vector Files for Part 2

VECTORS.SHP (.shx, .dbf, .evf) Fld Outlines Polygons)

Optional Vector Files for Part 2

GLORIA.EVF, (.dbf) Query Results Polygons) 
LANINI.EVF, (.dbf) Query Results Polygons) 
SHARPE.EVF, (.dbf) Query Results Polygons) 

Background - Vector Overlay and GIS Concepts in ENVI

Capabilities

ENVI Version 3.0 provides extensive vector overlay and GIS analysis capabilities. These include:

  • Import support for industry-standard GIS file formats including ArcView Shape files and associated .dbf attribute files, Arc/Info Interchange (uncompressed), DXF, USGS DLG and USGS STDS formats. ENVI uses an internal binary format (.evf) to maximize performance.
  • Vector or Image/Vector Displays: ENVI provides a stand-alone GIS plot window for displaying vector data and composing simple vector-only maps. More importantly, ENVI provides vector overlays on standard ENVI displays including true vectorization of overlays in all windows, including zoom window.
  • Generate world boundary vector layers including both low- and high-resolution political boundaries, coastlines, and rivers, as well as the USA state boundaries for display in vector windows or overlay on image displays.
  • Heads-up (on-screen) Digitizing can be performed in either the vector or raster image window. Heads-up digitizing provides an easy means of creating new vector layers by adding polygons, lines, or points.
  • Image-based and vector window-based vector editing allows users to modify individual polygons, polylines, and points in vector layers using standardized editing tools, taking full advantage of the image backdrop provided by raster images in ENVI.
  • Regions-of-interest, specific image contour values, classification images and other raster processing results can easily be converted to vector format for use in GIS processing.
  • Track vectors in either vector or image display windows. Display latitude/longitude and map coordinate information. Export map coordinates to image-to-map registration. Open a Vector Information window and display attribute information in real-time as the cursor tracks each vector.
  • ENVI supports linked vectors and attribute tables with point-and-click query for both vector and raster displays. Click on a vector in the display window, and the corresponding vector and its associated information is highlighted in the attribute table. Click on an attribute in the table, and the display scrolls to and highlights the corresponding vector.
  • Scroll and pan through rows and columns of data in attribute tables. Edit existing information or replace individual attributes with constant values, or with data imported from ASCII files. Add or delete attribute columns. Sort column information in either forward or reverse order. Save attribute records to ASCII format.
  • Query vector GIS database information directly to generate new layers of selected information with attributes. Allows GIS analysis of layers using simple mathematical functions and logical operators to produce new information and layers. In keeping with established ENVI processing paradigms, results can either be held in memory, or saved to file for later access.
  • Edit GIS layer display characteristics: Modify line-types, fill types, colors, and symbols. Use attributes to control labels and symbol sizes. Add custom vector symbols.
  • Vector GIS data converted from vector to raster Regions of Interest for extraction of statistics, calculation of areas, and use in ENVI's many raster processing functions.
  • Generate GIS maps using standardized ENVI annotation on either vector or image windows. Set border widths and background colors. Additional graphics colors have been added for ENVI 3.0 and are fully user-configurable. Automatically generate vector layer map keys. Insert objects such as rectangles, ellipses, lines, arrows, symbols, text, and image insets. Select and modify existing annotation objects. Save and restore annotation templates for specific map compositions.
  • Create ArcView Shape Files and associated .dbf attribute files and indexes, or DXF files from internal ENVI .evf format. New vector layers generated using ENVI's robust image processing capabilities, and changes made to vector layers in ENVI are easily exported to industry standard GIS formats.
  • Use ENVI's new direct printing capabilities to output to printers and plotters.

Concepts

ENVI's vector overlay and GIS analysis function generally follow the same paradigms as ENVI's raster processing routines. Standardized file opening procedures are used, as are the standard dialog boxes for selection of options and for file or memory output. The sections below describe some of the basic concepts.

ENVI Vector Files (.evf)

External vector files imported into ENVI are automatically converted to ENVI's internal vector format, which has the default file extension ".evf". This speeds processing and optimizes data storage. It is possible to utilize external vector files without creating an .evf file by simply selecting "Memory" as the output option when the file is first imported. In this case, no .evf file is created, and it will have to be converted again the next time the file is used.

The Available Vectors ListVector Overlay and GIS Analysis With ENVI - facegis.com

Much like the Available Bands List used to list and load image bands, the Available Vectors List provides access to all vector files open in ENVI (Figure 1). It automatically appears when vector files are opened and converted, or it can be started by selecting File->Available Vectors List on the ENVI Main menu. Vectors are loaded to either vector or image displays by selecting the vectors to load in the list and clicking on "Load Selected" at the bottom of the window. If an image window is displayed, the user has the option of loading the vectors to the display, or to a new vector window. In addition to listing and loading vector layers, the Available Vectors List provides utilities to open vector files, to start new vector windows, to create world boundaries (see below) and new vector layers, and to export analysis results to both Regions of Interest (raster-to-vector conversion), and as ARCView Shape Files and ancillary files.

Create World Boundaries

ENVI can utilize the IDL mapsets to generate both low- and high-resolution world boundaries in ENVI .evf vector format. Selected from the Available Vectors List, the user can create political boundaries, coastlines, rivers, and the USA state boundaries. High-resolution format is available only if the IDL high-resolution maps are installed. If these are not currently installed on your system, you can install them using the ENVI Installation CD, selecting the Custom Installation option and highlighting only the high-resolution maps.

Vector Overlay and GIS Analysis With ENVI - facegis.com

Figure 2: World Boundaries generated in ENVI.

The Vector Parameters DialogVector Overlay and GIS Analysis With ENVI - facegis.com

When vectors are loaded to a vector or image window, the Vector Parameters dialog appears to allow control of the way the vectors are displayed and the functions that are available for vector processing and analysis (Figure 3).

The Vector Parameters dialog provides for opening vector files, importing vector layers from the Available Vectors list, arranging vector layer precedence, setting plot parameters and annotating plots. It also controls the mode of operation in the vector or image display toggling between cursor query versus heads-up digitizing and editing. The Vector Parameters dialog is used to initiate ENVI's GIS analysis functions (Options->) including real-time Vector Information, Attribute Viewing and Editing, and Vector Query operations. Finally, the Vector Parameters dialog provides utilities for export of analysis results to industry-standard ARCView Shape Files with ancillary attribute files as well as raster conversion to ENVI's internal ROI format. The current configuration of vector overlays can also be saved to a template to allow simple reloading of the current vector overlays and overlay characteristics.

ENVI Attributes

ENVI provides access to fully attributed GIS data in the industry standard .dbf format associated with ARCView Shape Files. Attributes are listed in an editable table, allowing point-and-click selection and editing (Figure 4). Double clicking in a particular cell selects that cell for editing. Full column substitution using a uniform value is supported as is replacement with values from an ASCII file. Options include addition and deletion of individual columns and sorting data forward and backward based on information within a column. ENVI attributes can be saved to an ASCII output file, or to a .dbf file.

Vector Overlay and GIS Analysis With ENVI - facegis.com

Point-and-click spatial query is supported in ENVI Attribute tables to allow location of key features on either images or in a vector window. Specific records are selected by clicking on the label at the left edge of the table for a specific row in the table.The corresponding vector is highlighted in a contrasting color in the display or vector window.


Part 1: Stand-Alone Vector GIS in ENVI

This part of the tutorial demonstrates how to use ENVI as a simple stand-alone vector processing and analysis system for GIS data. The ESRI Data and Maps 1 CD-ROM data are used.

Start ENVI

Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.

  • To open ENVI in Unix, enter " envi " at the UNIX command line.
  • To open ENVI from a Windows or Macintosh system, d ouble-click on the ENVI icon.

The ENVI Main Menu appears when the program has successfully loaded and executed.

Open an ArcView Vector File (Shape File)

To open a vector file:

  1. Select File -> Open Vector File->ArcView Shape File

Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.

An Enter Input Data File file selection dialog appears.

  1. Navigate to the ESRI_GIS subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM just as you would in any other application and select the file CITIES.SHP from the list and click "OPEN".

The Import ArcView Shape File Parameters dialog will appear on your screen. This list allows you to select the file or memory output, enter the output filename for the ENVI .evf file, and choose the output projection for the data.

  1. Select Memory Output and choose the default values by simply clicking on "OK". A status window will appear indicating the number of vector vertices being read and the Available Vectors List will appear when the data have been converted.
  2. Alternatively, use Select File->Open Vector File->ENVI Vector File (.evf) to open the existing .EVF files.
  3. Select the vector layer to be loaded by clicking in the checkbox to the left of the CITIES.SHP entry in the Available Vectors List. Click on Load Selected to start a new vector window and the Vector Window Parameters dialog.
  4. Click on Apply in this dialog to load CITIES.SHP into the vector display.

The cities of the United States will be plotted in the vector display.

Work with Vector Point data

  1. Click using the left mouse button in the vector window and hold down the button and drag the cursor around the vector window to read latitude and longitude in the Vector Window Parameters dialog.
  2. Zoom in on just the contiguous 48 states by positioning the cursor just to the northwest of cities marked in the state of Washington and clicking and dragging using the middle mouse button to define a box covering the desired region.

Releasing the mouse button defines the lower right corner of the area selected and causes the display to be zoomed in on just that area. Multiple levels of zoom are possible. Clicking the middle mouse button anywhere in the display zooms out one level.

  1. Change the symbol used to mark the cities, by clicking on Edit Layers in the Vector Window Parameters dialog and selecting "Flag" from the pulldown Symbol menu. clicking on OK at the bottom of the dialog, then Apply at the bottom of the Vector Window Parameters dialog.

(You can add your own symbols by defining them in the file usersym.txt in the ENVI30/Menu directory of your ENVI installation.)

  1. Also experiment with changing other vector display characteristics by selecting Edit Layers and changing the desired characteristics (color, symbol, size) in the Edit Vector Layers dialog.

Create the USA state boundaries using IDL mapsets

  1. Select Options->Create World Boundaries in the Available Vectors List.

The Create Boundaries dialog appears.

  1. Click in the check box next to USA States, select the Memory radio button, and click on OK to create the USA Boundaries and load to the Available Vectors List.
  2. Click in the textbox next to USA States and then on the Load Selected button a the bottom of the Available Vectors List and choose Vector Window #1 in the Load Vector dialog as the location to load the vector. Click Apply in the Vector Parameters dialog to plot the vectors.

Both the cities previously selected and the state boundaries will be displayed in the vector window. The state boundaries in this case are polylines, that is, they are not true polygons (because of the way the were digitized and stored).

  1. Click on USA States in the Vector Parameters dialog and choose Edit Layers to change parameters for the state boundaries, including color, line style, and thickness. Remember to click on the Apply button in the Vector Parameters dialog to plot the changes.
  2. Clear the state boundaries by clicking on the Available Vector Layer USA States in the Vector Window Parameters dialog and then on Remove Layer.

Work with Vector Polygon Data

  1. Select File->Open Vector File->ArcView Shape File from the menu in the Vector Parameters dialog. Choose STATES.SHP and click on Open. Select Memory Output and choose the default values by simply clicking on "OK". A status window will appear indicating the number of vector vertices being read and the Available Vectors List will appear when the data have been converted.
  2. Alternatively, use Select File->Open Vector File->ENVI Vector File (.evf) to open the existing .EVF files.

This loads STATES.SHP into the Available Vectors List.

  1. Make sure that the USA States boundaries previously used are deselected in the Available Vectors List (no check mark in the box) and select STATES.SHP by clicking in the check box next to the name. Click on Load Selected and then Choose Vector Window #1 in the Load Vector dialog.
  2. Select STATES.SHP as the Available Vector Layer in the Vector Window Parameters dialog and click on Edit Layers and change the color to green and the fill to "line". Click on OK, then Apply in the Vector Window Parameters dialog to redisplay the vectors with changes applied.
  3. Change the vector layer precedence by selecting Options->Arrange Layer Order, clicking on one of the vector layer names in the Vector Layer Ordering dialog and dragging it to the desired position in the stack.

Get Vector Information and Attributes

  1. Select CITIES.SHP as the Available Vector Layer in the Vector Window Parameters dialog and choose Options->Vector Information to start the Vector Information window, listing attributes for each data point. Click and drag using the left mouse button on the city flags in the Vector window to see the basic attribute information from the ArcView .dbf attribute file.
  2. Find your hometown or the nearest city by examining the CITY_NAME attribute in the Vector Information dialog and then find the latitude and longitude by looking in the Vector Window Parameters dialog.

View Attributes and Point-and-Click Query

  1. Make sure that CITIES.SHP is selected and choose Options->View/Edit Attributes in the Vector Window Parameters dialog to start an ENVI Attributes table.

This is a fully editable table of the attributes for the selected layer.

  1. Click in the left column to do a spatial query on the selected city. The corresponding city flag will be highlighted in the vector window. If desired, zoom in on the specific city selected by clicking and dragging a box around the highlighted city using the left mouse button. Zoom back out by clicking the middle mouse button in the window.
  2. Verify that you have selected the correct city by clicking with the left mouse button on the city flag and observing the attributes in the Vector Information window.
  3. Edit the elevation value for the selected city by scrolling the ENVI Attribute window to the right until you can view the Elevation attribute, and double clicking with the left mouse button in the corresponding elevation table cell. Enter a new value and press the return (enter) key to change the value.
  4. Now do a map-based query by clicking on a city flag and observing that the corresponding record is highlighted in the ENVI Attributes table. Drag the vector cursor around the country from city flag to city flag and note how the ENVI Attribute table scrolls to follow the selected cities.

Query Attributes

  1. Make sure that CITIES.SHP is selected in the Vector Window Parameters dialog and select Options->Query Attributes. Enter a name for the layer to be generated in the Query Layer Name text box (use "Where State==California".) Click on the Start button to begin the query.

The Query Condition dialog will appear

  1. Click on the left button in the dialog (which starts with the "CITY_FIPS" attribute displayed), pulldown and select "STATE_NAME". Now choose the operator "==" from the list of options on the pulldown initially marked "<" in the center of the dialog. Finally, enter the string "California" (be sure to match case) in the String Value text box.
  2. When the Layer Attribute Query dialog appears, click the Memory radio button and the OK to begin the query.

ENVI creates a new vector layer with associated .dbf file based on the results of the query and lists the new layer in the Vector Window Parameters and the Available Vectors dialogs.

  1. Click Apply to highlight the selected vectors in the vector window in a new color.
  2. Zoom in on the selected vectors using the middle mouse button to drag and draw an outlining box around the state of California.
  3. Open the new .dbf attribute file by clicking on the new layer name in the Vector Window Parameters dialog and then selecting Options->View/Edit Attributes. When the ENVI Attribute table appears, try some point-and-click query operations as described above to see the association between the selected cities, their locations in the vector window, and the attributes.

The easiest way to find a specific city is to sort the attributes and then click on the city name.

  1. Click at the top of the CITY_NAME column in the ENVI Attribute table to highlight that complete set of attributes. Select Options->Sort by selected column forward to sort the column alphabetically. Now scroll down the column and click on "Sacramento" to highlight the location of the capital of California in a different color in the vector window.

Annotate Map Key in Vector Window

ENVI provides tools to generate a basic vector map from the ENVI Vector window. These are essentially the same as the annotation tools used for ENVI image and plot annotation, so no details are covered here. The description below demonstrates how to put a map key in the annotation window.

  1. Select Options->Annotate Plot in the Vector Windows Parameters dialog to begin. In the Annotation dialog, select Object->Map Key to automatically create a map key for the vector layers. Click the left mouse button in the Vector Display window to place and move the annotation. The characteristics of the key are controlled by clicking on Edit Map Key Items and selecting the desired changes. Return to placing the annotation by clicking OK. Click the right mouse button in the Vector window to finalize placement of the map key. All annotation in the vector window follows the same paradigms as annotation in ENVI display windows. See the descriptions of Annotation in the ENVI User's Guide for additional details.

Vector Overlay and GIS Analysis With ENVI - facegis.com

Figure 5: ENVI Vector Output

Close the windows and all files

  1. Click on Select All Layers in the Available Vectors List then on Remove Selected. Close the Available Vectors List by selecting File->Cancel.
  2. Close the vector window and all associate dialogs and tables by selecting File->Cancel in the Vector Window Parameters dialog.

This concludes Part 1 of the exercise.


Part 2: Combined Raster/Vector Processing Using ENVI

This section of the tutorial demonstrates how to use Vector Overlays and GIS data and attributes within ENVI in combination with raster images. Data from Space Imaging EOSAT are used.

Load Image Data to Combined Image/Vector Display

To open an image file to use as a backdrop for vector layers:

  1. Select File->Open Image File from the ENVI Main menu.

Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.

An Enter Input Data File selection dialog appears.

  1. Navigate to the SI_EOSAT subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM just as you would in any other application and select the file 0826_MS.IMG from the list and click "OPEN".

The Available Bands List will appear with four spectral bands listed. These data are a simulated 4-meter Space Imaging EOSAT multispectral dataset with spectral band coverage similar to the first 4 spectral bands of Landsat Thematic Mapper data.

  1. The bands to load into a color composite have already been selected using ENVI 3.0's default bands option in the ENVI header file. Click on Load RGB to load a true-color image into a new image display window.

Open a Vector Layer and Load to Image Display

  1. Click the right mouse button in the image display to toggle the Functions menu and choose Functions->Overlays->Vector Layers to start the Display Vector Parameters dialog.
  2. Select File->Open Vector File->ArcView Shape File from the menu bar in the Display Vector Parameters dialog, select the file VECTORS.SHP from the list and click "OPEN".
  3. You could also have used the File->Open Vector File->ArcView Shape File methods used above from the ENVI main menu to accomplish the same thing. ENVI provides several methods of accessing the vector overlays. Users can choose the method most consistent with their applications and approach to processing.

The Import ArcView Shape File Parameters dialog will appear on your screen. As described above, this list allows you to select the file or memory output, enter the output filename for the ENVI .evf file, and choose the output projection for the data.

  1. In the Import ArcView Shape File Parameters dialog, click on State Plane (NAD 83) as the Output Projection and select #404 California IV as the Zone by clicking on the Zone button, choosing zone #404 from the list in the Select State Plane Zone dialog and clicking OK. Select memory output and click on OK in the Import ArcView Shape File Parameters dialog to complete the projection selection.
  2. Alternatively, use Select File->Open Vector File->ENVI Vector File (.evf) to open the existing .EVF files.

A status window will appear indicating the number of vector vertices being read. When the data have been converted (.shp) or inported (.evf), the Available Vectors List will appear listing the VECTOR layer and the layer will be automatically loaded into the Display Vector Parameters dialog.

  1. Click on Apply in the Display Vector Parameters dialog to load the vectors into the image display as an overlay on the displayed image.
  2. Choose Edit Layers and change the color of the vectors to red, click OK, then Apply to reload the modified vectors onto the image.

Track attributes with cursor

  1. Select Options->Vector Information to start the Vector Information window and click and drag using the left mouse button in the image to view the attribute information for the vectors. Also observe the latitude and longitude listed in the Display Vector Parameters dialog. Select the Scroll and Zoom radio buttons in the Display Vector Parameters dialog to allow vector tracking in the corresponding window. Select the Off radio button to allow normal scrolling in the Scroll and Main Windows and zooming in the Zoom window. Try different zoom factors in the Zoom window to assess the accuracy of the vectors.
  2. Select Options->View/Edit Attributes in the Display Vector Parameters dialog to load the ENVI Attribute table for these data. Utilize point-and-click query as described for the vector-only case above by clicking in the left (numbered) column of the attribute table to find and highlight specific polygons on the image.

Heads-up (on-screen) Digitizing

ENVI provides vector editing routines for adding your own vectors to an existing vector layer or for creating new vector layers. These function in a similar fashion to ENVI's annotation polygons, polylines, and points. ENVI heads-up vector digitizing allows creation of new polygons, polylines, points, rectangles, and ellipses.

To add new objects to a vector layer choose the layer name first from the list in the Display Vector Parameters dialog. Then select Mode->Add New Object->Object, where Object is one of the object types described above. For the purposes of this exercise, we will create a new polygon layer

  1. To create a new layer, select Options->Create New Layer. Enter a name for the layer in the New Vector Layer Parameters dialog, choose the Memory radio button, and click OK.
  2. Click on the new layer name in the Display Vector Parameters dialog and a new .dbf file is initialized. Choose Mode->Add New Polygon to begin adding polygons to the layer.
  3. In the image display (Scroll or Zoom if selected using the radio button in the Display Vector Parameters dialog), click the left mouse button to draw polygon segments. Click the middle mouse button to erase polygon segments. Click the right mouse button to close the polygon, and a second time to accept the polygon. Polylines (line segments) are added the same way, while for points, clicking the left mouse button places the point, the middle deletes it, and the right mouse button finalizes the placement.
  4. Draw a few polygons using field outlines on the image as quides.
  5. To add Attributes to the newly created polygons, select Options->Add Attributes in the Display Vector Parameters dialog. Enter a name (Enter Field ID) for the attribute in the Name field in the Attribute Initialization dialog and choose the Type for the parameter (choose Character for this first one). Click on the Add Field button at the bottom of the dialog and enter a second attribute called "Field Area" in the Name field and change the Type to Numeric. Click OK to create the Attribute Table.
  6. Now edit the Attribute table as previously described. Double click on a field to make changes, enter the value, and press the return (enter) key. Use point-and-click query to see which attributes are associated with which fields.
  7. Close the Attribute table by selecting File->Cancel from the menu bar at the top of the table.

Edit Vector Layers

  1. In the Display Vector Parameters dialog, click on the new vector layer you created and select Mode->Edit Existing Vectors. Click using the left mouse button on one of the polygons you created previously.

The polygon will be highlighted and the nodes of the polygon will be marked with a diamond.

  1. You can delete the entire polygon by selecting Mode->Delete Vector in the Display Vector Parameters dialog.
  2. You can modify the vector by clicking on one of the markers with your left mouse button and dragging to a new location. The middle mouse button exits the editing function without making any changes. Clicking the right mouse button finalizes the changes and redraws the polygon.
  3. To finish up this section, delete any new layers you have made by selecting, those layers in the Available Vectors List and clicking on Remove Selected. Do not remove the VECTORS.SHP layer.

Query Operations

  1. Choose the VECTORS.SHP layer in the Display Vector Parameters dialog by clicking on the layer name. Select Options->View/Edit Attributes to start an ENVI Attributes table. Examine the `RANCH" attribute and note the predominance of three owners "gloria", "lanini", and `sharpe". Close the attribute table by selecting File->Cancel.
  2. Select Options->Query Attributes in the Display Vector Parameters dialog. Enter the Query Layer Name "Gloria Ranch" in the Layer Attribute dialog and click on the Start button. Choose RANCH from the pulldown button initially marked "AREA" set the condition to "==", and enter "gloria" for the string value (be sure to match the case seen in the Attribute Table). Click on OK. Select the Memory radio button in the Layer Attribute Query dialog and click OK again.

The new layer generated by the query is listed in the Display Vector Parameters dialog.

  1. Click on the layer name in the dialog and then on the Edit Layer button to change layer parameters. Choose Line for the fill type and then click OK. Click Apply in the Display Vector Parameters dialog.

The Gloria Ranch holdings are highlighted as a new layer.

  1. Examine the attributes for this layer by selecting the layer name in the Display Vector Parameters dialog and choosing Options->View/Edit Attributes. Examine the query results.
  2. Close the attribute table and repeat the query for the lanini and sharp ranches, highlighting each in a different color or pattern.
  3. Try other queries on combinations of attributes by choosing one of the logical operators in the Layer Attribute Query dialog.

Vector-to-Raster Conversions

ENVI provides several important links between vector analysis and raster image processing. This portion of the exercise describes how to take vector processing results, create Regions of Interest for use on the images, and extract region statistics and polygon area.

  1. To create Regions of Interest (ROI) for use with ENVI raster processing, click on the name of the layer to be exported to ROI. Select File->Export to ROI in the Display Vector Parameters dialog. Do this for several of the layers you created using the Query Operations above.

The layers will be listed in the Region of Interest Controls dialog.

  1. Click on the ROI name in the ROI Controls dialog and select Options->Report Areas of Regions->Meters 2 to generate a report of the area of the selected region.
  2. Click on the ROI name in the ROI Controls dialog and click on the Stats button at the bottom of the dialog to get the image statistics for the gloria ranch polygons in the multispectral data. Try the same thing for the other Queries you generated in the vector analysis and compare the areas and statistics.

Now that these vector polygons are ENVI ROIs, you can use the power of all of ENVI's raster processing capabilities to analyze the image data with respect to the ROIs. This includes such activities as masking, statistics, contrast stretching, and supervised classification.

Image-Map Output

ENVI provides tools to generate image maps from the combined raster/vector data in the ENVI Main Image Display window. These are essentially the same as the annotation tools used for ENVI image and plot annotation, so no details are covered here. The description below demonstrates how to put a map key in the Main Image display window.

  1. Generate a map-output image with a vector key using ENVI's image-map composition capabilities. Click the right mouse button in the Main Image Display to activate Functions menu and select Functions->Overlays->Annotation.
  2. Select Object->Map Key in the Annotation Map Key dialog to automatically create a map key for the vector layers. Click the left mouse button in the Main Image Display window to place and move the annotation. The characteristics of the key are controlled by clicking on Edit Map Key Items and selecting the desired changes. Return to placing the annotation by clicking OK. Click the right mouse button in the Vector window to finalize placement of the map key. All annotation in the vector window follows the same paradigms as annotation in ENVI display windows. See the descriptions of Annotation in the ENVI User's Guide for additional detail.

Vector Overlay and GIS Analysis With ENVI - facegis.com

Figure 6: ENVI Vector Overlays on Image.

Close the windows and all files

  1. Click on Select All Layers in the Available Vectors List then on Remove Selected. Close the Available Vectors List by selecting File->Cancel.
  2. Close the image window and all associated dialogs and tables by selecting File->Close All Files from the ENVI main menu.

Raster to Vector Conversions

ENVI can also easily convert raster processing results for use in ENVI vector processing and analysis, as well as for export to external GIS systems such as ArcView and ArcInfo. The last part of this tutorial illustrates the export of raster information to vector GIS.

Export ROI to Vector Layer

Regions of Interest defined using any of ENVI's standard methods can be exported to become one or more vector layers

Load Image Data to Image Display

Open an image file to use as background for ROI definition and export to vector:

  1. Select File->Open Image File from the ENVI Main menu.

Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.

An Enter Input Data File file selection dialog appears.

  1. Navigate to the Can_TM subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM just as you would in any other application and select the file CAN_TMR.IMG from the list and click "OPEN".

The Available Bands List will appear with the Canon City TM data spectral bands listed. The band to load into a grayscale image has already been selected using ENVI 3.0's default bands option in the ENVI header file.

  1. Click on Load Band to load a grayscale image of TM band 3 into a new image display window.

Load Predefined ROIs

Some Regions of Interest have been predefined using ENVI's interactive ROI definition tools.

  1. Click the right mouse button in the Main Image Display window to toggle the Functions menu and choose Functions->Region of Interest->Define Region of Interest to start the Region of Interest Control dialog. Select File->Restore ROIs in the ROI Controls dialog and select the ROI file CAN_TM1.ROI and click Open.

The predefined ROI will be loaded into the ROI Controls dialog and plotted on the image.

  1. Repeat the above step for the file CAN_TM2.ROI.

The result is two ROIs overlain on the TM Band 3 data.

Convert ROIs to Vector

  1. To convert these ROIs to vector polygons, select File->Export ROI to EVF in the ROI Controls dialog. The Export Regions to EVF dialog appears. Choose one of the regions by clicking in the check box to the left of the Region name. Choose the "All points as one record" radio button option, enter a Layer Name in the appropriate text box, click on Memory, and then OK to convert the first ROI and import to the Available Vectors List. Repeat the procedure for the second ROI.
  2. In the Available Vectors List, click on Select All Layers, then the Load Selected button. Select New Vector Display in the Load Vector dialog to start a new vector window and load the new vector polygons into the Vector Window Parameters dialog. Click Apply to load the polygons. Choose Options->Add Attributes to add attributes to the polygons. These can now be used in Query and GIS analysis with other vector data or exported to ArcView Shape Files by selecting File->Export Layer to ArcView in the Vector Window Parameters dialog.

Close the windows and all files

  1. Click on Select All Layers in the Available Vectors List then on Remove Selected. Close the Available Vectors List by selecting File->Cancel.
  2. Close the Vector display window by clicking on File->Cancel in the Vector Window Parameters dialog.
  3. Close the image window and all associated dialogs and tables by selecting File->Close All Files from the ENVI main menu.

Export Classification Image to Vector Polygons

Classes defined using any of ENVI's standard classification methods can be exported to become one or more vector layers (Raster-to-Vector conversion). ENVI also allows selection of individual image brightness levels for export as a vector layer.

Load a Classification Image to Image Display

Open an image file to use as background for ROI definition and export to vector:

  1. Select File->Open Image File from the ENVI Main menu.

Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.

An Enter Input Data File file selection dialog appears.

  1. Navigate to the Can_TM subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM just as you would in any other application and select the file CAN_PCLS.IMG from the list and click "OPEN".

This is a parallelepiped classification of the Canon City TM data with 3 classes.

  1. The Classification image will appear in the Available Bands List. Load this image into a grayscale image by clicking on the band name, and then on Load Band.

Generalize the classification image.

To conduct successful raster-to-vector conversions, it is usually necessary to generalize the results of raster processing. If you don't do this, you end up with vector polygons around individual pixels and small groups of pixels.

  1. To demonstrate the results of generalization of the classification image, load and display the results of a 5 pixel sieve operation followed by a 5 x 5 clump operation. First display CAN_SV.IMG, the sieve results. Next display CAN_CLMP.IMG, the clump results.
  2. Convert the generalized classification image to vector polygons. Select Classification->Post Classification->Classes to Vector Layers. Choose the CAN_CLMP.IMG classification for processing by clicking on the image name and then the OK button in the Raster to Vector Input Band dialog.

Create the Vector Polygons

  1. Select Region #1 and Region #2 by clicking in the check boxes next to the region descriptions. Select memory execution and click OK. A status dialog will appear while the vectorization takes place and the new vector layers will appear in the Available Vectors List.
  2. Select the two layers by clicking in the check boxes next to the names, click on Load Selected, and choose Display Window #1 to display as vector outlines on the clumped classification image.
  3. Alternatively, select Vector Window #1 in the Load Vector dialog to display in an ENVI vector window. Click on Apply in the Vector Window Parameters dialog to load the selected vectors into the vector display.
  4. Examine the vector layer and the results of the vectorization of raster classification. Click on Edit Layers and change the vector layer parameters for improved display by filling the polygons if desired. Also overlay back onto the CAN_TMR band 3 image if desired for comparison.

Vector Overlay and GIS Analysis With ENVI - facegis.com

Figure 7: ENVI Raster-to-Vector Conversion Result.

This concludes the exercise. Click on Exit on the ENVI Main Menu to exit ENVI.

Source: http://www.ltid.inpe.br