fietsboek.transformers.elevation module

Transformers that deal with elevation changes in the track.

class fietsboek.transformers.elevation.FixElevationJumps

Bases: Transformer

A transformer that fixes big jumps in the elevation.

classmethod description()

A short description of what this transformer does.

Return type:

TranslationString

Returns:

The transformer’s description.

execute(gpx)

Run the transformation on the input gpx.

This is expected to modify the GPX object to represent the new state.

Parameters:

gpx (GPX) – The GPX object to transform. Note that this object will be mutated!

classmethod identifier()

Returns a string identifier for this transformer.

This identifier is used when serializing/deserializing the filters.

Return type:

str

Returns:

A machine-readable identifier for this transformer.

classmethod name()

The human-readable name of this transformer, as a translateable string.

Return type:

TranslationString

Returns:

The transformer’s name.

classmethod parameter_model()

Returns the parameter model that this transformer expects.

Return type:

type[Parameters]

Returns:

The parameter model class.

property parameters: Parameters

Returns the parameters of this transformer.

Note that the caller may modify the parameters, which should be reflected in future applications of the transformer.

Returns:

The parameters.

class fietsboek.transformers.elevation.FixNullElevation

Bases: Transformer

A transformer that fixes points with zero elevation.

classmethod description()

A short description of what this transformer does.

Return type:

TranslationString

Returns:

The transformer’s description.

execute(gpx)

Run the transformation on the input gpx.

This is expected to modify the GPX object to represent the new state.

Parameters:

gpx (GPX) – The GPX object to transform. Note that this object will be mutated!

classmethod fixup(points)

Fixes the given GPX points.

This iterates over the points and checks for the first point that has a non-zero elevation, and a slope that doesn’t exceed 100%. All previous points will have their elevation adjusted to match this first “good point”.

Parameters:

points (Callable[[], Iterable[GPXTrackPoint]]) – A function that generates the iterable of points.

classmethod identifier()

Returns a string identifier for this transformer.

This identifier is used when serializing/deserializing the filters.

Return type:

str

Returns:

A machine-readable identifier for this transformer.

classmethod name()

The human-readable name of this transformer, as a translateable string.

Return type:

TranslationString

Returns:

The transformer’s name.

classmethod parameter_model()

Returns the parameter model that this transformer expects.

Return type:

type[Parameters]

Returns:

The parameter model class.

property parameters: Parameters

Returns the parameters of this transformer.

Note that the caller may modify the parameters, which should be reflected in future applications of the transformer.

Returns:

The parameters.