ArcToolbox banner

Create Lines From Vector Component Rasters

Given rasters representing the x and y components of a vector field, such as the u and v rasters for ocean currents, this tool creates a feature class of lines representing the vectors, similar to a "quiver plot".


Command line syntax

ArcGISLinesFromVectorComponentRasters_GeoEco <xRaster> <yRaster> <lines> <scaleFactor>

Parameters
ExpressionExplanation
<xRaster>

Raster representing the X components of the vector field, where positive values indicate rightward flow and negative values indicate leftward flow.

If you are running this tool on ocean currents rasters, provide the u raster for this parameter.

<yRaster>

Raster representing the Y components of the vector field, where positive values indicate upward flow and negative values indicate downward flow.

This raster must have the same coordinate system, extent, dimensions, and cell size as the X components raster.

If you are running this tool on ocean currents rasters, provide the v raster for this parameter.

<lines>

Line feature class to create.

The feature class will contain one line for each raster cell that contains data (both X and Y component values). The line will originate at the cell center and have the length and direction described by the component values. The length will be adjusted by the Scale Factor parameter.

Each line will have two attributes:

  • Magnitude - the unscaled magnitude of the vector, computed from the component values using the Pythagorean theorem.

  • Direction - the direction of the vector, in degrees, where 0 is right, 90 is up, -90 is down, and 180 is left.

<scaleFactor>

Factor for scaling lines lengths.

Use this parameter to scale the lines output by this tool to lengths that are visually appealing. If the lines are too short, they will resemble a grid of dots and you will not be able to discern the flow of the vector field. If the lines are too long, they will overlap each other and resemble a plate of spaghetti.

If the vectors all have about the same magnitude, then a good approach is to scale the lines so that the longest one is about as long as the raster cell size. But if there are a few very long vectors, then you may prefer to scale the lines so that the average-length vector is as long as the raster cell size.

To estimate an appropriate scale factor, divide the cell size by your estimate of the maximum (or mean) unscaled line length. For example, if the cell size is 25,000 meters, and the input grids represent ocean current velocity in centimeters per second, and you believe the maximum (or mean) velocity is about 200 cm/s:

scale factor = 25000 / 200 = 125

If the rasters represented velocity in meters per second:

scale factor = 25000 / 2 = 12500

Use a scale factor of 1 to indicate that the lines should not be scaled.

Scripting syntax

ArcGISLinesFromVectorComponentRasters_GeoEco (xRaster, yRaster, lines, scaleFactor)

Parameters
ExpressionExplanation
X components raster (Required)

Raster representing the X components of the vector field, where positive values indicate rightward flow and negative values indicate leftward flow.

If you are running this tool on ocean currents rasters, provide the u raster for this parameter.

Y components raster (Required)

Raster representing the Y components of the vector field, where positive values indicate upward flow and negative values indicate downward flow.

This raster must have the same coordinate system, extent, dimensions, and cell size as the X components raster.

If you are running this tool on ocean currents rasters, provide the v raster for this parameter.

Output line feature class (Required)

Line feature class to create.

The feature class will contain one line for each raster cell that contains data (both X and Y component values). The line will originate at the cell center and have the length and direction described by the component values. The length will be adjusted by the Scale Factor parameter.

Each line will have two attributes:

  • Magnitude - the unscaled magnitude of the vector, computed from the component values using the Pythagorean theorem.

  • Direction - the direction of the vector, in degrees, where 0 is right, 90 is up, -90 is down, and 180 is left.

Scale factor (Required)

Factor for scaling lines lengths.

Use this parameter to scale the lines output by this tool to lengths that are visually appealing. If the lines are too short, they will resemble a grid of dots and you will not be able to discern the flow of the vector field. If the lines are too long, they will overlap each other and resemble a plate of spaghetti.

If the vectors all have about the same magnitude, then a good approach is to scale the lines so that the longest one is about as long as the raster cell size. But if there are a few very long vectors, then you may prefer to scale the lines so that the average-length vector is as long as the raster cell size.

To estimate an appropriate scale factor, divide the cell size by your estimate of the maximum (or mean) unscaled line length. For example, if the cell size is 25,000 meters, and the input grids represent ocean current velocity in centimeters per second, and you believe the maximum (or mean) velocity is about 200 cm/s:

scale factor = 25000 / 200 = 125

If the rasters represented velocity in meters per second:

scale factor = 25000 / 2 = 12500

Use a scale factor of 1 to indicate that the lines should not be scaled.