open_vector

Luo_Suppe2026-08-15

gma.gio.open_vector

[function] open_vector(in_src, name_or_id = 0, allowed_drivers = [], open_options = [], sibling_files = []):

Open a raster or vector file as a Dataset.

Parameters:

in_src: str.

Name of the file to open.

Optional:

name_or_id = int||str. Default 0.

Layer id or name in the GeoDatabase to get.

allowed_drivers = list. Default [].

A list of the names of drivers that may attempt to open.

open_options = dict/list. Default [].

A dict or list of name=value driver-specific opening options.

sibling_files = list. Default [].

A list of filenames that are auxiliary to the main filename.

Returns:

Type: Layer.

Example

from gma import gio

ly = gio.open_vector('Australia.shp')

print(type(ly).__name__, ly.gtype, len(ly))
print('bounds:', tuple(round(v, 2) for v in ly.bounds))
print('name  :', ly.get_feature(0).fields['name'])
Layer Polygon 11
bounds: (112.91, -43.62, 153.62, -10.05)
name  : Western Australia
Last Updated 11/21/2026, 2:33:17 AM
ON THIS PAGE