aequilibrae.transit.transit_elements.pattern#

Classes

Pattern(route_id, gtfs_feed)

Represents a stop pattern for a particular route, as defined in GTFS.

class aequilibrae.transit.transit_elements.pattern.Pattern(route_id, gtfs_feed)[source]#

Represents a stop pattern for a particular route, as defined in GTFS.

best_shape() LineString[source]#

Gets the best version of shape available for this pattern

from_row(data: Series)#
get_error(what_to_get='culprit') tuple | None[source]#

Returns information on the area of the network a map-matching error occurred

Arguments:

what_to_get (str): The object you want returned. Options are ‘culprit’ and ‘partial_path’

Returns:

map_match()[source]#

Map matches the route into the network, considering its appropriate shape.

Part of the map-matching process is to find the network links corresponding the pattern’s raw shape, so that method will be called in case it has not been called before.

The basic algorithm behind the map-matching algorithm is described in https://doi.org/10.3141%2F2646-08

In a nutshell, we compute the shortest path between the nodes corresponding to the links to which stops were geographically matched, for each pair of identified links.

We do not consider links that are in perfect sequence, as we found that it introduces severe issues when stops are close to intersections without clear upsides.

When issues are found, we remove the stops in the immediate vicinity of the issue and attempt new path finding. The First and last stops/corresponding links are always kept.

If an error was found, (record for it will show in the log), it is stored within the object.

save_to_database(conn: Connection, commit=True) None[source]#

Saves the pattern to the routes table