>  Docs Center  >  Using ENVI  >  Count Features

ENVI

Count Features

Feature Counting Tool

Use the Feature Counting Tool to count up to 5000 individual features in raster and vector data. Examples of using the Feature Counting Tool include counting roads, buildings, water bodies, trees, and livestock.

You can create separate feature types and count within each type. For example, create one type for water bodies and another for buildings. You can also overlay a grid on the image and count within the gridded areas. This can be useful for large images, where multiple users need to perform feature counting within different areas of the image.

Count and Manage Features


  1. Click the Feature Counting Tool button . A Feature Counting layer is added to the Layer Manager, and the Feature Counting Tool dialog appears with the following default settings. You can change the defaults.

    • Feature 1 is the name of the first feature group. The name appears as a label in the Image window view if the Label check box is enabled. To change the name, click in the name field, enter a new name, and press the Enter key.
    • Red is the color of the first feature group. The features you click for this group will be marked in a red symbol and text. To change the color, click the Feature Color drop-down list from the toolbar. You can choose ENVI, System, or pre-defined Custom colors in the Standard tab, or select the Custom tab on the color palette to create a custom color.
    • Symbol is enabled, with a balloon as the default symbol that will be visible in the view. Disable the check box to hide the symbol.
    • Label is enabled so the feature group label will be visible in the view. Disable the check box to hide the label.
    • Description is enabled so the description of the point will be visible in the view. Disable the check box to hide the description.
    • Count is enabled to show count number of each feature in the view. Disable the check box to hide the count.
    • Grid is disabled. When enabled, a grid is overlaid on the view and the feature count will include grid values (A1, A2, and so forth) and the count number (if Count Number is enabled). When enabled, the default grid size is 4x4 pixels, but you can change the grid size by entering different values in the fields provided. For details on using a grid, see Feature Counting with a Grid.
    • Coordinates is enabled so the coordinates of the point will be visible in the view. Disable the check box to hide the coordinates. When Coordinates is enabled, a drop-down list next to the check box allows you to select the units to display (File, Map, Lat/Lon, or MGRS).
  2. To count features, click on features in the view, or hover the cursor over a feature and press the Enter key. A record for the feature is added to the Feature Counting Tool table. If needed, you can delete a feature record by pressing the Backspace key. If you used the default settings in the Feature Counting Tool dialog, the symbol, feature label, and count will display in the view, as shown below.

  3. To create a new feature type to count, click the Add Feature button .

To create a custom color:

  1. In the Custom tab, use the color space table to select a color, or enter R,G,B or H,S,L values in the fields provided.
  2. Use the slider below the color space table to adjust the color gradient.
  3. Click OK to add the new color to the Custom colors section on the Standard tab.

To manage the Feature Counting Tool table:

  • By default, the record for a marked spot appears in the table in the color defined for that feature. So, if Feature 1 was red and Feature 2 was green, the table would display Feature 1 and Feature 2 text in their respective colors. To display the table records in black-text only, select Options from the Feature Counting Tool menu and toggle off Colored Text in Table.
  • The default coordinate included in the table is MGRS. To show coordinates in other formats, right-click one of the table columns and select File x,y, Map x,y, or Lat/Lon to show the selected coordinates in new table columns. You can select one coordinate format, or all formats, and you can toggle off any coordinate options you do not want to show in the table.
  • When multiple records are listed in the table, you can sort them. Select a table column, then right-click and select Sort by Original Order, Sort by Selected Column Forward, or Sort by Selected Column Reverse.
  • To jump to a counted feature and center it in the middle of the Image window view, click on the row number for that record. You can also use the GoTo arrow buttons at the bottom of the dialog to step through the records in the table.
  • To delete a record, select the row of the record to delete in the Feature Counting Tool table, then click the Delete button . To delete all feature counting records, click the Delete All button .
  • To delete the selected feature and all of its records, click the Delete Feature button . To delete all features and their records, click the Delete All Features button .

Feature Counting using a Grid


When the Grid check box is enabled, a grid is overlaid on the raster. The size of the grid is not based on the projection of the raster.

When you enable the grid, it is overlaid on the topmost layer listed in the Layer Manager and the features that are counted are related specifically to that raster. If you have multiple rasters open and want the grid and the feature counting to be related to a different raster, select Options > Grid Layer Host from the Feature Counting Tool menu bar and select a different raster.

The image below shows an example of how feature counting is incremented when it is done without a grid. The count increments numerically in the order in which items were clicked, no matter where is located in the view.

When the Grid check box is enabled, the grid appears with the x-axis grids labeled alphabetically and the y-axis grids labeled numerically.

Counting in the grid enabled is incremented by grid position first, then the count number of the item, as in the example below. If you click outside the grid, there will not be a grid number, for example, Feature 1 ** [1]. When you toggle on and off the grid, the numbering will toggle between the non-grid numbering shown previously, and the grid-style numbering shown below.

Save, Export, and Restore Feature Counting Files


To save the feature counting records, select one of the following from the Feature Counting Tool menu bar:

  • To save feature counting records to the current file format, select File > Save.
  • To save feature counting records to a different file format, select File > Save As and enter a name for the .efc file.

To export feature counting records to other formats, select one of the following from the Feature Counting Tool menu bar:

  • File > Export to Shapefile, to save to a .shp file format.
  • (Available for ENVI 32-bit only) File > ArcGIS Geodatabase, to save to a .gdb geodatabase file format.
  • File > Report, to save to a .txt file format.
  • File > Export > Comma-Separated Values (CSV), to save to a .csv file format.

To restore feature counting records from another file:

  1. Select File > Restore from the Feature Counting Tool menu bar.

    One of the following appears:

    • If you have unsaved marked features on the raster, you are prompted to save them in the Save Features dialog.
    • If you do not have unsaved marked features, the Restore Features dialog appears.
  2. In the Restore Features dialog, select an .efc or .dbz file.
  3. Click Open to open the Feature Counting layer.

Edit Feature Counting Properties


Click the Feature Counting Properties button in the Feature Counting Tool dialog to open the property sheet. When you change the defaults for a property, all the records of the selected feature group are automatically updated with the new setting.

  • Feature Name: The name of the feature group. The system default is Feature n, where the number increments by 1 for each new group added.
  • Feature Color: The text and symbol color for the feature group. The system default is red for the first feature group, then green, then blue, and so forth.
  • Description: A brief description of the feature. By default, this field does not contain a description.
  • Text Font Size: The font size for the label, count, and symbol. The default is 12.
  • Symbol: Select a symbol style to display as the feature marker. The default is a flag.
  • Symbol Font Name: The font type for the symbol. The default is ENVI Symbols.
  • Symbol Horizontal Alignment: The horizontal margin to offset the symbol from where you clicked in the view to count the feature. The default is .5. You can also adjust the position by clicking and dragging the symbol graphic on the right side of properties sheet.
  • Symbol Vertical Alignment: The vertical margin to offset the symbol from where you clicked in the view to count the feature. The default is -.18. You can also adjust the position by clicking and dragging the symbol graphic on the right side of properties sheet.
  • Show Symbol: Show or hide the symbol in the view. The default is Yes.
  • Label Font Name: The font type for the label and count text. The default is Calibri.
  • Label Position: The alignment of the label in relation to the feature marker. The position can be Right, Left, Above, Below, or Centered. The default is Right.
  • Show Label: Show or hide the label in the view. The default is Yes.
  • Show Count: Show or hide the feature count number in the view. The default is Yes.



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