Use the Filter Vector tool to create a new shapefile containing only vector records that fall within specified minimum and/or maximum values.

You can also write a script to filter vectors using the FilterVector task.

  1. From the Toolbox, select Vector > Filter Vector.
  2. In the Input Vector field, select a polyline or polygon shapefile, GeoPackage file, ENVI vector file, or GeoJSON file.

  3. The units of the vector file (meters, feet, etc.) are displayed beneath the Input Vector field.

  4. Optional: In the Minimum Value field, specify the minimum area (for polygons) or length (for polylines) to consider. Values less than the minimum will be discarded in the output shapefile. The units depend on the coordinate system of the input vector; however, you can override these units by choosing a Units value.
  5. Optional: In the Maximum Value field, specify the maximum area (for polygons) or length (for polylines) to consider. Values greater than the maximum value will be discarded in the output shapefile. The units depend on the coordinate system of the input vector; however, you can override these units by choosing a Units value.
  6. Optional: Since the minimum and maximum areas/lengths may not be readily apparent, interactive tools are available to help you determine suitable values. Click the Select Value button next to the Minimum Value and Maximum Value fields. In the Select Minimum Area or Select Maximum Area dialogs, use the slider to select minimum and maximum areas or lengths to keep in the final shapefile. These dialogs report the percentage of records that will be dropped from the original vector files.
  7. Optional: From the Units drop-down list, select the units of the Minimum Value and Maximum Value, if you specified those. If you can keep the default selection of (Undefined), the units of the values will be the same as the coordinate system of the input vector. In this case, the units will be the same as the coordinate system of the input vector. However, if it is easier to specify the values in units that you are more familiar with, select the preferred units from the Units drop-down list.
  8. Specify the path and filename for the Output Vector.
  9. Enable the Preview check box to preview the settings before processing the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option. Depending on the algorithm being used by the tool, the preview result might be different from the final result of processing on the full extent, full resolution of the input image in the following scenarios: 1) If you zoomed out of the input raster in the view by 50%, or a percentage less than 50%, ENVI uses a downsampled image at the closest resolution level to calculate the preview, or 2) If the entire image is not visible in the view, ENVI uses the subset in the viewable area of the input image to calculate the preview.
  10. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  11. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow next to the OK button , select Save Parameter Values, then specify the path and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously saved your settings.

  12. You can run the process in the background on your computer or in the background on an ENVI Server (if available). Click the down arrow next to the OK button and select one of the following:

    • Run Task in the Background: Runs the process on your computer. This method does not use an ENVI Server. The job progress will show in the ENVI Job Console's Background Jobs tab.
    • Run Task on envi_server_name. Runs the process on the selected ENVI Server. The job progress will show in the ENVI Job Console's envi_server_name tab.

    See ENVI Job Console for details on monitoring ENVI Server jobs and viewing results. See ENVI Servers for details on configuring and using an ENVI Server.

  13. Click OK.

See Also


Smooth Vectors, Vector to Bounding Box , Vector to Centroid, Reproject Vectors