Skip to content

@sqlrooms/duckdb / loadSpatial

Function: loadSpatial()

loadSpatial(tableName, fileName, options): string

Load geometry data within a spatial file format. This method requires that the DuckDB spatial extension is loaded. Supports GeoJSON, TopoJSON, and other common spatial formats. For TopoJSON, set the layer option to indicate the feature to extract.

Parameters

ParameterTypeDescription
tableNamestringName of the table to create
fileNamestringPath to the spatial data file
optionsobjectOutputTypeLoad options including spatial-specific options

Returns

string

SQL query string to create the table