# Path: aerofiles/openair/patterns.py
# _INT = r'\d+'
# _FLOAT = r'%s(?:\.%s)?' % (_INT, _INT)
# _C1 = r'(%s):(%s):(%s)' % (_INT, _INT, _FLOAT)
# _C2 = r'(%s):(%s)' % (_INT, _FLOAT)
# _L = r'%s\s*([NS])\s*%s\s*([EW])'
# _L1 = _L % (_C1, _C1)
# _L2 = _L % (_C2, _C2)
# LOCATION_FORMAT_1 = re.compile(_L1)
# LOCATION_FORMAT_2 = re.compile(_L2)


from aerofiles.openair import patterns
        return {
            'type': 'DA',
            'radius': radius, 'start': start, 'end': end,
        }

    def handle_DB_record(self, value):
        start, end = split(value, ',', 2, coordinate, coordinate)

        return {
            'type': 'DB',
            'start': start, 'end': end
        }

    def handle_DC_record(self, value):
        return {'type': 'DC', 'value': float(value)}

    def handle_DY_record(self, value):
        return {'type': 'DY', 'value': coordinate(value)}


def split(value, separator, num, *types):
    values = value.split(separator)
    if len(values) != num:
        raise ValueError()

    return [cast(v.strip()) for v, cast in zip(values, types)]


def coordinate(value):
    # 39:35:00 N 118:59:20 W

# Path: aerofiles/openair/patterns.py
# _INT = r'\d+'
# _FLOAT = r'%s(?:\.%s)?' % (_INT, _INT)
# _C1 = r'(%s):(%s):(%s)' % (_INT, _INT, _FLOAT)
# _C2 = r'(%s):(%s)' % (_INT, _FLOAT)
# _L = r'%s\s*([NS])\s*%s\s*([EW])'
# _L1 = _L % (_C1, _C1)
# _L2 = _L % (_C2, _C2)
# LOCATION_FORMAT_1 = re.compile(_L1)
# LOCATION_FORMAT_2 = re.compile(_L2)


# Path: aerofiles/openair/reader.py
from aerofiles.openair import patterns

        return {
            'type': 'DA',
            'radius': radius, 'start': start, 'end': end,
        }

    def handle_DB_record(self, value):
        start, end = split(value, ',', 2, coordinate, coordinate)

        return {
            'type': 'DB',
            'start': start, 'end': end
        }

    def handle_DC_record(self, value):
        return {'type': 'DC', 'value': float(value)}

    def handle_DY_record(self, value):
        return {'type': 'DY', 'value': coordinate(value)}


def split(value, separator, num, *types):
    values = value.split(separator)
    if len(values) != num:
        raise ValueError()

    return [cast(v.strip()) for v, cast in zip(values, types)]


def coordinate(value):
    # 39:35:00 N 118:59:20 W

    match = patterns.LOCATION_FORMAT_1.match(value)