o2g/osm/builders/route_builder.py
def create_route_long_name(relation, short_name):
    """Create a meaningful route name."""
    if relation.tags.get('from') and relation.tags.get('to'):
        return "{0}-to-{1}".format(relation.tags.get('from'),
                                   relation.tags.get('to'))
    name = relation.tags.get('name') or\
        relation.tags.get('alt_name') or\
        "OSM Route No. {}".format(relation.id)

    # Drop route_short_name from this one if it contains it
    if short_name and name.startswith(short_name):
        # Drop it
        return name[len(short_name):]
    return name
def create_route_long_name(relation, short_name):
    """Create a meaningful route name."""
    if relation.tags.get('from') and relation.tags.get('to'):
        return "{0}-to-{1}".format(relation.tags.get('from'),
                                   relation.tags.get('to'))
    name = relation.tags.get('name') or\
        relation.tags.get('alt_name') or\
        "OSM Route No. {}".format(relation.id)

    # Drop route_short_name from this one if it contains it
    if short_name and name.startswith(short_name):
        # Drop it
        return name[len(short_name):]
    return name
def create_route_long_name ( relation , short_name ) : if relation . tags . get ( 'from' ) and relation . tags . get ( 'to' ) : return "{0}-to-{1}" . format ( relation . tags . get ( 'from' ) , relation . tags . get ( 'to' ) ) name = relation . tags . get ( 'name' ) or relation . tags . get ( 'alt_name' ) or "OSM Route No. {}" . format ( relation . id ) # Drop route_short_name from this one if it contains it if short_name and name . startswith ( short_name ) : # Drop it return name [ len ( short_name ) : ] return name
Create a meaningful route name.
Create a meaningful route name .