Skip to content

Releasing lonboard 0.13!

Lonboard is a Python library for fast, interactive geospatial vector data visualization in Jupyter.

This post gives an overview of what's new in Lonboard version 0.13.

Refer to the changelog for all updates.

New layer types: H3, S2, Geohash, A5

Lonboard supports new layer types for H3, S2, Geohash, and A5 data.

  • H3HexagonLayer: render hexagons from the H3 geospatial indexing system
  • S2Layer: render polygons based on the S2 geospatial indexing system.
  • A5Layer: render polygons based on the A5 geospatial indexing system.
  • GeohashLayer: render polygons based on the Geohash geospatial indexing system.

Screenshot from H3 Population example

Additionally, the HeatmapLayer, which has been broken since Lonboard v0.10 due to upstream changes in deck.gl, has been fixed and is now functional again. (Thanks to @felixpalmer for fixing this upstream!).

Interleaved rendering with Maplibre

When rendering dense visualizations, the data can obscure helpful elements of the basemap, removing spatial context from the visualization.

It's now possible to render Lonboard data layers interleaved in the Maplibre layer stack. This means Maplibre text labels can be rendered above your Lonboard-rendered data.

Screenshot from H3 Population example

To do this:

  • Set before_id on your layer as the value of the Maplibre layer id you want the Lonboard layer to be under. See before_id for more information.
  • Create a new basemap set to interleaved mode:
  • Pass the basemap to the Map constructor.
from lonboard.basemap import MaplibreBasemap
from lonboard import Map, ScatterplotLayer

# Example layer ID when using Carto basemap styles
layer = ScatterplotLayer(..., before_id="watername_ocean")
basemap = MaplibreBasemap(mode="interleaved")
m = Map(layer, basemap=basemap)

Map controls: scale, fullscreen, navigation

Common UI elements that we call "Controls" are now supported in Lonboard maps. In this release, this includes three types of controls:

  • Scale control: shows a scale bar on the map
  • Fullscreen control: button to toggle fullscreen mode
  • Navigation control: zoom in/out buttons and a compass

These three controls are rendered on the map by default, but can be customized via the Map.controls attribute. See lonboard.controls for more information.

Performance improvements

First and foremost, I learned there was severe bug in which the string representation (aka repr) of the table attribute was being generated during map display. In conjunction with an upstream issue, this made it very slow to render a map for datasets with many coordinates in a single row (such as polygons representing administrative boundaries). !1015 improved the Python-side of rendering by 99% in this case, from 12 seconds to 5 milliseconds.

In !902 we now fully parallelize the Parquet file generation in a thread pool on the Python side, leading to 4x faster Parquet serialization.

In !954 we improve the Polygon rendering performance on the JavaScript side and remove a network request for a dependency needed to perform multi-threaded preparation for Polygon data rendering.

In general, Lonboard data rendering should feel instantaneous. If it's especially slow, on the order of ~10 seconds, open an issue with your dataset to discuss.

All updates

Refer to the changelog for all updates.