API¶
- class gpxtable.GPXTableCalculator(gpx: GPX, output: TextIO | None = None, imperial: bool = True, speed: float = 48.2803349367769, depart_at: datetime | None = None, ignore_times: bool = False, display_coordinates: bool = False, tz: tzinfo | None = None, point_classifier: list[dict] | None = None)¶
Create a waypoint/route-point table based upon GPX information.
- Parameters:
gpx – gpxpy gpx data
output – output stream or (stdio if not specified)
imperial – display in Imperial units (default imperial)
speed – optional speed of travel for time-distance calculations
depart_at – if provided, departure time for route or tracks to start
ignore_times – ignore any timestamps in provided GPX routes or tracks
display_coordinates – include latitude and longitude of points in table
- default_travel_speed = 48.2803349367769¶
Assume traveling at 30mph/50kph
- print_all() None¶
Output full combination of header, waypoints, and routes.
- print_header() None¶
Output generic information about the GPX data such as name and creator
- print_routes() None¶
Print route headers and per-point detail rows for all routes.
- print_waypoints() None¶
Print waypoint information
Look for all the waypoints associated with tracks present to attempt to reconstruct the order and distance of the waypoints. If a departure time has been set, estimate the arrival time at each waypoint and probable layover times.
- waypoint_debounce = 10000.0¶
10km between duplicates of the same waypoint on a track
- waypoint_delta = 200.0¶
200m allowed between waypoint and start/end of track
- gpxtable.gpxtable.GPXTABLE_DEFAULT_WAYPOINT_CLASSIFIER: list[dict[str, Any]] = [{'delay': 75, 'fuel_reset': True, 'marker': 'GL', 'search': '(?=.*\\b(Gas|Fuel)\\b)(?=.*\\b(Lunch|Meal)\\b)', 'symbol': 'Gas/Restaurant'}, {'delay': 15, 'fuel_reset': True, 'marker': 'G', 'search': '\\bGas\\b|\\bFuel\\b|\\b\\(G\\)\\b', 'symbol': 'Gas Station'}, {'delay': 60, 'marker': 'L', 'search': '\\bRestaurant\\b|\\bLunch\\b|\\bBreakfast\\b|\\b\\Dinner\\b|\\b\\(L\\)\\b', 'symbol': 'Restaurant'}, {'delay': 15, 'search': '\\bRestroom\\b|\\bBreak\\b|\\b\\(R\\)\\b', 'symbol': 'Restroom'}, {'delay': 5, 'symbol': 'Scenic Area'}, {'delay': 5, 'search': '\\bPhotos?\\b|\\b\\(P\\)\\b', 'symbol': 'Photo'}]¶
Additional data used for points if no other timing/type data is found. The list is iterated in sequence, the first match is returned.
- Parameters:
symbol (str) – type of waypoint (comment notation)
search (regex) – regular expression matching waypoint name
delay (int) – default delay in minutes
marker (str) – shorthand notation for gas or lunch (a meal) or both (“G”, “L”, “GL”)
fuel_reset (bool) – reset due to refueling