VizX
Overview
databricks.labs.gbx.vizx renders rasters and turns Spark DataFrames into GeoDataFrames for interactive maps. It is tier-agnostic — the raster plotters take tile bytes (use them with pyrx or rasterx tiles), and the vector adapters take any Spark DataFrame.
These are driver-side, single-node helpers for inspecting results in a notebook — not distributed operations. They collect to the driver, so the vector adapters guard the collect with max_rows.
gbx.vizx requires geobrix[vizx], which pulls in matplotlib, geopandas, folium, and mapclassify. The package itself imports only matplotlib (raster rendering) and geopandas (the GeoDataFrame adapters); folium + mapclassify are used by plot_interactive / GeoDataFrame.explore() for interactive maps.
Key Features
- Raster plotting —
plot_raster/plot_filerender tile bytes or files (single-band, RGB, percentile stretch, coverage-depth, and mask-layer composites) - VRT mosaic rendering —
plot_mosaicrenders a whole mini-COG VRT mosaic (from thecog_gbxvrtMosaicwriter) as one memory-safe georeferenced image, with a bbox viewport and an optional h3 cell overlay - DataFrame → GeoPandas adapters —
as_gdf/cells_as_gdf/grid_as_gdfturn Spark geometry, H3-cell, and gridspec DataFrames into GeoDataFrames for.plot()/.explore() - Multi-layer compositor —
plot_static/plot_interactiveoverlay vector, raster, grid, and PMTiles layers in a single map - PMTiles & COG viewers —
plot_pmtiles,plot_cog, andpmtiles_infoinspect and render archives inline - Tier-agnostic, Python-only — works with
pyrxorrasterxtiles; a driver-side notebook helper, not a SQL/Spark package
Installation
pip install "geobrix[vizx]"
From a Databricks notebook (commonly alongside the lightweight tier):
%pip install --quiet "geobrix[light_env6,vizx] @ file:///Volumes/<catalog>/<schema>/<volume>/geobrix-0.5.0-py3-none-any.whl"
Import
from databricks.labs.gbx.vizx import (
plot_raster,
plot_file,
plot_mask_layers,
plot_static,
plot_interactive,
plot_pmtiles,
plot_cog,
plot_mosaic,
as_gdf,
cells_as_gdf,
grid_as_gdf,
)
from databricks.labs.gbx.pmtiles import pmtiles_info
What's in VizX
| Sub-page | What it covers | When to use it |
|---|---|---|
| Multi-Layer Compositor | plot_static / plot_interactive with multiple layers; embed-size ladder; audit; simplify | Overlaying vector, raster, grid, and PMTiles layers in one map |
| PMTiles Viewers | pmtiles_info, plot_pmtiles, plot_cog | Inspecting and rendering PMTiles archives and COGs inline |
| Vector | plot_interactive (single-layer), plot_static (single-layer), as_gdf, cells_as_gdf, grid_as_gdf | Interactive and static single-layer maps; converting DataFrames to GeoDataFrames |
| Raster | plot_raster, plot_file, plot_mask_layers, plot_mosaic, escape hatches | Rendering raster tiles from bytes or disk, and whole VRT mosaics |
Next steps
- Multi-Layer Compositor — layer types, embed-size ladder, ephemeral/durable simplify, scale guidance
- PMTiles Viewers —
pmtiles_info,plot_pmtiles,plot_cog - Vector — interactive and static single-layer maps, vector adapters
- Raster — raster rendering, escape hatches
- RasterX Function Reference
- STAC Client
- Helios notebooks — worked end-to-end example using
plot_pmtiles,plot_cog, andpmtiles_infoto render San Francisco tilesets inline.