General Function Reference
Functions that belong to no one package. They describe the runtime, not a raster, a grid or a geometry.
databricks.labs.gbx.drivers.functions (Python). In SQL the name is gbx_drivers. See Surfaces & Levels for how GeoBrix picks the implementation.
Listing GDAL drivers
gbx_drivers lists the GDAL drivers that the current environment can run, one row per driver.
It answers which formats this runtime reads and writes, which are raster or vector, and whether GeoBrix allows them.
The rows come from GDAL as it runs now, so they change if you add or remove packages.
The as-provided list shows the drivers that the env wheel ships.
drivers
SQLPython| Surface | Call | Returns |
|---|---|---|
| SQL (session) | gbx_drivers([kind]) | rows |
| Python | drivers.functions.drivers(kind=None) | DataFrame |
Rows: driver STRING, description STRING, raster BOOLEAN, vector BOOLEAN, read BOOLEAN, write BOOLEAN, extensions ARRAY<STRING>, allowed BOOLEAN, tile_bytes BOOLEAN, available BOOLEAN, requires STRING, shipped BOOLEAN, tested BOOLEAN, tested_with STRING, guidance STRING, docs ARRAY<STRING>, help_url STRING.
| Parameter | SQL type | Default | Description |
|---|---|---|---|
kind | STRING | NULL | 'raster' or 'vector' keeps only those drivers; NULL lists every driver. |
Powered by GDAL's driver registry, through the env wheel's Python bindings. Without them, the function raises an error that names the env wheel to install.
Call it as a table function. Pass 'raster' or 'vector' to keep one kind, or leave the argument out for every driver.
| Column | Meaning |
|---|---|
driver | GDAL's short name for the driver, such as GTiff or ESRI Shapefile. |
description | GDAL's long name for the driver. |
raster, vector | Whether the driver handles rasters, vectors, or both (GeoPackage). |
read, write | Whether the driver can open a dataset, and whether it can create or copy one. |
extensions | The file extensions GDAL associates with the driver. |
allowed | Whether GeoBrix lets the driver open data. GeoBrix turns off some drivers by default, so they do not appear. See the opt-in drivers. |
tile_bytes | Whether a raster of this driver can be held as the bytes of a tile. |
available | Whether the driver works as shipped. It is false for a driver that needs a service, a program or a plugin this runtime lacks. |
requires | What the driver needs that the runtime does not supply, or NULL. A format that reads sidecar files names them here. |
shipped | Whether the driver is in the env wheel's own build. A false value means a package in this environment added it. |
tested | Whether GeoBrix's extended driver tests cover the driver in this release. It describes the release, not the environment. |
tested_with | The GeoBrix readers, writers and functions the tests used, or NULL for a driver that is not tested. |
guidance | A short note on what GeoBrix offers for the format: the built-in reader or writer to use, and what it covers. Every driver has one. |
docs | The absolute URLs of the docs pages that explain the guidance. The array is empty when the note has no page. |
help_url | The driver's page on gdal.org, or NULL. |
A driver can be available and still list requires.
A shapefile works as shipped, but its .shx and .dbf files must sit beside the .shp file.
- SQL
- Python
-- One row per vector driver of this runtime, filtered to the ones that can write.
SELECT driver, description, extensions
FROM gbx_drivers('vector')
WHERE write AND allowed AND available
ORDER BY driver;
+--------------+----------------------------+------------------------+
|driver |description |extensions |
+--------------+----------------------------+------------------------+
|BAG |Bathymetry Attributed Grid |[bag] |
|CSV |Comma Separated Value (.csv)|[csv, tsv, psv] |
|DGN |Microstation DGN |[dgn] |
|DXF |AutoCAD DXF |[dxf] |
|ESRI Shapefile|ESRI Shapefile |[shp, dbf, shz, shp.zip]|
+--------------+----------------------------+------------------------+
only showing top 5 rows of 38
vector_writers = (
dx.drivers("vector")
.where("write AND allowed AND available")
.select("driver", "description", "extensions")
.orderBy("driver")
)
names = [r["driver"] for r in vector_writers.collect()]
assert "ESRI Shapefile" in names, names
aaigrid = dx.drivers("raster").where("driver = 'AAIGrid'").first()
assert aaigrid["read"] and aaigrid["write"] and aaigrid["allowed"], aaigrid
+--------------+----------------------------+------------------------+
|driver |description |extensions |
+--------------+----------------------------+------------------------+
|BAG |Bathymetry Attributed Grid |[bag] |
|CSV |Comma Separated Value (.csv)|[csv, tsv, psv] |
|DGN |Microstation DGN |[dgn] |
|DXF |AutoCAD DXF |[dxf] |
|ESRI Shapefile|ESRI Shapefile |[shp, dbf, shz, shp.zip]|
+--------------+----------------------------+------------------------+
only showing top 5 rows of 38