fietsboek.geo module¶
This module implements GPS related functionality.
- fietsboek.geo.CLIMB_MERGE_THRESHOLD = 50¶
Window for when climbs are merged (in m).
- fietsboek.geo.CLIMB_MIN_ASCENSION = 0.03¶
Minimum relative ascension for a segment to be considered a climb.
- fietsboek.geo.CLIMB_MIN_LENGTH = 500¶
Minimum length (in m) for an ascent to be considered a climb.
- fietsboek.geo.EARTH_RADIUS = 6378137.0¶
Radius of the earth, in meters.
- fietsboek.geo.MOVING_THRESHOLD = 1.1¶
Speed which is considered to be the moving threshold, in m/s.
- class fietsboek.geo.MovementData(duration=0.0, moving_duration=0.0, stopped_duration=0.0, length=0.0, average_speed=0.0, maximum_speed=0.0, uphill=0.0, downhill=0.0, elevation_gain=0.0, min_elevation=0.0, max_elevation=0.0)¶
Bases:
objectMovement statistics for a path.
- class fietsboek.geo.Path(points)¶
Bases:
objectA GPS path, that is a series of GPS points.
- bounds()¶
Returns the bounds of this path.
- climbs()¶
Returns an iterator over all climbs of this path.
- interpolate(where)¶
Returns a point in the middle of the path.
If
whereis 0, the beginning of the path is returned. Ifwhereis 1, the end is returned.Unlike accessing
self.points, this function can return points between two points in the path.
- movement_data()¶
Returns the movement data.
- Return type:
- similarity(reference)¶
Returns a similarity measure between this track and the given other track.
The higher the returned number is, the more dissimilar the given tracks are.
Note that currently, this measure is not symmetric, as
otheris cut to matchselfin length (on a best-effort basis). Therefore,longer.similarity(shorter)andshorter.similarity(longer)will not be the same.
- class fietsboek.geo.Point(longitude, latitude, elevation, time_offset)¶
Bases:
objectA GPS point, represented as longitude/latitude/elevation.
- distance(other)¶
Returns the distance between this point and the given other point in meters.
- Return type:
- flat_distance(other)¶
Returns the distance between this point and the other point in meters.
This does not take elevation into account, and only looks at the 2d distance.
- Return type:
- latlon()¶
Returns the latitude and longitude of this point as a tuple.
- class fietsboek.geo.Waypoint(longitude, latitude, elevation, name, description)¶
Bases:
objectA waypoint, a special landmark marked in the track.
- fietsboek.geo.gpx_xml(title, description, date, points, waypoints)¶
Returns an XML representation of the given path.
- Parameters:
- Return type:
- Returns:
The XML representation (a GPX file).