I have a table that contains only closed lines (lines where endpoint is the same as startpoint).

I would need to find a centroid for those lines.

How would I be able to achieve it?

It does not need, to be inner centroid, it can also be just an average of all the line nodes.


If you're certain the lines are closed, then you should be able to create polygons out of them, thus easily generating centroids.

I'm not a MySQL user, but these docs seem to have examples that will help: http://dev.mysql.com/doc/refman/5.7/en/populating-spatial-columns.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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