GeoDatabase

Luo_Suppe2026-08-15

gma.gio.GeoDatabase

class GeoDatabase(data = None, driver = None, out_dst = None):

A GeoDatabase wraps a GDAL Dataset object, and provides functions to access its layers and datasets. Initialize a GeoDatabase object.

Optional:

data = None||str. Default None.

If None, create a new empty GeoDatabase. If str, open the file path as GeoDatabase.

driver = str||None. Default None.

If data is None, the driver name to create the GeoDatabase.

out_dst: str||None. Default None.

If data is None, the output file path to create the GeoDatabase.


Methods

add_layer

[method] .add_layer(layer, new_name = None, over_write = False, **kwargs):

Add Layer to GeoDataBase.

Parameters:

GMALayer: Layer.

Another GMA Layer!

Optional:

new_name = str||None. Default None.

The new name of the added Layer. Default is the added Layer's name.

OverWrite = bool. Default False.

Whether to force overwrite the layer with the same name.


create_layer

[method] .create_layer(name = None, crs = None, gtype = "Polygon", options = {}):

Create a new layer in GeoDatabase.

Optional:

name = str||None. Default None.

the name for the new layer. This should ideally not match any existing layer on the datasource. None for randint.

crs = int||str||CoordinateReferenceSystem. Default None

the coordinate system to use for the new layer, or None if no coordinate system is available.

gtype = int. Default 'Polygon'.

geometry type for the layer. Use 'Polygon' if there are no constraints on the types geometry to be written.

options = dict/list. Default [].

Driver-specific dict or list of `name=value` options

Returns:

Type: Layer.


delete_layer

[method] .delete_layer(name_or_id):

Delete a Layer in GeoDataBase.

Parameters:

name_or_id: int||str.

Layer name or ID in GeoDataBase!


get_dataset

[method] .get_dataset(name_or_id = 0):

Get a Dataset in GeoDataBase.

Optional:

name_or_id = int. Default 0.

Dataset ID or name in the GeoDataBase to get.

Returns:

Type: Dataset.


get_layer

[method] .get_layer(name_or_id = 0):

Get a Layer in GeoDatabase.

Optional:

name_or_id = int||str. Default 0.

Layer id or name in the GeoDatabase to get.

Returns:

Type: Layer.


iteritems

[method] .iteritems(category = None, **kwargs):

Iterate vector layers and raster datasets. --> iter


query

[method] .query(expr, tran_opts = {}, **kwargs):

Query the vector Layer with a SpatiaLite SQL expression.

Parameters:

expr: str.

The sql(ite) query string to evaluate.

Optional:

tran_opts = dict. Default {}.

Other parameters passed to ._aio.layer.vector_translate.

**kwargs:

Other parameters passed to ._aio.vrt.VRTGeoDatabase.add_file.

Returns:

Type: Layer.


Property

dataset_count

Number of datasets. --> int


dataset_names

Names of datasets. --> list[str]


driver

Database driver. --> VectorDriver/RasterDriver


files

GeoDatabase associated files. --> list[str]


info

Source metadata. --> dict


layer_count

Number of layers. --> int


layer_names

Name of Layers. --> list[str]


GeoDatabase path link. --> str


name

GeoDatabase Name. --> str


Last Updated 8/15/2026, 8:42:21 AM