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, ...]],
    **kwargs
) -> 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:

Named args

Any other keyword arguments will be passed onto the relevant layer, either a ScatterplotLayer, PathLayer, or SolidPolygonLayer.

If you pass a list or tuple of data objects, kwargs will be passed to all layers. For more control over rendering, construct Map and Layer objects directly.

Returns:

  • Map

    widget visualizing the provided data.

VizDataInput module-attribute

VizDataInput = Union[
    gpd.GeoDataFrame,
    gpd.GeoSeries,
    pa.Table,
    NDArray[np.object_],
    shapely.geometry.base.BaseGeometry,
    GeoInterfaceProtocol,
    Dict[str, Any],
]

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