Visual Timeline¶
render_map() takes a detection extract CSV file as a data source, as
well as a string indicating what the title of the plot should be. The
title string will also be the filename for the HTML output, located in
an html file.
You can supply a basemap argument to choose from a few alternate basemap tilesets. Available basemaps are:
- No basemap set or
basemap='dark_layer'- CartoDB/OpenStreetMap Dark basemap='Esri_OceanBasemap'- coarse ocean bathymetrybasemap='CartoDB_Positron'- grayscale land/oceanbasemap='Stamen_Toner'- Stamen Toner - high-contrast black and white - black ocean
Warning
Input files must include datecollected, catalognumber, station, latitude, longitude, and unqdetecid as columns.
Below is the sample output for blue sharks off of the coast of Nova Scotia.
Visual Timeline Functions¶
-
geojson.unix_time_millis(dt)¶ Returns a datetime in milliseconds
Parameters: dt – datetime/timestamp Returns: datetime in milliseconds
-
geojson.create_geojson(detections, title, dets_table='', inc=5000)¶ This function maps a compressed file and converts the necessary fields into a GeoJSON file that can be easily read by Leaflet
Parameters: - detections – a compressed or uncompressed csv detections file
- dets_table – An override variable if the table does not match the file name
- inc – the number of detections to include in each subection of the json
Returns: JSON object, the filename, center_x, center_y