From d3420628554ea3b7fac915f6748e69250992c55a Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Thu, 12 Jul 2018 19:41:41 +0200 Subject: [PATCH] force-add cfg files in eval --- eval/eval-wo-osm.cfg | 981 ++++++++++++++++++++++++++++++++++++++++++ eval/eval.cfg | 993 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1974 insertions(+) create mode 100644 eval/eval-wo-osm.cfg create mode 100644 eval/eval.cfg diff --git a/eval/eval-wo-osm.cfg b/eval/eval-wo-osm.cfg new file mode 100644 index 0000000..dfc8e75 --- /dev/null +++ b/eval/eval-wo-osm.cfg @@ -0,0 +1,981 @@ +# Copyright 2018, University of Freiburg +# Chair of Algorithms and Datastructures +# Authors: Patrick Brosi + +[rail] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + railway=rail + railway=light_rail + railway=narrow_gauge + route=rail + route=train + public_transport=stop_area|rel_flat + +osm_filter_lvl1: + usage=branch + +osm_filter_lvl2: + +osm_filter_lvl3: + service=crossover + service=siding + # we cannot completely drop service=yard, because it is often used + # incorrectly for crossovers + service=yard + +osm_filter_lvl4: + +osm_filter_lvl5: + usage=industrial + usage=military + usage=test + service=spur + railway:traffic_mode=freight + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + railway=abandoned + railway=construction + railway=disused + railway=miniature + railway=signal + railway=razed + railway=proposed + metro=yes + area=yes + # access=no + type=multipolygon + railway=platform + public_transport=platform + building=yes + building=train_station + amenity=shelter + amenity=bus_station + building=roof + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + railway:switch=no + railway=railway_crossing + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + oneway=yes + railway:preferred_direction=forward + +osm_filter_oneway_reverse: + railway:preferred_direction=backward + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + oneway=false + oneway=no + oneway=-1 + railway:preferred_direction=both + railway:bidirectional=regular + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + railway=stop + railway=halt + railway=station + #railway=tram_stop + railway=subway_stop + tram_stop=* + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + [public_transport=stop_area]uic_ref=500 + [public_transport=stop_area]wikidata=500 + name=100 + [public_transport=stop_area]name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 100, 200 + +# max edge level to which station will be snapped +osm_max_snap_level: 2 + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + [public_transport=stop_area]name + uic_name + +# the track number tag in edges, first match is taken +osm_edge_track_number_tags: + railway:track_ref + local_ref + ref + +# the track number tag in stop nodes, first match is taken, +# overwrites osm_edge_track_number_tags +osm_track_number_tags: + local_ref + ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.25 +routing_lvl2_fac: 1.5 +routing_lvl3_fac: 2 +routing_lvl4_fac: 2.5 +routing_lvl5_fac: 3.5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 7 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 3000 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 100 + +routing_platform_unmatched_punish: 2000 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 100 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 100 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 100 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 1 + +# special line normalization for trains +line_normalize_chain: + , -> ' '; + - -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + / -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + í -> i; + ú -> u; + ù -> u; + ë -> e; + ç -> c; + å -> ae; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + ^line -> ''; + ^linie -> ''; + ^metro -> ''; + ^tram -> ''; + ^strassenbahn -> ''; + ^bus -> ''; + + # delete everything in brackets + \(.+\) -> ' '; + \[.+\] -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + + # line/number combs ALWAYS with whitespace (ICE101 -> ICE 101) + ^([a-zA-Z]+)([0-9]+)$ -> \1 \2; + + # if a character line number is present, delete the numeric part + ^([a-zA-Z]+) [0-9]+$ -> \1; + +[bus] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + # highways + highway=motorway + highway=trunk + highway=primary + highway=secondary + highway=tertiary + highway=residential + highway=living_street + highway=unclassified + + # highway links + highway=motorway_link + highway=trunk_link + highway=primary_link + highway=secondary_link + highway=tertiary_link + highway=residential_link + + way=primary + way=seconday + way=bus_guideway + highway=bus_guideway + busway=* + psv=yes + psv=designated + + trolley_wire=yes + trolleywire=yes + trolleybus=yes + trolley_bus=yes + + route=bus + route=trolleybus + bus=yes + + public_transport=stop_position + bus_stop=* + stop=* + highway=bus_stop + amenity=bus_station|no_match_ways|no_match_rels + + # relations for the restriction system + type=restriction + type=restriction:bus + type=restriction:motorcar + +osm_filter_lvl1: + highway=secondary + highway=secondary_link + bus=yes + psv=yes + access=psv + access=bus + trolley_wire=yes + trolleywire=yes + trolleybus=yes + trolley_bus=yes + psv=designated + +osm_filter_lvl2: + highway=tertiary + highway=tertiary_link + +osm_filter_lvl3: + highway=unclassified + highway=residential + highway=road + +osm_filter_lvl4: + highway=living_street + highway=pedestrian + highway=service + +osm_filter_lvl5: + service=siding + access=permissive + access=private + access=no + service=parking_aisle + highway=footway + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + area=yes + train=yes|no_match_ways + # access=no + public_transport=stop_area|no_match_nds|no_match_rels + type=multipolygon + railway=platform + railway=station + # service=parking_aisle + highway=proposed + highway=footway + highway=construction + building=yes + building=train_station + leisure=garden + leisure=park + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + +# Configuration of the OSM road restriction system +# We only support restriction with a single via node +# atm + +osm_node_negative_restriction: + restriction=no_right_turn + restriction=no_left_turn + restriction=no_u_turn + restriction=no_straight_on + restriction:bus=no_right_turn + restriction:bus=no_left_turn + restriction:bus=no_u_turn + restriction:bus=no_straight_on + +osm_node_positive_restriction: + restriction=only_left_turn + restriction=only_straight_on + restriction=only_right_turn + restriction:bus=only_left_turn + restriction:bus=only_straight_on + restriction:bus=only_right_turn + +osm_filter_no_restriction: + except=psv|mult_val_match + except=bus|mult_val_match + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + junction=roundabout # oneway=yes is implied + highway=motorway # oneway=yes is implied + oneway=yes + oneway=1 + oneway=true + oneway:bus=yes + oneway:bus=1 + oneway:bus=true + oneway:psv=yes + oneway:psv=1 + oneway:psv=true + +osm_filter_oneway_reverse: + oneway=-1 + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + oneway=false + oneway=0 + oneway=alternating + oneway=reversible + oneway=no + oneway:bus=no + oneway:bus=0 + oneway:bus=false + oneway:psv=no + oneway:psv=0 + oneway:psv=false + busway=opposite_lane + busway=opposite + busway:left=opposite_lane + busway:right=opposite_lane + psv=opposite_lane + psv=opposite + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + bus_stop=* + stop=* + highway=bus_stop + amenity=bus_station + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10 , 50, 100 + +osm_max_snap_level: 5 + +osm_max_osm_station_distance: 7.5 + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.25 +routing_lvl2_fac: 1.5 +routing_lvl3_fac: 1.75 +routing_lvl4_fac: 2.25 +routing_lvl5_fac: 3 +routing_lvl6_fac: 4 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 500 + +routing_station_distance_punish_fac: 2.5 + +routing_non_osm_station_punish: 500 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 20 + +# Max angle in a route from a station to an already reachable neighbor +routing_snap_full_turn_angle: 110 + +osm_max_node_block_distance: 10 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 0 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 4 + +routing_one_way_edge_punish: 5000 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +# routing_line_unmatched_punish_fac: 1.75 + +[tram, subway, funicular] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + route=tram + railway=subway + railway=light_rail + railway=tram + railway=funicular + railway=station + railway=halt + railway=tram_stop + route=subway + route=light_rail + subway=yes + tram=yes + +osm_filter_lv2: + service=siding + +osm_filter_lvl5: + service=crossover + service=yard + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + area=yes + public_transport=stop_area + type=multipolygon + railway=platform + public_transport=platform + service=alley + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + railway:switch=no + railway=railway_crossing + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + oneway=yes + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + station=subway + station=tram + railway=stop + railway=halt + railway=station + railway=tram_stop + railway=subway_stop + tram_stop=* + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 50, 100 + +osm_max_snap_level: 4 + + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.5 +routing_lvl2_fac: 2 +routing_lvl3_fac: 2.5 +routing_lvl4_fac: 3.5 +routing_lvl5_fac: 5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 2000 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 235 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 80 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 80 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 100 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 0.5 + +[ferry] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + route=ferry + waterway=river + motorboat=yes + ferry=yes + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + station=ferry + railway=stop + railway=halt + railway=station + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 100, 200 + +osm_max_snap_level: 4 + + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.5 +routing_lvl2_fac: 2 +routing_lvl3_fac: 2.5 +routing_lvl4_fac: 3.5 +routing_lvl5_fac: 5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 100 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 50 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 45 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 0 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 0 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 0.5 + +[tram, bus, subway, rail, gondola, funicular, ferry] +# Regular expressions and station comparision is +# always case insensitive! +station_normalize_chain: + , -> ' '; + - -> ' '; + — -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + \( -> ' '; + \) -> ' '; + \[ -> ' '; + \] -> ' '; + / -> ' '; + '\\' -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + ô -> o; + ç -> c; + í -> i; + ú -> u; + ù -> u; + ë -> e; + å -> ae; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + str\. -> strasse; + av\. -> avenue; + + # always separate 'street', 'strasse' + '([a-zA-Z])strasse($| )' -> '\1 strasse\2'; + '([a-zA-Z])street($| )' -> '\1 street\2'; + + # always use "street" + '(^| )strasse($| )' -> '\1street\2'; + + # always use "avenue" + '(^| )avenida($| )' -> '\1avenue\2'; + '(^| )avenu($| )' -> '\1avenue\2'; + + # normalize every possible abbr. of german "Bahnhof", "Hauptbahnhof", "Busbahnhof" + '(^| )hauptbf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbf($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbhf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbhf($| )' -> '\1hauptbahnhof\2'; + '(^| )zentraler busbahnhof($| )$' -> \1busbahnhof\2; + '(^| )zentraler omnibusbahnhof($| )$' -> \1busbahnhof\2; + '(^| )omnibusbahnhof($| )' -> '\1busbahnhof\2'; + '(^| )omnibusbhf($| )' -> '\1busbahnhof\2'; + '(^| )busbf\.($| )' -> '\1busbahnhof\2'; + '(^| )busbf($| )' -> '\1busbahnhof\2'; + '(^| )bus bf\.($| )' -> '\1busbahnhof\2'; + '(^| )bus bf($| )' -> '\1busbahnhof\2'; + '(^| )busbhf\.($| )' -> '\1busbahnhof\2'; + '(^| )busbhf($| )' -> '\1busbahnhof\2'; + '(^| )bus bhf\.($| )' -> '\1busbahnhof\2'; + '(^| )bus bhf($| )' -> '\1busbahnhof\2'; + '(^| )zob($| )' -> '\1busbahnhof\2'; + '(^| )hbf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hbf($| )' -> '\1hauptbahnhof\2'; + '(^| )hb\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hb($| )' -> '\1hauptbahnhof\2'; + '(^| )bf\.($| )' -> '\1bahnhof\2'; + '(^| )bf($| )' -> '\1bahnhof\2'; + '(^| )bhf\.($| )' -> '\1bahnhof\2'; + '(^| )bhf($| )' -> '\1bahnhof\2'; + '(^| )bhfeingang($| )' -> '\1bahnhofeingang\2'; + '(^| )gare de($| )' -> '\1gare\2'; + + + # if a stations starts with single station identifier + # always put it at the end (for example, "hauptbahnhof freiburg" becomes "freiburg hauptbahnhof") + '^hauptbahnhof (.+)$' -> \1 hauptbahnhof; + '^bahnhof (.+)$' -> \1 bahnhof; + '^busbahnhof (.+)$' -> \1 busbahnhof; + '^gare (.+)$' -> \1 gare; + '^station (.+)$' -> \1 station; + + '(^| )busbahnhof($| )' -> '\1bbahnhof\2'; + + # normalize line types in station names + '(^| )u bahn\.($| )' -> '\1ubahn\2'; + '(^| )metro\.($| )' -> '\1ubahn\2'; + '(^| )subway\.($| )' -> '\1ubahn\2'; + '(^| )underground\.($| )' -> '\1ubahn\2'; + '(^| )ubahn($| )' -> '\1u\2'; + '(^| )s bahn\.($| )' -> '\1sbahn\2'; + '(^| )sbahn($| )' -> '\1s\2'; + '(^| )tramway($| )' -> '\1tram\2'; + '(^| )stadtbahn($| )' -> '\1tram\2'; + '(^| )strassenbahn($| )' -> '\1tram\2'; + '(^| )streetcar($| )' -> '\1tram\2'; + '(^| )tram($| )' -> '\1t\2'; + + # delete track information from name + '(^| )kante [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )gleis [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )track [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )voie [a-zA-Z0-9]{1,2}($| )' -> ' '; + + # abbrv + '(^| )und($| )' -> '\1+\2'; + '(^| )and($| )' -> '\1+\2'; + '(^| )et($| )' -> '\1+\2'; + + # noise + '\sde\s' -> ' '; + '\sda\s' -> ' '; + '\sdi\s' -> ' '; + '\sdel\s' -> ' '; + '\sdal\s' -> ' '; + + # abbrv in most western languages + '(^| )saint ' -> '\1st. '; + '(^| )sankt ' -> '\1st. '; + '(^| )sanct ' -> '\1st. '; + + \. -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + +line_normalize_chain: + , -> ' '; + - -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + / -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + í -> i; + ú -> u; + ù -> u; + ë -> e; + å -> ae; + ç -> c; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + ^line -> ''; + ^linie -> ''; + ^metro -> ''; + ^tram -> ''; + ^strassenbahn -> ''; + ^bus -> ''; + + # delete everything in brackets + \(.+\) -> ' '; + \[.+\] -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + + # line/number combs ALWAYS without whitespace (T 2 -> T2) + ^([a-zA-Z]+) ([0-9]+)$ -> \1\2; + +track_normalize_chain: + '(^| )gleis($| )' -> ''; + '(^| )gl\.($| )' -> ''; + '(^| )platform($| )' -> ''; + '(^| )track($| )' -> ''; + '(^| )rail($| )' -> ''; + # line/number combs ALWAYS without whitespace (1 A -> 1A) + ^([a-zA-Z]+) ([0-9]+)$ -> \1\2; + ^([0-9]+) ([a-zA-Z]+)$ -> \1\2; + + # delete track numbers greater than 999 + ^[0-9]{4,}$ -> ''; diff --git a/eval/eval.cfg b/eval/eval.cfg new file mode 100644 index 0000000..6ad4ae9 --- /dev/null +++ b/eval/eval.cfg @@ -0,0 +1,993 @@ +# Copyright 2018, University of Freiburg +# Chair of Algorithms and Datastructures +# Authors: Patrick Brosi + +[rail] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + railway=rail + railway=light_rail + railway=narrow_gauge + route=rail + route=train + public_transport=stop_area|rel_flat + +osm_filter_lvl1: + usage=branch + +osm_filter_lvl2: + +osm_filter_lvl3: + service=crossover + service=siding + # we cannot completely drop service=yard, because it is often used + # incorrectly for crossovers + service=yard + +osm_filter_lvl4: + +osm_filter_lvl5: + usage=industrial + usage=military + usage=test + service=spur + railway:traffic_mode=freight + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + railway=abandoned + railway=construction + railway=disused + railway=miniature + railway=signal + railway=razed + railway=proposed + metro=yes + area=yes + # access=no + type=multipolygon + railway=platform + public_transport=platform + building=yes + building=train_station + amenity=shelter + amenity=bus_station + building=roof + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + railway:switch=no + railway=railway_crossing + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + oneway=yes + railway:preferred_direction=forward + +osm_filter_oneway_reverse: + railway:preferred_direction=backward + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + oneway=false + oneway=no + oneway=-1 + railway:preferred_direction=both + railway:bidirectional=regular + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + railway=stop + railway=halt + railway=station + #railway=tram_stop + railway=subway_stop + tram_stop=* + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + line_name=ref,name # careful, no space after/before comma allowed! + from_name=from + to_name=to + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + [public_transport=stop_area]uic_ref=500 + [public_transport=stop_area]wikidata=500 + name=100 + [public_transport=stop_area]name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 100, 200 + +# max edge level to which station will be snapped +osm_max_snap_level: 2 + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + [public_transport=stop_area]name + uic_name + +# the track number tag in edges, first match is taken +osm_edge_track_number_tags: + railway:track_ref + local_ref + ref + +# the track number tag in stop nodes, first match is taken, +# overwrites osm_edge_track_number_tags +osm_track_number_tags: + local_ref + ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.25 +routing_lvl2_fac: 1.5 +routing_lvl3_fac: 2 +routing_lvl4_fac: 2.5 +routing_lvl5_fac: 3.5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 7 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 3000 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 100 + +routing_platform_unmatched_punish: 2000 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 100 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 100 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 100 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 1 + +# special line normalization for trains +line_normalize_chain: + , -> ' '; + - -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + / -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + í -> i; + ú -> u; + ù -> u; + ë -> e; + ç -> c; + å -> ae; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + ^line -> ''; + ^linie -> ''; + ^metro -> ''; + ^tram -> ''; + ^strassenbahn -> ''; + ^bus -> ''; + + # delete everything in brackets + \(.+\) -> ' '; + \[.+\] -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + + # line/number combs ALWAYS with whitespace (ICE101 -> ICE 101) + ^([a-zA-Z]+)([0-9]+)$ -> \1 \2; + + # if a character line number is present, delete the numeric part + ^([a-zA-Z]+) [0-9]+$ -> \1; + +[bus] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + # highways + highway=motorway + highway=trunk + highway=primary + highway=secondary + highway=tertiary + highway=residential + highway=living_street + highway=unclassified + + # highway links + highway=motorway_link + highway=trunk_link + highway=primary_link + highway=secondary_link + highway=tertiary_link + highway=residential_link + + way=primary + way=seconday + way=bus_guideway + highway=bus_guideway + busway=* + psv=yes + psv=designated + + trolley_wire=yes + trolleywire=yes + trolleybus=yes + trolley_bus=yes + + route=bus + route=trolleybus + bus=yes + + public_transport=stop_position + bus_stop=* + stop=* + highway=bus_stop + amenity=bus_station|no_match_ways|no_match_rels + + # relations for the restriction system + type=restriction + type=restriction:bus + type=restriction:motorcar + +osm_filter_lvl1: + highway=secondary + highway=secondary_link + bus=yes + psv=yes + access=psv + access=bus + trolley_wire=yes + trolleywire=yes + trolleybus=yes + trolley_bus=yes + psv=designated + +osm_filter_lvl2: + highway=tertiary + highway=tertiary_link + +osm_filter_lvl3: + highway=unclassified + highway=residential + highway=road + +osm_filter_lvl4: + highway=living_street + highway=pedestrian + highway=service + +osm_filter_lvl5: + service=siding + access=permissive + access=private + access=no + service=parking_aisle + highway=footway + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + area=yes + train=yes|no_match_ways + # access=no + public_transport=stop_area|no_match_nds|no_match_rels + type=multipolygon + railway=platform + railway=station + # service=parking_aisle + highway=proposed + highway=footway + highway=construction + building=yes + building=train_station + leisure=garden + leisure=park + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + +# Configuration of the OSM road restriction system +# We only support restriction with a single via node +# atm + +osm_node_negative_restriction: + restriction=no_right_turn + restriction=no_left_turn + restriction=no_u_turn + restriction=no_straight_on + restriction:bus=no_right_turn + restriction:bus=no_left_turn + restriction:bus=no_u_turn + restriction:bus=no_straight_on + +osm_node_positive_restriction: + restriction=only_left_turn + restriction=only_straight_on + restriction=only_right_turn + restriction:bus=only_left_turn + restriction:bus=only_straight_on + restriction:bus=only_right_turn + +osm_filter_no_restriction: + except=psv|mult_val_match + except=bus|mult_val_match + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + junction=roundabout # oneway=yes is implied + highway=motorway # oneway=yes is implied + oneway=yes + oneway=1 + oneway=true + oneway:bus=yes + oneway:bus=1 + oneway:bus=true + oneway:psv=yes + oneway:psv=1 + oneway:psv=true + +osm_filter_oneway_reverse: + oneway=-1 + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + oneway=false + oneway=0 + oneway=alternating + oneway=reversible + oneway=no + oneway:bus=no + oneway:bus=0 + oneway:bus=false + oneway:psv=no + oneway:psv=0 + oneway:psv=false + busway=opposite_lane + busway=opposite + busway:left=opposite_lane + busway:right=opposite_lane + psv=opposite_lane + psv=opposite + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + bus_stop=* + stop=* + highway=bus_stop + amenity=bus_station + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + line_name=ref,name # careful, no space after/before comma allowed! + from_name=from + to_name=to + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10 , 50, 100 + +osm_max_snap_level: 5 + +osm_max_osm_station_distance: 7.5 + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.25 +routing_lvl2_fac: 1.5 +routing_lvl3_fac: 1.75 +routing_lvl4_fac: 2.25 +routing_lvl5_fac: 3 +routing_lvl6_fac: 4 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 500 + +routing_station_distance_punish_fac: 2.5 + +routing_non_osm_station_punish: 500 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 20 + +# Max angle in a route from a station to an already reachable neighbor +routing_snap_full_turn_angle: 110 + +osm_max_node_block_distance: 10 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 0 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 4 + +routing_one_way_edge_punish: 5000 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +# routing_line_unmatched_punish_fac: 1.75 + +[tram, subway, funicular] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + route=tram + railway=subway + railway=light_rail + railway=tram + railway=funicular + railway=station + railway=halt + railway=tram_stop + route=subway + route=light_rail + subway=yes + tram=yes + +osm_filter_lv2: + service=siding + +osm_filter_lvl5: + service=crossover + service=yard + +# OSM entities to drop, as k=v. Applies to nodes, edges and +# relations. +# Nodes included in non-dropped ways are kept regardless of +# a matching drop filter. +# Ways included in non-dropped relations are kept regardless of +# a matching drop filter. + +osm_filter_drop: + area=yes + public_transport=stop_area + type=multipolygon + railway=platform + public_transport=platform + service=alley + +# Nodes that should act as "no-hup" nodes. These are nodes +# that are contained in multiple ways, but cannot be used +# to switch from one way to another (for example, a +# track crossing in rail networks) + +osm_filter_nohup: + railway:switch=no + railway=railway_crossing + +# Edges that should act as one-way nodes. + +osm_filter_oneway: + oneway=yes + +# Edges that may explicitely be used in +# both directions. May be used to set exception +# to "osm_filter_oneway" + +osm_filter_undirected: + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + station=subway + station=tram + railway=stop + railway=halt + railway=station + railway=tram_stop + railway=subway_stop + tram_stop=* + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + line_name=ref,name # careful, no space after/before comma allowed! + from_name=from + to_name=to + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 50, 100 + +osm_max_snap_level: 4 + + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.5 +routing_lvl2_fac: 2 +routing_lvl3_fac: 2.5 +routing_lvl4_fac: 3.5 +routing_lvl5_fac: 5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 2000 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 235 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 80 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 80 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 100 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 0.5 + +[ferry] + +# OSM entities to keep on different levels, as k=v. Applies +# to nodes, edges and relations. +# Nodes included in kept ways are always kept. +# Ways included in kept relations are always kept. + +osm_filter_keep: + route=ferry + waterway=river + motorboat=yes + ferry=yes + +# Nodes that are stations. +# Only nodes that have been kept during the filtering above will be +# checked. +osm_filter_station: + public_transport=stop_position + station=ferry + railway=stop + railway=halt + railway=station + stop=* + +# Relation fields that should be used for catching the lines that +# occur on an edge. Only relations that have been kept during the +# filtering above will be checked. The 'linename' will be normalized +# according to the rules in line_normalization_chain. +# The 'from_name' and 'to_name' will be normalized according to the +# rules in station_normalization_chain. +# The relations tags are given in the order of their relevance - +# the first normalized tag-value that is not null/empty will be +# taken. +osm_line_relation_tags: + line_name=ref,name # careful, no space after/before comma allowed! + from_name=from + to_name=to + + +# attr name together with the +# max distance in meters between any of the groups members and +# a potential new member +# first matching rule will be taken +# only applies to nodes that match osm_filter_station! +osm_station_group_attrs: + uic_ref=500 + wikidata=500 + name=100 + +# max distance in meters between a snapped station position and the +# original station position +osm_max_snap_distance: 10, 100, 200 + +osm_max_snap_level: 4 + + +# sorted by priority, first found attr will be taken +osm_station_name_attrs: + name + uic_name + +# the track number tag in stop nodes, first one is taken +osm_track_number_tags: local_ref + +routing_lvl0_fac: 1 # default level +routing_lvl1_fac: 1.5 +routing_lvl2_fac: 2 +routing_lvl3_fac: 2.5 +routing_lvl4_fac: 3.5 +routing_lvl5_fac: 5 +routing_lvl6_fac: 5 +routing_lvl7_fac: 5 + +# Punishment (in meters) to add to the distance +# function if a vehicle performans a full turn +routing_full_turn_punish: 100 + +routing_station_distance_punish_fac: 3.14 + +routing_non_osm_station_punish: 50 + +# Max angle that should be counted as a full turn +routing_full_turn_angle: 45 + +# Max angle in a route from a station to an already reachable neighbar +routing_snap_full_turn_angle: 0 + +# Punishment (in meters) to add to the distance +# function if a vehicle passes a station node without +# stopping there +routing_pass_thru_station_punish: 0 + +# Punishment factor for every meter a vehicle +# travels through a one-way edge +routing_one_way_meter_punish_fac: 1 + +# Punishment factor for every meter a vehicle +# travels through an edge without any matching line +# information +routing_line_unmatched_punish_fac: 0.5 + +[tram, bus, subway, rail, gondola, funicular, ferry] +# Regular expressions and station comparision is +# always case insensitive! +station_normalize_chain: + , -> ' '; + - -> ' '; + — -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + \( -> ' '; + \) -> ' '; + \[ -> ' '; + \] -> ' '; + / -> ' '; + '\\' -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + ô -> o; + ç -> c; + í -> i; + ú -> u; + ù -> u; + ë -> e; + å -> ae; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + str\. -> strasse; + av\. -> avenue; + + # always separate 'street', 'strasse' + '([a-zA-Z])strasse($| )' -> '\1 strasse\2'; + '([a-zA-Z])street($| )' -> '\1 street\2'; + + # always use "street" + '(^| )strasse($| )' -> '\1street\2'; + + # always use "avenue" + '(^| )avenida($| )' -> '\1avenue\2'; + '(^| )avenu($| )' -> '\1avenue\2'; + + # normalize every possible abbr. of german "Bahnhof", "Hauptbahnhof", "Busbahnhof" + '(^| )hauptbf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbf($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbhf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hauptbhf($| )' -> '\1hauptbahnhof\2'; + '(^| )zentraler busbahnhof($| )$' -> \1busbahnhof\2; + '(^| )zentraler omnibusbahnhof($| )$' -> \1busbahnhof\2; + '(^| )omnibusbahnhof($| )' -> '\1busbahnhof\2'; + '(^| )omnibusbhf($| )' -> '\1busbahnhof\2'; + '(^| )busbf\.($| )' -> '\1busbahnhof\2'; + '(^| )busbf($| )' -> '\1busbahnhof\2'; + '(^| )bus bf\.($| )' -> '\1busbahnhof\2'; + '(^| )bus bf($| )' -> '\1busbahnhof\2'; + '(^| )busbhf\.($| )' -> '\1busbahnhof\2'; + '(^| )busbhf($| )' -> '\1busbahnhof\2'; + '(^| )bus bhf\.($| )' -> '\1busbahnhof\2'; + '(^| )bus bhf($| )' -> '\1busbahnhof\2'; + '(^| )zob($| )' -> '\1busbahnhof\2'; + '(^| )hbf\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hbf($| )' -> '\1hauptbahnhof\2'; + '(^| )hb\.($| )' -> '\1hauptbahnhof\2'; + '(^| )hb($| )' -> '\1hauptbahnhof\2'; + '(^| )bf\.($| )' -> '\1bahnhof\2'; + '(^| )bf($| )' -> '\1bahnhof\2'; + '(^| )bhf\.($| )' -> '\1bahnhof\2'; + '(^| )bhf($| )' -> '\1bahnhof\2'; + '(^| )bhfeingang($| )' -> '\1bahnhofeingang\2'; + '(^| )gare de($| )' -> '\1gare\2'; + + + # if a stations starts with single station identifier + # always put it at the end (for example, "hauptbahnhof freiburg" becomes "freiburg hauptbahnhof") + '^hauptbahnhof (.+)$' -> \1 hauptbahnhof; + '^bahnhof (.+)$' -> \1 bahnhof; + '^busbahnhof (.+)$' -> \1 busbahnhof; + '^gare (.+)$' -> \1 gare; + '^station (.+)$' -> \1 station; + + '(^| )busbahnhof($| )' -> '\1bbahnhof\2'; + + # normalize line types in station names + '(^| )u bahn\.($| )' -> '\1ubahn\2'; + '(^| )metro\.($| )' -> '\1ubahn\2'; + '(^| )subway\.($| )' -> '\1ubahn\2'; + '(^| )underground\.($| )' -> '\1ubahn\2'; + '(^| )ubahn($| )' -> '\1u\2'; + '(^| )s bahn\.($| )' -> '\1sbahn\2'; + '(^| )sbahn($| )' -> '\1s\2'; + '(^| )tramway($| )' -> '\1tram\2'; + '(^| )stadtbahn($| )' -> '\1tram\2'; + '(^| )strassenbahn($| )' -> '\1tram\2'; + '(^| )streetcar($| )' -> '\1tram\2'; + '(^| )tram($| )' -> '\1t\2'; + + # delete track information from name + '(^| )kante [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )gleis [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )track [a-zA-Z0-9]{1,2}($| )' -> ' '; + '(^| )voie [a-zA-Z0-9]{1,2}($| )' -> ' '; + + # abbrv + '(^| )und($| )' -> '\1+\2'; + '(^| )and($| )' -> '\1+\2'; + '(^| )et($| )' -> '\1+\2'; + + # noise + '\sde\s' -> ' '; + '\sda\s' -> ' '; + '\sdi\s' -> ' '; + '\sdel\s' -> ' '; + '\sdal\s' -> ' '; + + # abbrv in most western languages + '(^| )saint ' -> '\1st. '; + '(^| )sankt ' -> '\1st. '; + '(^| )sanct ' -> '\1st. '; + + \. -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + +line_normalize_chain: + , -> ' '; + - -> ' '; + _ -> ' '; + " -> ''; + ' -> ''; + ` -> ''; + / -> ' '; + < -> ' '; + > -> ' '; + & -> '+'; + ä -> ae; + ö -> oe; + ü -> ue; + ß -> ss; + è -> e; + é -> e; + á -> a; + à -> a; + ó -> o; + ò -> o; + í -> i; + ú -> u; + ù -> u; + ë -> e; + å -> ae; + ç -> c; + â -> a; + ê -> e; + ï -> i; + œ -> oe; + ø -> oe; + ^line -> ''; + ^linie -> ''; + ^metro -> ''; + ^tram -> ''; + ^strassenbahn -> ''; + ^bus -> ''; + + # delete everything in brackets + \(.+\) -> ' '; + \[.+\] -> ' '; + + # whitespace + \s+ -> ' '; + ^\s -> ''; + \s$ -> ''; + + # line/number combs ALWAYS without whitespace (T 2 -> T2) + ^([a-zA-Z]+) ([0-9]+)$ -> \1\2; + +track_normalize_chain: + '(^| )gleis($| )' -> ''; + '(^| )gl\.($| )' -> ''; + '(^| )platform($| )' -> ''; + '(^| )track($| )' -> ''; + '(^| )rail($| )' -> ''; + # line/number combs ALWAYS without whitespace (1 A -> 1A) + ^([a-zA-Z]+) ([0-9]+)$ -> \1\2; + ^([0-9]+) ([a-zA-Z]+)$ -> \1\2; + + # delete track numbers greater than 999 + ^[0-9]{4,}$ -> '';