apache/superset · error · Error
GeoJSON column is required for GeoJSON charts
Error message
GeoJSON column is required for GeoJSON charts
What it means
Thrown by the deck.gl GeoJSON layer's buildQuery when the geojson form field is empty. The entire layer renders one GeoJSON feature per row, so the column holding the GeoJSON payload is indispensable; without it the query would return rows the renderer cannot draw. Fail-fast configuration guard raised before any SQL is generated.
Source
Thrown at superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/buildQuery.ts:45
import { addTooltipColumnsToQuery } from '../buildQueryUtils';
export interface DeckGeoJsonFormData extends SqlaFormData {
geojson?: string;
filter_nulls?: boolean;
cross_filter_column?: string | null;
tooltip_contents?: unknown[];
}
export default function buildQuery(formData: DeckGeoJsonFormData) {
const {
geojson,
filter_nulls = true,
cross_filter_column,
tooltip_contents,
} = formData;
if (!geojson) {
throw new Error('GeoJSON column is required for GeoJSON charts');
}
return buildQueryContext(formData, (baseQueryObject: QueryObject) => {
let columns: QueryFormColumn[] = [
...ensureIsArray(baseQueryObject.columns || []),
geojson,
];
if (cross_filter_column && !columns.includes(cross_filter_column)) {
columns.push(cross_filter_column);
}
// Add tooltip columns
columns = addTooltipColumnsToQuery(columns, tooltip_contents);
// Add null filter for geojson column
const filters: QueryObjectFilterClause[] = ensureIsArray(
baseQueryObject.filters || [],View on GitHub (pinned to f4587218dd)
Solutions
- Open the chart in Explore and select the column containing GeoJSON payloads in the 'GeoJSON Column' control, then save.
- Confirm the dataset still exposes that column (Calma / dataset editor) and re-bind if it was renamed.
- When creating charts via the REST API, include geojson in params.
Example fix
// before
buildQuery(formData); // formData.geojson undefined
// after
if (!formData.geojson) {
throw new Error('Select a GeoJSON column in the chart controls');
}
buildQuery(formData); Defensive patterns
Strategy: validation
Validate before calling
if (!formData.geojson) {
throw new Error('Select a GeoJSON column before querying');
}
buildQuery(formData); Type guard
const hasGeojsonColumn = (fd: DeckGeoJsonFormData): boolean => typeof fd.geojson === 'string' && fd.geojson.length > 0;
Try / catch
try { buildQuery(formData); } catch (e) { if (e.message.includes('GeoJSON column')) showConfigToast(e.message); else throw e; } Prevention
- Require the GeoJSON control before chart save/run
- Re-validate chart params after dataset schema changes
When it happens
Trigger: Running a Deck.gl GeoJSON chart where the 'GeoJSON Column' control is unset, or where saved/API-supplied params omit the geojson key (imported dashboards, chart duplication from a stub, dataset re-binding).
Common situations: Chart created but never fully configured then added to a dashboard; dataset schema drift removing the GeoJSON column; dashboards loaded from export JSON with incomplete form params.
Related errors
- Start and end spatial configurations are required for Arc ch
- Line column is required for Path charts
- Polygon column is required for Polygon charts
- Spatial configuration is required for Scatter charts
- Spatial configuration is required for this chart
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/babcf5b2747102c0.
Report an issue: GitHub.