o2g/osm/builders/route_builder.py
def build_route(relation):
    """Extract information of one route."""
    if relation.tags.get('type') != 'route':
        # Build route only for relations of type `route`
        return

    short_name = create_route_short_name(relation)
    color = relation.tags.get('color')
    return\
        Route(relation.id,
              short_name,
              create_route_long_name(relation, short_name),
              map_osm_route_type_to_gtfs(relation.tags.get('route')),
              'https://www.openstreetmap.org/relation/{}'.format(relation.id),
              color.strip('#') if color else '',
              get_agency_id(relation))
def build_route(relation):
    """Extract information of one route."""
    if relation.tags.get('type') != 'route':
        # Build route only for relations of type `route`
        return

    short_name = create_route_short_name(relation)
    color = relation.tags.get('color')
    return\
        Route(relation.id,
              short_name,
              create_route_long_name(relation, short_name),
              map_osm_route_type_to_gtfs(relation.tags.get('route')),
              'https://www.openstreetmap.org/relation/{}'.format(relation.id),
              color.strip('#') if color else '',
              get_agency_id(relation))
Extract information of one route.