I want to calculate centroid coordinates X_center and Y_center for every polygon in layer so that in case polygon has not simple shape (e.g. with holes or like in the picture below) centroid will be in the polygon anyway:
I found 'point on surface' function in QGIS, that returns a point guaranteed to lie on the surface of a geometry. BUT When trying to calculate coordinates with the function, dump happens, although qgis shows output preview correctly -
I found similar question but the following answer implicates new point layer creation, that is useless for me - I want to get centroid coordinates in the same layer.
Interesting, when creating virtual field - it calculates, I can even pick the polygon and see coordinates, but when opening attribute table, qgis crushes.
What is wrong?
OK
in the Field Calculator?real
field)?