mappymatch.constructs.match#

Classes

Match(road, coordinate, distance)

Represents a match made by a Matcher

class mappymatch.constructs.match.Match(road: Road | None, coordinate: Coordinate, distance: float)[source]#

Represents a match made by a Matcher

Attributes:

road: The road that was matched; None if no road was found; coordinate: The original coordinate that was matched; distance: The distance to the matched road; If no road was found, this is infinite

Parameters:
road: Optional[Road]#

Alias for field number 0

coordinate: Coordinate#

Alias for field number 1

distance: float#

Alias for field number 2

set_coordinate(c)[source]#

Set the coordinate of this match

Args:

c: The new coordinate

Returns:

The match with the new coordinate

Parameters:

c (Coordinate)

to_flat_dict()[source]#

Convert this match to a flat dictionary

Return type:

dict

Returns:

A flat dictionary with all match information