def parse_seeyou_waypoints(lines): waypoint_list = WaypointList() first = True for line in lines: if first: first = False continue line = line.strip() if line == '' or line.startswith('*'): continue if line == '-----Related Tasks-----': break fields = [] line = __CSVLine(line) while line.has_next(): fields.append(line.next()) if len(fields) < 6: continue wp = Waypoint() wp.lat = __parse_coordinate(fields[3]) wp.lon = __parse_coordinate(fields[4]) wp.altitude = __parse_altitude(fields[5]) wp.name = fields[0].strip() waypoint_list.append(wp) return waypoint_list
def parse_welt2000_waypoints(lines, bounds=None): waypoint_list = WaypointList() for line in lines: wp = __parse_line(line, bounds) if wp: waypoint_list.append(wp) return waypoint_list
def parse_seeyou_waypoints(lines, bounds=None): waypoint_list = WaypointList() first = True for line in lines: if first: first = False continue line = line.strip() if line == '' or line.startswith('*'): continue if line == '-----Related Tasks-----': break fields = [] line = __CSVLine(line) while line.has_next(): fields.append(line.next()) if len(fields) < 6: continue lat = __parse_coordinate(fields[3]) if bounds and (lat > bounds.top or lat < bounds.bottom): continue lon = __parse_coordinate(fields[4]) if bounds and (lon > bounds.right or lon < bounds.left): continue wp = Waypoint() wp.lat = lat wp.lon = lon wp.altitude = __parse_altitude(fields[5]) wp.name = fields[0].strip() wp.country_code = fields[2].strip() if len(fields) > 6 and len(fields[6]) > 0: wp.cup_type = int(fields[6]) if len(fields) > 7 and len(fields[7]) > 0: wp.runway_dir = int(fields[7]) if len(fields) > 8 and len(fields[8]) > 0: wp.runway_len = __parse_length(fields[8]) if len(fields) > 9 and len(fields[9]) > 0: wp.freq = float(fields[9]) if len(fields) > 10 and len(fields[10]) > 0: wp.comment = fields[10].strip() waypoint_list.append(wp) return waypoint_list