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:

  1. The program scans the map segment by segment.
  2. 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.
  3.  

    Fig. 1: Segments without intermediate points.

    Fig. 2: Segments with intermediate points.

     

  4. The compass directions are sorted from 0 to 179°.
  5.  

  6. Then, for each direction:

See also: