[QGIS-Developer] use of clone

Andrea Giudiceandrea andreaerdna at libero.it
Tue Jul 8 17:05:20 PDT 2025


Il 09/07/2025 01:41, Antonio Locandro via QGIS-Developer ha scritto:
> Then I tried this and I get that clone() is not available
> 
> geom = QgsGeometry.fromWkt("POINT(0 0)")
> try:
> cloned = geom.clone()

Hi Antonio,
clone() is a method of QgsAbstractGeometry [1], not QgsGeometry [2].

Regards.

Andrea

[1]
https://qgis.org/pyqgis/master/core/QgsAbstractGeometry.html
https://api.qgis.org/api/classQgsAbstractGeometry.html

[2]
https://qgis.org/pyqgis/master/core/QgsGeometry.html
https://api.qgis.org/api/classQgsGeometry.html


More information about the QGIS-Developer mailing list