mappymatch.maps.map_interface#

Classes

MapInterface()

Abstract base class for a Matcher

class mappymatch.maps.map_interface.MapInterface[source]#

Abstract base class for a Matcher

abstract property distance_weight: str#

Get the distance weight

Returns:

The distance weight

abstract property time_weight: str#

Get the time weight

Returns:

The time weight

abstract property roads: List[Road]#

Get a list of all the roads in the map

Returns:

A list of all the roads in the map

abstract road_by_id(road_id)[source]#

Get a road by its id

Return type:

Optional[Road]

Parameters:

road_id (RoadId)

Args:

road_id: The id of the road to get

Returns:

The road with the given id or None if it does not exist

abstract nearest_road(coord)[source]#

Return the nearest road to a coordinate

Return type:

Road

Parameters:

coord (Coordinate)

Args:

coord: The coordinate to find the nearest road to

Returns:

The nearest road to the coordinate

abstract shortest_path(origin, destination, weight=None)[source]#

Computes the shortest path on the road network

Return type:

List[Road]

Parameters:
Args:

origin: The origin coordinate destination: The destination coordinate weight: The weight to use for the path

Returns:

A list of roads that form the shortest path