---
name: "Travel::Routing::DE::EFA::Route::Part"
section: "3pm"
platform: "linux"
package: "libtravel-routing-de-vrr-perl"
version: "2.24-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Travel::Routing::DE::EFA::Route::Part"
---

# Travel::Routing::DE::EFA::Route::Part(3pm)

Describes one connection between two points, without interchanges

## NAME

Travel::Routing::DE::EFA::Route::Part - Describes one connection between two points, without interchanges

## SYNOPSIS

```
        for my $part ( $route->parts ) {
                if ( $part->regular_notes ) {
                        say join( "\n", $part->regular_notes );
                }
                if ( $part->current_notes ) {
                        say join( "\n", map [ $_->{summary} ] $part->current_notes );
                }
                printf(
                        "%s at %s -> %s at %s, via %s to %s",
                        $part->departure_time, $part->departure_stop,
                        $part->arrival_time,   $part->arrival_stop,
                        $part->train_line,     $part->train_destination,
                );
        }
```

## VERSION

version 2.24

## DESCRIPTION

**Travel::Routing::DE::EFA::Route::Part** holds one specific connection (without interchanges) between two points.  It specifies the start/stop point and time, the train line and its destination, and optional additional data.

It is usually obtained by a call to [**Travel::Routing::DE::EFA::Route**(3pm)](/Travel::Routing::DE::EFA::Route/3pm.md)'s **parts** method.

## METHODS

### ACCESSORS

"Actual" in the description means that the delay (if available) is already included in the calculation, "Scheduled" means it isn't.

- $part-\>arrival\_delay

  arrival delay in minutes, 0 if unknown

- $part-\>arrival\_stop

  arrival stop (city name plus station name)

- $part-\>arrival\_platform

  arrival platform (either "Gleis x" or "Bstg. x")

- $part-\>arrival\_stop\_and\_platform

  "stop: platform" concatenation

- $part-\>arrival\_date

  Actual arrival date in DD.MM.YYYY format

- $part-\>arrival\_time

  Actual arrival time in HH:MM format

- $part-\>arrival\_sdate

  Scheduled arrival date in DD.MM.YYYY format

- $part-\>arrival\_stime

  Scheduled arrival time in HH:MM format

- $part-\>arrival\_routemaps

  List of URLs, may be empty. Each URL poinst to a transfer map for the arrival station, usually outlining how to transfer from this train to the next one (if applicable).

- $part-\>arrival\_stationmaps

  List of URLs, may be empty. Each URL points to an HTML map of the arrival station.

- $part-\>current\_notes

  Remarks about unscheduled changes to the line serving this connaction part, such as cancelled stops. Most times, the EFA service does not include this information in its route calculations.

  Returns a list of [**Travel::Routing::DE::EFA::Route::Message**(3pm)](/Travel::Routing::DE::EFA::Route::Message/3pm.md) objects.

- $part-\>delay

  alias for departure\_delay

- $part-\>departure\_delay

  departure delay in minutes, 0 if unknown

- $part-\>departure\_stop

  departure stop (city name plus station name)

- $part-\>departure\_platform

  departure platform (either "Gleis x" or "Bstg. x")

- $part-\>departure\_stop\_and\_platform

  "stop: platform" concatenation

- $part-\>departure\_date

  Actual departure date in DD.MM.YYYY format

- $part-\>departure\_time

  Actual departure time in HH:MM format

- $part-\>departure\_sdate

  Scheduled departure date in DD.MM.YYYY format

- $part-\>departure\_stime

  Scheduled departure time in HH:MM format

- $part-\>departure\_routemaps

  List of URLs, may be empty. Each URL points to a PDF a transfer map for the departure station, usually outlining how to transfer from thep previous train (if applicable) to this one.

- $part-\>departure\_stationmaps

  List of URLs, may be empty. Each URL poinst to an HTML map of the departure station.

- $part-\>footpath\_duration

  Walking duration when transferring before / after / during this trip in minutes. The meaning depends on the value of **footpath\_type**.

- $part-\>footpath\_parts

  Returns a list of \[*type*, *level*\] arrayrefs describing the footpath. For instance, \["ESCALATOR", "UP"\], \["LEVEL", "LEVEL"\], \["STAIRS", "UP"\] means first taking an escalator up, then walking a while, and then taking a flight of stairs up again.

  The content of *type* and *level* comes directly from the EFA backend. At the moment, the following values are known:

  - type: ESCALATOR, LEVEL, STAIRS

    - level: DOWN, LEVEL, UP

    - $part-\>footpath\_type

  type of this footpath, passed through from the EFA backend. The value "AFTER" indicates a footpath (transfer) after this route part. The value "IDEST" indicates that this route part already is a footpath (aka a walking connection between two stops), so the **footpath** accessors contain redundant information. Other values such as "BEFORE" may also be returned, but this is unknown at this point.

- $part-\>is\_cancelled

  Returns true if this part of the route has been cancelled (i.e., the entire route is probably useless), false otherwise.  For unknown reasons, EFA may sometimes return routes which contain cancelled departures.

- $part-\>occupancy

  Returns expected occupancy, if available. Values range from 1 (low occupancy) to 3 (very high occupancy).

- $part-\>regular\_notes

  Remarks about the line serving this connaction part. Returns a list of [**Travel::Routing::DE::EFA::Route::Message**(3pm)](/Travel::Routing::DE::EFA::Route::Message/3pm.md) objects.

- $part-\>train\_destination

  Destination of the line providing the connection. May be empty.

- $part-\>train\_line

  Name / number of the line. May be empty.

- $part-\>train\_product

  Usually the prefix of **train\_line**, for instance `"U-Bahn"` or `"Niederflurstrab"`. However, it may also contain special values such as `"Fussweg"` (for a direct connection without transit vehicles) or `"nicht umsteigen"` (in case a vehicle changes its line number at a stop). In those cases, **train\_destination** and **train\_line** are usually empty.

- $part-\>via

  Returns a list of `"[ "DD.MM.YYYY", "HH:MM", stop, platform, delay ]"` arrayrefs encoding the stops passed between **departure\_stop** and **arrival\_stop**, if supported by the backend. Returns nothing / an empty list otherwise. Date and time refer to schedule data and do not account for delays.

## DIAGNOSTICS

None.

## DEPENDENCIES

- •

  [**Class::Accessor**(3pm)](/Class::Accessor/3pm.md)

## BUGS AND LIMITATIONS

`$part`-\>via does not work reliably.

## SEE ALSO

[**Travel::Routing::DE::EFA::Route::Message**(3pm)](/Travel::Routing::DE::EFA::Route::Message/3pm.md), [**Travel::Routing::DE::EFA**(3pm)](/Travel::Routing::DE::EFA/3pm.md), [**Class::Accessor**(3pm)](/Class::Accessor/3pm.md).

## AUTHOR

Copyright (C) 2011-2021 by Birte Kristina Friesel \<derf@finalrewind.org\>

## LICENSE

This program is licensed under the same terms as Perl itself.
