I have already discovered this class, but I am confused. If I am doing a analysis on the current layer, I don't know why it is not displaying on the map.
lyr =iface.mapCanvas()
layer = lyr.currentLayer()
QgsGeometryAnalyzer().centroids(layer,'new route\new shape.shp',False)
I haven't got any errors, it just does nothing. When I execute the code in the QGIS Text Editor, I click on "Run" and executes the file. Nothing appears on the map and I don't see any new shapefile in the folder written.