Skip to content

Commit

Permalink
fix: backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
habibutsu committed Jun 7, 2024
1 parent 2de25d7 commit 20590f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gdal_boots/gdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 20590f6

Please sign in to comment.