Overlay Grid Lines
If a view contains a standard, RPC, or pseudo spatial reference, you can overlay grid lines in that view. This topic describes how to work with grid lines. See the following sections:
You can also write a script to overlay grid lines using the ENVIView::CreateGridLinesLayer method and the ENVIGridLinesLayer routine.
Introduction
Once a view contains a base projection from displaying a raster, vector, or other projected layer, click the Annotations drop-down list in the ENVI toolbar and select Grid Lines.
Note: You can also select File > New > Grid Lines Layer from the menu bar. Or, right-click on a View layer in the Layer Manager and select New > Grid Lines Layer.
A default set of grid lines displays in the view. Coordinate labels also display along the edge of the grid in the default units of the coordinate system. The Layer Manager lists a new Grid layer. The grid line properties are displayed below the ENVI Toolbox.
To remove grid lines from the view, right-click on the Grid layer in the Layer Manager and select Remove.
You can also add multiple sets of grid lines, each in a different coordinate system. Click the Annotations drop-down list and select Grid Lines again to display the Select Coordinate System dialog. After choosing a new projection and clicking OK, the new grid lines will overlay the original grid lines. A new Grid layer for that projection is added to the Layer Manager. The following figure shows an example of displaying State Plane coordinates (yellow) along with Geographic WGS-84 latitude and longitude coordinates (pink):
Change Grid Line Properties
Properties of a grid line layer are displayed beneath the Toolbox in the lower-right corner of the ENVI application. Update the following properties as needed.
- Coordinate System: The coordinate system associated with the grid lines. To change to a different coordinate system, click the white space in the Coordinate System field. Click the arrow button that appears. Refer to the Select Coordinate Systems topic for further instructions.
- X Spacing: The spacing of grid lines in the X-direction, in the units of the current coordinate system (for example, in meters for a UTM projection).
- Y Spacing: The spacing of grid lines in the Y-direction, in the units of the current coordinate system.
- Show Grid Lines: This property is set to True by default to display the inner grid lines. Set it to False to hide the inner grid lines.
- Show Intersections: This property is set to True by default to display crosshairs at grid line intersections. Set it to False to hide the intersections.
- Show Bounding Box: This property is set to True by default to display a bounding box along the edge of the grid.
- Show Text: This property is set to True by default to display coordinate labels along the outside edge of the grid. Set it to False to hide coordinate labels.
- The next nine properties pertain to coordinate labels: Text Font Name, Text Font Style, Text Color, Background Method, Background Color, Text Orientation X-Axis, Text Orientation Y-Axis, Text Offset. The Text Offset property controls how far away the coordinate labels are from the grid lines.
- Geographic Format: Select a format for displaying coordinates when the grid represents a geographic coordinate system. The choices are Degrees, Minutes, Seconds (default), Degrees (in decimals), and Degrees, Minutes.
- Geographic Precision: Select the number of decimal places displayed for any Geographic Format setting.
- Grid Color: Choose a color for the grid lines and bounding box (if displayed).
- Grid Thickness: Set the thickness, in pixels, for the grid lines, intersections, and bounding box.
- Grid Linestyle: Set the line style of the grid lines, intersections, and bounding box.
- Intersection Symbol Size: Set the size, in pixels, of grid line intersections when Show Intersections is set to True.
These settings persist until you close the ENVI session. To retain these settings for all ENVI sessions, use the Annotation Grid Line preferences in the ENVI Preferences dialog.
Create Output
Choose one of the following options to export a dataset with grid lines to a file on disk:
- Use the File > Export View to > Image File menu option to save raster layers with gridlines to RGB 24-bit image files.
- Use the File > Chip View to > Powerpoint option to export vector and raster layers with gridlines to a Powerpoint presentation.
Examples
The following example shows how to display intersections only. Grid lines, intersections, and bounding boxes all inherit the same values when you change the Grid Color, Grid Thickness, and Grid Linestyle properties.