There is an option in the field calculator for centroids under geometry which when you double click gives you "centroid( ". What information is required here in order to use this function?
Answer
The centroid function returns an Point geometry object that represents the centroid of the input geometry.
You'd have to give the centroid function a geometry to chew on (most likely your feature's geometry, from $geometry), then parse that geometry out however you'd like.
One example would be getting the centroid as WKT:
geomToWKT( centroid( $geometry ) )
You could then stick that in a text field, or parse it further to get the X or Y.
No comments:
Post a Comment