The QGIS Line Direction Histogram Plugin creates a rose diagram that can be used to investigate the distribution of the directions of line segments of a line or polygon vector dataset.
The accumulated lengths of the line segments for each direction bin determines the shape of the histogram. Alternatively, the number of segments can be used (no weighting on line segment length).
Line and Polygon vector layers are supported, including multigeometries.
Feature selections are supported.
The number of direction bins for the histogram can be specified.
Fewer bins | More bins |
---|---|
![]() |
![]() |
All the direction bin sectors will have the same size (same number of degrees covered). This type of angle histogram is also called a “rose diagram” or “rose plot”.
An angle offset (positive or negative - clockwise or counter clockwise) for the direction bins can be specified.
The positions of the direction bins are shown graphically.
Direction bins illustration and options |
---|
![]() |
The user can choose if the histograms shall be “orientation” neutral (0-180 degrees instead of 0-360 degrees).
Orientation neutral | Not orientation neutral (with twice the number of bins) |
---|---|
![]() |
![]() |
Added in version 2.0.
There is an option available for producing at point layer styled using rose diagrams (using SVG files) according to a tiling specified using a polygon layer.
All the other options are also respected when generating the rose diagrams for the tiles.
Due to a QGIS issue with SVG file caching (#13565: “modifying a svg already cached doesn’t invalidate the cache, renders as version initially loaded during a session”), the SVG files have to be stored using unique file names. This produces a lot of SVG files that are not deleted by the plugin.
Added in version 2.6.
When saving the tile mean directions to CSV, the result is a CSV file with three columns:
Added in version 2.4.
An indication of the direction mean (direction and strength) can be added to the rose diagrams.
Direction mean | |||
---|---|---|---|
Not or. neutral | Orientation neutral | ||
medium | low | high | |
![]() |
![]() |
![]() |
![]() |
The displayed histogram is normalised, so that the maximum value of the direction bins will result in a sector with a maximum length, and the lengths of the sectors of the rest of the bins are scaled proportionally.
The saved histogram is a CSV file with four columns:
”.” is used as the decimal separator in the CSV file.
The CSV file is accompanied by a CSVT file that describes the data types of the CSV file columns.
The following options are available:
The calculations of the histogram is performed in a separate thread. Each line geometry is traversed from start to end. For each segment of the line, the angle and length are calculated. The angle is used to determine which bin the segment falls into, and the length is added to the accumulated length for the bin.
Polygons are split into its rings, and the line geometry of each ring is used for the calculations.
The normalised mean direction vector (dist_mean) is calculated using vector summation from the bins (sectors). Each sector is represented by a vector (sector) with length equal to the total length of the line segments in the sector. The middle of the bin’s sector is used as the angle for the sector vector. The result vector is normalised by dividing by the sum of the bin / sector line lengths.
The mean direction is found by calculating the magnitude of the “direction trend” for each of the bins.
The “direction trend” for a bin, B, is calculated using the values for all the bins within 90 degrees offset from the angle of B. For each bin (including B), the angle between that bin and B is calculated (using the angles of the middle of the bin sectors), and the cosine of that angle is multiplied by the bin value.
The “direction trend” of B is the sum of these values. The bin with the largest value is taken to represent the direction mean.
The value is then normalised to a [0..1] scale using the the sum of the bin values (total_sum) as the maximum value, and the value that had been obtained (even_dist_value) if the distribution of line segment lengths among the bins had been even, as the minimum value.
The current version is 2.6
1.0: First official version.