Segment direction histogram
Algorithm
The Segment direction histogram operation calculates directions and lengths within segments, i.e. between all stored coordinates of the segments. The output is a table with directions from 0 to 179° and the length and number of the segment parts in that direction.
Steps:
- The program scans the map segment by segment.
- Within each segment, i.e. between all stored coordinates in a segment, directions are calculated. This means that not the total direction of a complete segment is calculated but the direction from the begin node to the first intermediate point, from the first intermediate point to the second, etc., until the end node. Figure 1 and Figure 2 below show segments with and without intermediate points.

|

|
Fig. 1: Segments without intermediate points.
|
Fig. 2: Segments with intermediate points.
|
- The compass directions are sorted from 0 to 179°.
- Then, for each direction:
- when the segments in the map have no intermediate points at all, the total lenghts of segments in that direction and the number of segments in that direction are calculated;
- when the segments do have intermediate points, the total length of the segment parts in that direction and the frequency of the segment parts in that direction are calculated.
See also:
Segment direction histogram : functionality