mappymatch.utils.plot#

Functions

plot_geofence(geofence[, m])

Plot geofence.

plot_map(tmap[, m])

Plot the roads on an NxMap.

plot_match_distances(matches)

Plot the points deviance from known roads with matplotlib.

plot_matches(matches[, crs])

Plots a trace and the relevant matches on a folium map.

plot_path(path, crs[, m, line_color, ...])

Plot a list of roads.

plot_trace(trace[, m, point_color, line_color])

Plot a trace.

mappymatch.utils.plot.plot_geofence(geofence, m=None)[source]#

Plot geofence.

Args:

geofence: The geofence to plot m: the folium map to plot on

Returns:

The updated folium map with the geofence.

Parameters:
mappymatch.utils.plot.plot_trace(trace, m=None, point_color='black', line_color='green')[source]#

Plot a trace.

Args:

trace: The trace. m: the folium map to plot on point_color: The color the points will be plotted in. line_color: The color for lines. If None, no lines will be plotted.

Returns:

An updated folium map with a plot of trace.

Parameters:
  • trace (Trace)

  • m (Map | None)

  • point_color (str)

  • line_color (str | None)

mappymatch.utils.plot.plot_matches(matches, crs=<Projected CRS: EPSG:3857> Name: WGS 84 / Pseudo-Mercator Axis Info [cartesian]: - X[east]: Easting (metre) - Y[north]: Northing (metre) Area of Use: - name: World between 85.06°S and 85.06°N. - bounds: (-180.0, -85.06, 180.0, 85.06) Coordinate Operation: - name: Popular Visualisation Pseudo-Mercator - method: Popular Visualisation Pseudo Mercator Datum: World Geodetic System 1984 ensemble - Ellipsoid: WGS 84 - Prime Meridian: Greenwich)[source]#

Plots a trace and the relevant matches on a folium map.

Args: matches: A list of matches or a MatchResult. crs: what crs to plot in. Defaults to XY_CRS.

Returns:

A folium map with trace and matches plotted.

Parameters:

matches (MatchResult | List[Match])

mappymatch.utils.plot.plot_map(tmap, m=None)[source]#

Plot the roads on an NxMap.

Args:

tmap: The Nxmap to plot. m: the folium map to add to

Returns:

The folium map with the roads plotted.

Parameters:
  • tmap (NxMap)

  • m (Map | None)

mappymatch.utils.plot.plot_match_distances(matches)[source]#

Plot the points deviance from known roads with matplotlib.

Args:

matches (MatchResult): The coordinates of guessed points in the area in the form of a MatchResult object.

Parameters:

matches (MatchResult)

mappymatch.utils.plot.plot_path(path, crs, m=None, line_color='red', line_weight=10, line_opacity=0.8)[source]#

Plot a list of roads.

Args:

path: The path to plot. crs: The crs of the path. m: The folium map to add to. line_color: The color of the line. line_weight: The weight of the line. line_opacity: The opacity of the line.

Parameters:
  • path (List[Road])

  • crs (CRS)

  • m (Map | None)