osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.42k stars 991 forks source link

Automatically generate route name #17789

Open Dimitar5555 opened 11 months ago

Dimitar5555 commented 11 months ago

πŸš€ feature request

Description

Currently PT routes will show only their ref if name is not present.

The screenshot is taken from https://www.openstreetmap.org/node/10744861347.

Describe the solution you'd like

Generating names like iD editor does it should work.

https://github.com/openstreetmap/iD/pull/8276/files

display_name:
      direction: "{direction}"
      from_to: "from {from} to {to}"
      from_to_via: "from {from} to {to} via {via}"
      network_direction: "{network} {direction}"
      network_from_to: "{network} from {from} to {to}"
      network_from_to_via: "{network} from {from} to {to} via {via}"
      ref: "{ref}"
      ref_direction: "{ref} {direction}"
      ref_from_to: "{ref} from {from} to {to}"
      ref_from_to_via: "{ref} from {from} to {to} via {via}"
      network_ref: "{network} {ref}"
      network_ref_direction: "{network} {ref} {direction}"
      network_ref_from_to: "{network} {ref} from {from} to {to}"
      network_ref_from_to_via: "{network} {ref} from {from} to {to} via {via}"

Describe alternatives you've considered

The only workaround is to add a name, but there is not much point in duplicating the data that is already available in machine readable format.

DmitryAlexei commented 11 months ago
vshcherb commented 6 months ago

It's not clear in which order should we apply the rules:

display_name:
      direction: "{direction}"
      from_to: "from {from} to {to}"
      from_to_via: "from {from} to {to} via {via}"

In order they are mentionned they won't work as 3rd option wouldn't make sense as it will be always captured by 2nd option, may be they are applied in reverse order

Dimitar5555 commented 6 months ago

I haven't noticed that detail. It should be fine if they are applied from the bottom to the top.

vshcherb commented 1 month ago
display_name:
      direction: "{direction}"
      from_to: "from {from} to {to}"
      from_to_via: "from {from} to {to} via {via}"
      network_direction: "{network} {direction}"
      network_from_to: "{network} from {from} to {to}"
      network_from_to_via: "{network} from {from} to {to} via {via}"
      ref: "{ref}"
      ref_direction: "{ref} {direction}"
      ref_from_to: "{ref} from {from} to {to}"
      ref_from_to_via: "{ref} from {from} to {to} via {via}"
      network_ref: "{network} {ref}"
      network_ref_direction: "{network} {ref} {direction}"
      network_ref_from_to: "{network} {ref} from {from} to {to}"
      network_ref_from_to_via: "{network} {ref} from {from} to {to} via {via}"

Summarizing rules following observations are:

  1. {ref} is core, if it's present it will always show.
  2. {from} to {to} via {via} or {direction} - will always show up if they are present. {from} {to} has more priority if {direction}
  3. {network} will always append to the beginning if present
vshcherb commented 1 month ago

Name typically contains from / to, so we need to focus on examples when name is not present or not relevant