Package sabx10 :: Package map :: Module elevations :: Class PointsProcessor
[hide private]
[frames] | no frames]

Class PointsProcessor

source code

object --+
         |
        PointsProcessor
Known Subclasses:

Encapsulates a set of points representing a line and all the operations we might want to do on it.

Instance Methods [hide private]
 
__init__(self, points)
Calculate and store the distance and rise between each pair of points in the list.
source code
float
calc_points_distance(self)
Calculate the length of the line.
source code
(float,float)
calc_points_rise(self)
Calculate the cumulative rise for the line.
source code
(float,float)
calc_points_fall(self)
Calculate the cumulative fall for the line.
source code
list of (float,float)
calc_points_climbs(self)
Create a list of climbs in the line.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
list of (float,float) intras
intra-point values used for all our calculations, in the form of a list of (length,rise) tuples
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, points)
(Constructor)

source code 

Calculate and store the distance and rise between each pair of points in the list. This list will be used by all the other methods on this object.

Parameters:
  • points (list of Point objects) - list of waypoints
Overrides: object.__init__

calc_points_distance(self)

source code 

Calculate the length of the line. This is the distance along the set of waypoints.

Returns: float
length of line

calc_points_rise(self)

source code 

Calculate the cumulative rise for the line. This is the rise height for every intra-point value that rises.

Returns: (float,float)
rise height, rise distance

calc_points_fall(self)

source code 

Calculate the cumulative fall for the line. This is the rise height for every intra-point value that falls.

Returns: (float,float)
fall height, fall distance

calc_points_climbs(self)

source code 

Create a list of climbs in the line. Ignore single-point declines during a climb, since this seems to give more realistic climbs than if single "bumps" cause climbs to restart.

Returns: list of (float,float)
list of climbs with (grade,distance)