1

This question already has an answer here:

How do you calculate centroids in QGIS 3.0? In previous versions, there was an easily accessible tool in the vector geometry toolbar, but it is gone. I've seen ways to do it with Python on Stack Exchange but I am not that good with Python.

I've tried a few Python plugins to no avail. I've repeatedly got the response "Couldn't load plugin 'realcentroid' due to an error when calling its classFactory() method", which I do not understand.

marked as duplicate by underdark qgis Apr 2 '18 at 20:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

It is available in the "Vector -> Geometry tools -> Centroids" menu. You can also access it from the processing toolbox, just open it (menu "processing -> toolbox") and search for centroid.

  • Wow I realized that after posting this. Stupidly obvious! Is it good form to delete a question like on SE this now that I have answered it? – StupidQuestionGuy Apr 2 '18 at 21:03
  • No, it does no harm and it could be useful to someone one day. – Leyan Apr 3 '18 at 18:52
0

If you open your attribute table you can always open the field calculator, add a virtual field and use an expression such as : x(centroid($geometry)) and y(centroid($geometry)) ...

That's a way to do what you're looking for.

Not the answer you're looking for? Browse other questions tagged or ask your own question.