# Compute Distance Raster from Geometric

## Overview

The Compute Distance Raster from Geometric process is used to create a distance and direction raster. A distance raster has cell values that represent the distance from features of interest in the input raster. Cell values in the direction raster indicate the direction towards the closest feature of interest relative to that cell location.

Features of interest are specified by selected elements in a vector, CAD or shape object (or shape file). Output Distance Units can be specified in cells or map units.

## Try It

Prerequisite Skills: Getting Started and Displaying Geospatial Data.

Sample Data: the stanton_hydrography.rvc file in stanton.zip

Tutorial Lesson: The exercise below provides an introduction.

#### Exercise – Run Compute Distance Raster from Geometric

To run the process: load the input vector, specify elements to use, set output image grid, and run.

1. select Image > Spatial Analysis > Compute Distance Raster from Geometric from the TNTmips menu bar
2. click the Object button and add the stanton_hydrography.rvc / Merge vector
3. in the Selection panel, set it to use all lines (Line, All)
4. set up the output image grid by matching another raster (in Image Grid Alignment section, turn on Match Existing Raster and when prompted select one of the rasters in stanton_landsat8.rvc for Match Image)
5. Notice the Reference System is set. The Extents and Cell Size are automatically set too.

6. use defaults in the Distance panel (Cell Type: 32–bit floating point, Distance Units: cells, Pallette: CET Uniform Rainbow bgyr 35-85 c73 and Reversed toggle off)
7. optionally create a direction raster — in the Direction panel set Cell Type: 32–bit floating point, Orient:Clockwise from Raster Top. (Leave Cell Type: None if you do not want to create a direction raster.)
8. open the Display process and add the raster(s) you made

## Input

### Geometric Elements

The process takes a vector, CAD, or shape object (or shapefile) as input. Then use the Selection, Element options to choose what elements you want to compute the distance from. For all input types, you have options to include all elements, elements selected in the View, or elements selected via a database query. However, if the input is a vector you will first limit the element type to either point, line, or polygon.

## Results & Output

The process outputs a distance raster and optionally a direction raster. Output rasters can be 32– or 64–bit data type. You have the option of setting a color palette to use when displaying it.

distance raster – has cell values specifying the distance to the nearest feature of interest.

direction raster – has cell values that specify the direction (0 to 360 degrees) towards the nearest feature of interest. The direction is aligned based on the Orient setting. For example if you set Orient to Clockwise from Raster Top, then a cell value of 0 indicates the closest feature is in the direction towards the top of the raster. Cell values increase in the clockwise direction so for this example 180 points towards the bottom.

## Interface

The Compute Distance Raster from Geometric is the main window used in the process.

### Input pane

Object – select a geometric object or shape file.

### Selection pane

Element – select the elements to compute the distance from. You can specify the elements of interest using the All, By Element, and By Script options. In addition, vector objects require you to choose the type of element: Point, Line, or Polygon. For more information, see the Geometric Element Selection section.

### Image Grid Alignment, Extents, Cell Size, and Image Size panes

Specify the output raster's grid, extents, cell size, and image size using these four panes. For more information, see the Raster Grid Controls section.

### Distance pane

Options here are used to set up the output distance raster:

Cell Type – 32– or 64–bit.

Distance Units – for output cell values are either the number of cells or a conventional unit of measurement (i.e. meters, kilometers).

Palette – menu to select color palette used when displaying the distance raster. The Choose option opens the Select Palette window.

Reversed toggle – reverse the order of the palette.

### Direction pane

Options here are used to set up the output direction raster:

Cell Type – 32– or 64–bit rasters as above, plus the None option to prevent making the direction raster.

Orient – specifies the direction for cell value of 0. Thus this option sets up cell values with a specific direction — moving clockwise from 0 towards 360 degrees. Choices are: Clockwise from Raster Top, Clockwise from Projection North, Counter–Clockwise from Raster Right, and Counter–Clockwise from Projection East.

Note, a cell value indicates the direction from that cell towards the closest features. Example: if you set Orient to Clockwise from Raster Top, a cell values of 0 indicates the closest feature is above that cell (or below if 180).

Palette – menu to select color palette for the output direction raster. The Choose option opens the Select Palette window. For best results, a cyclic palette is recommended to make the color changes continuous.

Reversed toggle – reverse the order of the palette.