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,
    polygon_kwargs: Optional[PolygonLayerKwargs] = 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
  • pyarrow Array marked with a GeoArrow extension type defined by geoarrow-pyarrow

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

Parameters:

Other Parameters:

  • scatterplot_kwargs (Optional[ScatterplotLayerKwargs]) –

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

  • path_kwargs (Optional[PathLayerKwargs]) –

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

  • polygon_kwargs (Optional[PolygonLayerKwargs]) –

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

  • map_kwargs (Optional[MapKwargs]) –

    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,
    ArrowArrayExportable,
    ArrowStreamExportable,
    GeoInterfaceProtocol,
    Dict[str, Any],
]

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