Skip to main content

VizX 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.

Opt-in extra

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 plottingplot_raster / plot_file render tile bytes or files (single-band, RGB, percentile stretch, coverage-depth, and mask-layer composites)
  • VRT mosaic renderingplot_mosaic renders a whole mini-COG VRT mosaic (from the cog_gbx vrtMosaic writer) as one memory-safe georeferenced image, with a bbox viewport and an optional h3 cell overlay
  • DataFrame → GeoPandas adaptersas_gdf / cells_as_gdf / grid_as_gdf turn Spark geometry, H3-cell, and gridspec DataFrames into GeoDataFrames for .plot() / .explore()
  • Multi-layer compositorplot_static / plot_interactive overlay vector, raster, grid, and PMTiles layers in a single map
  • PMTiles & COG viewersplot_pmtiles, plot_cog, and pmtiles_info inspect and render archives inline
  • Tier-agnostic, Python-only — works with pyrx or rasterx tiles; 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-pageWhat it coversWhen to use it
Multi-Layer Compositorplot_static / plot_interactive with multiple layers; embed-size ladder; audit; simplifyOverlaying vector, raster, grid, and PMTiles layers in one map
PMTiles Viewerspmtiles_info, plot_pmtiles, plot_cogInspecting and rendering PMTiles archives and COGs inline
Vectorplot_interactive (single-layer), plot_static (single-layer), as_gdf, cells_as_gdf, grid_as_gdfInteractive and static single-layer maps; converting DataFrames to GeoDataFrames
Rasterplot_raster, plot_file, plot_mask_layers, plot_mosaic, escape hatchesRendering raster tiles from bytes or disk, and whole VRT mosaics

Next steps