Elongation ratio

This tool can be used to calculate the elongation ratio for polygons. It will work for either raster or vector input files. If a raster file is input, the grid should contain polygons with unique identifiers. Raster input files also require the name of the output raster file (where the elongation ratio will be assigned to each feature in the input file), the specified option of outputting text, and whether or not zero values should be treated as background values. If a vector shapefile is specified as the input file, the only required input is the name of the file. The elongation ratio values calculated for each vector polygon feature will be placed in the accompanying database file (.dbf) as an elongation field (ELONGATION) and an elongation direction field (ELONG_DIR). The resulting database file will be automatically displayed after the tool has completed.

The elongation ratio (E) is:

E = 1 - S / L

Where S is the short-axis length, and L is the long-axis length. Axes lengths are determined by estimating the minimum bounding box.

The elongation ratio provides similar information as the Linearity Index. The ratio is not an adequate measure of overall polygon narrowness, because a highly sinuous but narrow polygon will have a low linearity (elongation) owing to the compact nature of these polygon.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputFile = wd + "polygons.shp" # vector input
outputFile = "" # ignored for vector input
textOutput = "false" # also ignored
zerosAreBackground = "false" # also ignored
args = [inputFile, outputFile, textOutput, zerosAreBackground]
pluginHost.runPlugin("ElongationRatio", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "polygons.dep" // raster input
def outputFile = wd + "output.dep"
def textOutput = "true"
def zerosAreBackground = "true"
String[] args = [inputFile, outputFile, textOutput, zerosAreBackground]
pluginHost.runPlugin("ElongationRatio", args, False)

Credits: