:tocdepth: 3 :py:mod:`gws.gis.gdalx` ======================= .. py:module:: gws.gis.gdalx .. autoapi-nested-parse:: GDAL/OGR wrapper. **Source code:** :source:`gws.gis.gdalx` Package Contents ---------------- .. py:class:: DriverInfo(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: index :type: int .. py:attribute:: longName :type: str .. py:attribute:: metaData :type: dict .. py:attribute:: name :type: str .. py:function:: drivers() -> list[DriverInfo] Enumerate GDAL drivers. .. py:exception:: Error Bases: :py:obj:`gws.Error` GWS error. .. py:function:: is_attribute_supported(typ) .. py:function:: open_from_image(image: gws.Image, bounds: gws.Bounds) -> RasterDataSet Create an in-memory Dataset from an Image. :param image: Image object :param bounds: geographic bounds .. py:function:: open_raster(path: str, mode: str = 'r', driver: str = '', default_crs: Optional[gws.Crs] = None, **opts) -> RasterDataSet Create a raster DataSet from a path. :param path: File path. :param mode: 'r' (=read), 'a' (=update), 'w' (=create/write) :param driver: Driver name, if omitted, will be suggested from the path extension. :param default_crs: Default CRS for geometries (fallback to Webmercator). :param opts: Options for gdal.OpenEx/CreateDataSource. .. py:function:: open_vector(path: str, mode: str = 'r', driver: str = '', encoding: str = 'utf8', default_crs: Optional[gws.Crs] = None, **opts) -> VectorDataSet Create a vector DataSet from a path. :param path: File path. :param mode: 'r' (=read), 'a' (=update), 'w' (=create/write) :param driver: Driver name, if omitted, will be suggested from the path extension. :param encoding: If not None, strings will be automatically decoded. :param default_crs: Default CRS for geometries (fallback to Webmercator). :param opts: Options for gdal.OpenEx/CreateDataSource. :returns: DataSet object. .. py:class:: RasterDataSet(path, gd_dataset, encoding='utf8', default_crs: Optional[gws.Crs] = None) Bases: :py:obj:`_DataSet` .. py:method:: create_copy(path: str, driver: str = '', strict=False, **opts) Create a copy of a DataSet. .. py:class:: VectorDataSet(path, gd_dataset, encoding='utf8', default_crs: Optional[gws.Crs] = None) Bases: :py:obj:`_DataSet` .. py:method:: create_layer(name: str, columns: dict[str, gws.AttributeType], geometry_type: gws.GeometryType = None, crs: gws.Crs = None, overwrite=False, *options) -> VectorLayer .. py:method:: layer(name_or_index: str | int) -> Optional[VectorLayer] .. py:method:: layers() -> list[VectorLayer] .. py:method:: transaction() .. py:class:: VectorLayer(ds: VectorDataSet, gd_layer: osgeo.ogr.Layer) .. py:attribute:: defaultCrs :type: gws.Crs .. py:attribute:: encoding :type: str .. py:attribute:: gdDefn :type: osgeo.ogr.FeatureDefn .. py:attribute:: gdLayer :type: osgeo.ogr.Layer .. py:attribute:: name :type: str .. py:method:: count(force=False) .. py:method:: describe() -> gws.DataSetDescription .. py:method:: get(fid: int) -> Optional[gws.FeatureRecord] .. py:method:: get_all() -> list[gws.FeatureRecord] .. py:method:: insert(records: list[gws.FeatureRecord]) -> list[int]