code: def mapTrace(trace, net, delta, verbose=False):
      
      result = []
      paths = {}
      if verbose:
          print("mapping trace with %s points" % len(trace))
      for pos in trace:
          newPaths = {}
          candidates = net.getNeighboringEdges(pos[0], pos[1], delta)
          if len(candidates) == 0 and verbose:
              print("Found no candidate edges for %s,%s" % pos)
          for edge, d in candidates:
              if paths:
                  minDist = 1e400
                  minPath = None
                  for path, dist in paths.iteritems():
                      if dist < minDist:
                          if edge == path[-1]:
                              minPath = path
                              minDist = dist
                          elif edge in path[-1].getOutgoing():
                              minPath = path + (edge,)
                              minDist = dist
                          else:
                              minPath = path + (edge,)
                              minDist = dist + euclidean(
                                  path[-1].getToNode().getCoord(),
                                  edge.getFromNode().getCoord())
                  if minPath:
                      newPaths[minPath] = minDist + d * d
              else:
                  newPaths[(edge,)] = d * d
          if not newPaths:
              if paths:
                  result += [e.getID() for e in _getMinPath(paths)]
          paths = newPaths
      if paths:
          return result + [e.getID() for e in _getMinPath(paths)]
      return result
docs: matching a list of 2D positions to consecutive edges in a network