Il 18/07/2021 11:46, Raymond Nijssen ha scritto:
How can I run ths isValid() function on a geometry. I would think my Polygon Geometry would inherit all functions from the QgsAbstractGeometry base class, but it seems it doesn't.

I get:
AttributeError: 'QgsGeometry' object has no attribute 'isValid'

Hi Raymond,
the QGIS Python API documentation clarify that: "The actual geometry representation is stored as a QgsAbstractGeometry within the container, and can be accessed via the get() method"[1].

So, I think

geom.get().isValid()

will work without errors.

Best regards.

Andrea

[1] https://qgis.org/pyqgis/3.16/core/QgsGeometry.html#module-QgsGeometry
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to