fietsboek.models.climb module

The Climb model.

class fietsboek.models.climb.Climb(**kwargs)

Bases: Base

A climb represents a subpath of a track that ascends at least 3% over 500m.

automatic_name: Mapped[str | None]
avg_grade: Mapped[float]
bounds()

Returns the bounds of this climb.

See Path.bounds().

Return type:

tuple[tuple[float, float], tuple[float, float]]

category: Mapped[int | None]
display_name()

Returns the display name.

If the given name (by the user) is set, returns this. Otherwise, return the autmatic name.

Return type:

str | None

Returns:

The name that should be displayed.

end_index: Mapped[int]
classmethod factory(request)

Factory method to pass to a route definition.

This factory retrieves the climb based on the climb_id matched route parameter, and returns the climb. If the climb is not found, HTTPNotFound is raised.

Raises:

pyramid.httpexception.NotFound – If the climb is not found.

Parameters:

request (Request) – The pyramid request.

Return type:

Climb

Returns:

The climb.

given_name: Mapped[str | None]
highest_elevation: Mapped[float]
id: Mapped[int]
image: Mapped[bytes]
latlon_points()

Returns all points of this path as coordinates.

The returned points will be the latitude, longitude coordinates.

Return type:

list[tuple[float, float]]

Returns:

The points as coordinates.

length: Mapped[float]
lowest_elevation: Mapped[float]
path()

Returns the path of this climb.

Return type:

Path

profile: Mapped[bytes]
start_index: Mapped[int]
track: Mapped[Track]
track_id: Mapped[int]