BaseMap

class leuvenmapmatching.map.base.BaseMap(name, use_latlon=True)[source]

Abstract class for a Map.

Simple database wrapper/stub.

abstract all_edges(bb=None)[source]

All edges.

Returns:

[(key_a, loc_a, key_b, loc_b)]

abstract all_nodes(bb=None)[source]

All node keys and coordinates.

Returns:

[(key, (lat, lon))]

abstract bb()[source]

Bounding box.

Returns:

(lat_min, lon_min, lat_max, lon_max)

abstract edges_closeto(loc, max_dist=None, max_elmt=None)[source]

Find edges close to a certain location.

Parameters:
  • loc – Latitude, Longitude

  • max_dist – Maximal distance that returned nodes can be from lat-lon

  • max_elmt – Maximal number of elements returned after sorting according to distance.

Returns:

list[tuple[dist, label, loc]]

edges_nbrto(edge: BaseMap) List[Tuple[LabelType, LocType, LabelType, LocType]][source]

Return all edges that are linked to edge.

Defaults to nodes_nbrto.

Parameters:

edge – Edge identifier

Returns:

list[tuple[label1, label2, loc1, loc2]]

abstract labels()[source]

Labels of all nodes.

abstract node_coordinates(node_key)[source]

Coordinates for given node key.

abstract nodes_closeto(loc, max_dist=None, max_elmt=None)[source]

Find nodes close to a certain location.

Parameters:
  • loc – Latitude, Longitude

  • max_dist – Maximal distance that returned nodes can be from lat-lon

  • max_elmt – Maximal number of elements returned after sorting according to distance.

Returns:

list[tuple[dist, label, loc]]

abstract nodes_nbrto(node: BaseMap) List[Tuple[LabelType, LocType]][source]

Return all nodes that are linked to node.

Parameters:

node – Node identifier

Returns:

list[tuple[label, loc]]

abstract size()[source]

Number of nodes.