BaseMap

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

Abstract class for a Map.

Simple database wrapper/stub.

all_edges(bb=None)[source]

All edges.

Returns:[(key_a, loc_a, key_b, loc_b)]
all_nodes(bb=None)[source]

All node keys and coordinates.

Returns:[(key, (lat, lon))]
bb()[source]

Bounding box.

Returns:(lat_min, lon_min, lat_max, lon_max)
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)[source]

Return all edges that are linked to edge.

Defaults to nodes_nbrto.

Parameters:edge – Edge identifier
Returns:list[tuple[label1, label2, loc1, loc2]]
labels()[source]

Labels of all nodes.

node_coordinates(node_key)[source]

Coordinates for given node key.

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]]

nodes_nbrto(node)[source]

Return all nodes that are linked to node.

Parameters:node – Node identifier
Returns:list[tuple[label, loc]]
size()[source]

Number of nodes.