The Python documentation for OGR lists a Polygonize() method belonging to the Geometry class, as does the C documentation. The docstring suggests it can be called on a geometry object of type "MultiLinestring", however doing so results in an AttributeError. Other methods such as Buffer() work fine.
Did they move or remove this in GDAL 2.x? Lib/site-packages/osgeo/ogr.py
does not contain a Polygonize() function. It does say "OGR 1.9.0" in the documentation, but I would assume this normally means OGR >= 1.9.0.
Currently running gdal version 2.2.4.
Code sample:
multiline = ogr.Geometry(ogr.wkbMultiLineString)
multiline.AddGeometry(line)
polygon = multiline.Polygonize()
Results in:
AttributeError: type object 'object' has no attribute '__getattr__'