Ride handling.
When I'm using SABX data to create maps, I like to process the XML
data into a more useful object hierarchy. I de-reference the parking,
turn, and seg ids for each ride and create full object hierarchies for
each. This results in lots of duplication, but gives data that is easy
to manipulate and reference. I also do some analysis of the rides and add
things like distances and bounding boxes to the relevant objects, and
modify some of the standard objects to be more programmer-friendly.
string
|
|
list of string
|
|
list of string
|
|
Ride
|
|
(list of Ride,dict of Ride)
|
|
list
|
|
Box
|
_process_bounds(ride,
seg_bounds,
stop_bounds,
poi_bounds)
Creating a bounding box that includes the bounds for the parking,
segments, stops, and pois for this ride. |
source code
|
|
Ride
|
_process_ride(ride_index,
xml_ride,
xml_parking_places,
xml_segs,
xml_turns,
xml_stops,
xml_pois,
correct_ele=True)
Create a Ride object and add pertinent calculated data. |
source code
|
|
(list of Ride,Box)
|
process_rides(xml_tree,
correct_ele=True)
Process the rides in the XML tree and generate a list of Ride objects
and the bounding box for all of the rides. |
source code
|
|