Skip to main content
`Ctrl`+`K`

# Mapping

Moduke to manage mapping of GPS tracks on geographic features

tracklib.algo.Mapping.__projOnTrack(point, track)

  TODO

tracklib.algo.Mapping.__distToNode(track, coord, i, end=0)

  TODO

tracklib.algo.Mapping.__states(track, k)

  TODO

tracklib.algo.Mapping.__obs_log(s, y, k, track)

  TODO

tracklib.algo.Mapping.__tst_log(s1, s2, k, track)

  TODO

tracklib.algo.Mapping.__mapOnNetwork(track, network, obs_noise=50, transition_cost=10, search_radius=50, debug=False)

  TODO

tracklib.algo.Mapping.mapOnNetwork(tracks, network, gps_noise=50, transition_cost=10, search_radius=50, debug=False, report=None)

  Map-matching on a network.

tracklib.algo.Mapping.mapOnRaster(track, raster)

  Raster data transfer to track. Add an analytical feature for each grid in the raster.

  Returns

    void

tracklib.algo.Mapping.mapOn(track, reference, TP1=[], TP2=[], init=[], apply=True, N_ITER_MAX=20, NPTS=30, mode='2D', verbose=True)

  Geometric affine transformation to align two tracks with different coordinate systems.

  For “2D” mode, coordinates must be ENU or Geo. For “3D” mode, any type of coordinates is valid. In general, it is recommended to avoid usage of non-metric Geo coordinates for mapping operation, since it is relying on an isotropic error model.

  TP1 and TP2 must have same size. Adjustment is performed with least squares. The general transformation from point X to point X’ is provided below:

  \[X' = kRX + T\]

  with: \(k\) a positive real value, \(R\) a 2D or 3D rotation matrix and \(T\) a 2D or 3D translation vector. Transformation parameters are returned in standard output in the following format: [theta, k, tx, ty] (theta in radians).

  Track argument may also be replaced by a list of points. If TP1 is an empty list or if it is not specified, adjustment is performed with iterative closest point (ICP) algorithm, to solve both the transfo and the data association problems in a single framework. This method requires however that the “initial guess” (i.e. scale difference and rotation between both datasets) be not too far from reality, in order to reach a good solution. For standard least squares, time complexity of the method is \(O(n^2)\) with \(n\) the number of points used for data matching. For ICP, data association step is \(O(n^2)\) and least squares resolution is \(O(n^2)\) hence an overall complexity equal to N_ITER_MAX * O(NPTS^2). In general NPTS = 30 performs fair enough.

  Note that mapOn does not handle negative determinant (symetries not allowed)

  Parameters

    - reference – another track we want to align on or a list of points

    - TP1 – list of tie points indices (relative to track)

    - TP2 – list of tie points indices (relative to reference). If TP2 is not specified, it is assumed equal to TP1.

    - init – “initial guess” vector : [rotation angle, scale, tx, ty]

    - N_ITER_MAX (`int`) – maximal number of iterations (in least squares or ICP)

    - apply (`bool`) – boolean value to specify if estimated transfo must be performed

    - mode (`str`) – could be “2D” (default) or “3D”

    - NPTS (`int`) – integer specifying number of points to consider (for ICP only)

  Returns

    transformation parameters in the following format: [theta, k, tx, ty]