{"record":{"id":"8324119daf1fc17e","repo":"apache/superset","slug":"unknown-spatial-type-spatial-type","errorCode":null,"errorMessage":"Unknown spatial type: ${spatial.type}","messagePattern":"Unknown spatial type: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"superset-frontend/plugins/preset-chart-deckgl/src/layers/spatialUtils.ts","lineNumber":99,"sourceCode":"        throw new Error(\n          'Longitude and latitude columns are required for latlong type',\n        );\n      }\n      return [spatial.lonCol, spatial.latCol];\n    case 'delimited':\n      if (!spatial.lonlatCol) {\n        throw new Error(\n          'Longitude/latitude column is required for delimited type',\n        );\n      }\n      return [spatial.lonlatCol];\n    case 'geohash':\n      if (!spatial.geohashCol) {\n        throw new Error('Geohash column is required for geohash type');\n      }\n      return [spatial.geohashCol];\n    default:\n      throw new Error(`Unknown spatial type: ${spatial.type}`);\n  }\n}\n\nexport function addSpatialNullFilters(\n  spatial: SpatialConfiguration,\n  filters: QueryObjectFilterClause[],\n): QueryObjectFilterClause[] {\n  if (!spatial) return filters;\n\n  const spatialColumns = getSpatialColumns(spatial);\n  const nullFilters: QueryObjectFilterClause[] = spatialColumns.map(column => ({\n    col: column,\n    op: 'IS NOT NULL',\n    val: null,\n  }));\n\n  return [...filters, ...nullFilters];\n}","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/plugins/preset-chart-deckgl/src/layers/spatialUtils.ts#L81-L117","documentation":"Thrown by the default branch of getSpatialColumns' switch when spatial.type is set to a value outside 'latlong', 'delimited', and 'geohash'. The message interpolates the offending type, so it doubles as a diagnostic for unknown/new spatial encodings. It indicates schema mismatch rather than a missing field.","triggerScenarios":"A spatial config whose type is something like 'latlongs', 'GEOHASH' (wrong case), or a custom value added by a plugin/fork — usually from hand-edited params, an older/newer params schema, or a typo when constructing the object in code.","commonSituations":"Editing chart params JSON directly and mistyping the type; forks that add a new spatial encoding without extending spatialUtils; version skew between saved params and the current plugin code.","solutions":["Correct spatial.type to one of the supported values: 'latlong', 'delimited', 'geohash' (exact case).","Re-select the encoding in the Explore spatial control so the canonical value is written.","In forks, extend the switch in spatialUtils.ts to cover the custom type instead of letting it fall through."],"exampleFix":"// before\ngetSpatialColumns({ type: 'latLong', lonCol: 'lon', latCol: 'lat' }); // throws\n\n// after\ngetSpatialColumns({ type: 'latlong', lonCol: 'lon', latCol: 'lat' });","handlingStrategy":"type-guard","validationCode":"const KNOWN = ['latlong', 'delimited', 'geohash'] as const;\nif (!KNOWN.includes(spatial.type)) {\n  throw new Error(`Unsupported spatial type: ${spatial.type}`);\n}\ngetSpatialColumns(spatial);","typeGuard":"const isKnownSpatialType = (s: SpatialConfiguration): boolean =>\n  ['latlong', 'delimited', 'geohash'].includes(s.type);","tryCatchPattern":"try { getSpatialColumns(spatial); } catch (e) { if (e.message.startsWith('Unknown spatial type')) resetSpatialControl(); else throw e; }","preventionTips":["Use exact lowercase type strings; centralize them in one constant","Extend the switch when adding encodings in forks"],"tags":["deckgl","spatial","discriminator","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}