diff --git a/gdal_boots/gdal.py b/gdal_boots/gdal.py index c025f41..4ba2dac 100644 --- a/gdal_boots/gdal.py +++ b/gdal_boots/gdal.py @@ -616,7 +616,7 @@ def to_vector(self, field_id=-1, callback: Callable[[float, str, Any], None] = N """ vds = VectorDataset.create() - vds.add_layer("test", VectorDataset.GeometryType.Polygon, self.geoinfo.epsg) + vds.add_layer("test", GeometryType.Polygon, self.geoinfo.epsg) band = self.ds.GetRasterBand(1) gdal.Polygonize(band, band, vds.layers.first().ref_layer, field_id, [], callback=callback) vds.ds.FlushCache() @@ -1174,6 +1174,8 @@ def size(self): class VectorDataset: # https://livebook.manning.com/book/geoprocessing-with-python/chapter-3/1 + GeometryType = GeometryType + def __init__(self, ds): self.ds: ogr.DataSource | gdal.Dataset = ds # self.layers = None