Package sabx10 :: Package oxm :: Module poi
[hide private]
[frames] | no frames]

Module poi

source code

POI handling.

Classes [hide private]
  Poi
A Poi object sub-classes Point and adds a description to describe a point of interest.
Functions [hide private]
Poi
_parse_poi_xml(xml_poi)
Take the Element for a point of interest and turn it into a Poi object.
source code
(list of Poi,dict of Poi)
parse_pois(xml_tree)
Get all the point of interest elements in the given Element tree and create a list of them with Poi objects.
source code
(Point,float)
_poi_pts_dist(points)
Generator that iterates through all the Point objects, yielding the point and the distance to it along the line for each point.
source code
(list of Poi,Box,int)
_process_pois_in_seg_data(ride_seg, xml_pois, index)
Process the segment, extracting the POIs and getting the bounds of the POIs.
source code
(list,Box)
process_ride_pois(seg_set, xml_segs, xml_pois)
Process the point of interest references for the given ride and generate a list of Poi objects for it and the bounding box for all of the POIs.
source code
Variables [hide private]
  __package__ = 'sabx10.oxm'
Function Details [hide private]

_parse_poi_xml(xml_poi)

source code 

Take the Element for a point of interest and turn it into a Poi object.

Parameters:
  • xml_poi (Element) - Element for a point of interest
Returns: Poi
Poi object

parse_pois(xml_tree)

source code 

Get all the point of interest elements in the given Element tree and create a list of them with Poi objects.

Parameters:
  • xml_tree (Element or ElementTree) - root of Element tree that has points of interest in it
Returns: (list of Poi,dict of Poi)
points of interest in a list and a dictionary

_poi_pts_dist(points)

source code 

Generator that iterates through all the Point objects, yielding the point and the distance to it along the line for each point.

Parameters:
  • points (list of Point objects) - list of points for a segment
Returns: (Point,float)
(Point,distance)

_process_pois_in_seg_data(ride_seg, xml_pois, index)

source code 

Process the segment, extracting the POIs and getting the bounds of the POIs.

Parameters:
  • ride_seg (Segment) - Segment to process
  • xml_pois (list of Element) - list of Elements for POIs in rideset
  • index (int) - next index to use for a POI
Returns: (list of Poi,Box,int)
(POIs for segment, bounds, updated index)

process_ride_pois(seg_set, xml_segs, xml_pois)

source code 

Process the point of interest references for the given ride and generate a list of Poi objects for it and the bounding box for all of the POIs.

Parameters:
  • seg_set (list of Segment objects) - list of Segment objects for the ride
  • xml_segs (list of Elements) - list of Element segment objects for this ride
  • xml_pois (list of Elements) - list of Element point of interest objects
Returns: (list,Box)
(list of Poi,bounds)