Skip to content

viz

The top-level namespace accessible after import lonboard.

Layers are also accessible in the top-level namespace, but are documented in the layers/ folder.

lonboard.viz

viz(
    data: Union[VizDataInput, List[VizDataInput], Tuple[VizDataInput, ...]],
    *,
    scatterplot_kwargs: Optional[ScatterplotLayerKwargs] = None,
    path_kwargs: Optional[PathLayerKwargs] = None,
    solid_polygon_kwargs: Optional[SolidPolygonLayerKwargs] = None,
    map_kwargs: Optional[MapKwargs] = None
) -> Map

A high-level function to plot your data easily.

The goal of this function is to make it simple to get something showing on a map. For more control over rendering, construct Map and Layer objects directly.

This function accepts a variety of geospatial inputs:

  • geopandas GeoDataFrame
  • geopandas GeoSeries
  • numpy array of Shapely objects
  • Single Shapely object
  • Any Python class with a __geo_interface__ property conforming to the Geo Interface protocol.
  • dict holding GeoJSON-like data.
  • pyarrow Table with a geometry column marked with a GeoArrow extension type

Alternatively, you can pass a list or tuple of any of the above inputs.

Parameters:

Other Parameters:

  • - (scatterplot_kwargs) –

    a dict of parameters to pass down to all generated ScatterplotLayers.

  • - (path_kwargs) –

    a dict of parameters to pass down to all generated PathLayers.

  • - (solid_polygon_kwargs) –

    a dict of parameters to pass down to all generated SolidPolygonLayers.

  • - (map_kwargs) –

    a dict of parameters to pass down to the generated Map.

For more control over rendering, construct Map and Layer objects directly.

Returns:

  • Map

    widget visualizing the provided data.

VizDataInput module-attribute

VizDataInput = Union[
    GeoDataFrame,
    GeoSeries,
    Table,
    NDArray[object_],
    BaseGeometry,
    ArrowStreamExportable,
    GeoInterfaceProtocol,
    Dict[str, Any],
]

A type definition for allowed data inputs to the viz function.