Bug report #18619

Python rotate feature geometry

Added by Josef Fällman over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Geometry
Affected QGIS version:3.0.0 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:26507

Description

In qgis 3 nothing happens when im trying to rotate a geometry with python.

This row returns 0
feature.geometry().rotate(45, rotate_point)

It works in qgis 2.18

History

#1 Updated by Alessandro Pasotti over 6 years ago

  • Resolution set to worksforme
  • Assignee set to Alessandro Pasotti
  • Status changed from Open to Closed

works for me:


g = QgsGeometry.fromWkt('LINESTRING(1 1, 2 2)')
g.isGeosValid()
g.asWkt()
g.rotate(45, QgsPointXY(1, 1))
g.asWkt()

'LineString (1 1, 2.41421356237309492 1)'

The function return OperationResult 0, that means

enum OperationResult {
Success = 0,

Also available in: Atom PDF