mappymatch.constructs.road#

Classes

Road(road_id, geom[, metadata])

Represents a road that can be matched to;

RoadId(start, end, key)

class mappymatch.constructs.road.RoadId(start, end, key)[source]#
Parameters:
  • start (int | str | None)

  • end (int | str | None)

  • key (int | str | None)

start: Union[int, str, None]#

Alias for field number 0

end: Union[int, str, None]#

Alias for field number 1

key: Union[int, str, None]#

Alias for field number 2

to_string()[source]#
Return type:

str

to_json()[source]#
Return type:

Dict[str, Any]

classmethod from_string(s)[source]#
Return type:

RoadId

Parameters:

s (str)

classmethod from_json(json)[source]#
Return type:

RoadId

Parameters:

json (Dict[str, Any])

class mappymatch.constructs.road.Road(road_id: RoadId, geom: LineString, metadata: dict | None = None)[source]#

Represents a road that can be matched to;

Attributes:

road_id: The unique identifier for this road geom: The geometry of this road origin_junction_id: The unique identifier of the origin junction of this road destination_junction_id: The unique identifier of the destination junction of this road metadata: an optional dictionary for storing additional metadata

Parameters:
  • road_id (RoadId)

  • geom (LineString)

  • metadata (dict | None)

road_id: RoadId#

Alias for field number 0

geom: LineString#

Alias for field number 1

metadata: Optional[dict]#

Alias for field number 2

to_dict()[source]#

Convert the road to a dictionary

Return type:

Dict[str, Any]

to_flat_dict()[source]#

Convert the road to a flat dictionary

Return type:

Dict[str, Any]