tracktable.render.backends.ipyleaflet_backend module¶
Note
This module is used by render_trajectories and render_heatmap and shouldn’t be accessed directly.
Module contents¶
tracktable.render.ipyleaflet - render trajectories in using the ipyleaflet backend
- tracktable.render.backends.ipyleaflet_backend.crs_scale(zoom)[source]¶
Scale the CRS based on zoom factor
- tracktable.render.backends.ipyleaflet_backend.crs_zoom(scale)[source]¶
Zoom the CRS based on scale factor
- tracktable.render.backends.ipyleaflet_backend.get_bounds_zoom(map_canvas, bounds, inside=True, size=[960, 400], padding=[0, 0])[source]¶
Get the zoom if the bounding box corners
- Parameters:
map (Basemap) – Map containing bounding box
bounds (point) – Long-Lat point of the bounding box corners
- Keyword Arguments:
inside (bool) – Flag to indicate inside of the bounding box
size (list) – Size of the bouning box
padding (list) – Padding of boundries
- Returns:
The maximum zoom level on which the given bounds fit to the map vie in its entirety
- tracktable.render.backends.ipyleaflet_backend.get_scale_zoom(scale, from_zoom)[source]¶
Get zoom scale factor
- tracktable.render.backends.ipyleaflet_backend.project(latlng, zoom)[source]¶
Projects a geographical coordinate according to the projection of the map’s CRS then scales it according to zoom and the CRS’s Transformation
- Parameters:
latlng (point) – Point to project
zoom (int) – Zoom value to scale by
- Returns:
Pixel coord relative to the CRS origin
- tracktable.render.backends.ipyleaflet_backend.project_spherical_mercator(latlng)[source]¶
Project the spherical mercator for a given lat long value
- Parameters:
latlng (point) – Point transform
- Returns:
Projection of spherical mercator
- tracktable.render.backends.ipyleaflet_backend.render_point_ipyleaflet(current_point, point_popup_properties, coord, point_radius, point_color, map_canvas)[source]¶
Renders a point to the ipyleaflet map.
Currently not officially supported. Just for experimentation!
- Parameters:
current_point (point) – Current point of the trajectory
point_popup_properties (list) – Point properties
coord (tuple) – Coordinates to render point
point_radius (int) – Size of the point to render
point_color (str) – Color of the point to render
map (Basemap) – ipyleaflet map
- Returns:
No return value
- tracktable.render.backends.ipyleaflet_backend.render_trajectories(trajectories, map_canvas=None, obj_ids=[], map_bbox=None, show_lines=True, gradient_hue=None, color_map='', line_color='', linewidth=2.4, show_points=False, point_size=0.6, point_color='', show_dot=True, dot_size=0.7, dot_color='white', trajectory_scalar_generator=<function path_length_fraction_generator>, trajectory_linewidth_generator=None, color_scale=<matplotlib.colors.Normalize object>, show=False, save=False, filename='', tiles='cartodbdark_matter', attr='.', point_popup_properties=[], show_distance_geometry=False, distance_geometry_depth=4, show_scale=True, max_zoom=22, **kwargs)[source]¶
Render a list of trajectories using the ipyleaflet backend
For documentation on the parameters, please see render_trajectories
Currently not officially supported. Just for experimentation!