Closed dura0ok closed 11 months ago
I'd like to see additional tests added: a test with only one spoint in the passed ARRAY and a test with zero spoints in the passed ARRAY.
I would propose to name it as 'centroid'. It is more laconic name. Boost geometry names such function as centroid.
Furthermore, we may overload such function for other geometry types to make it complete.
I would also propose to put test SQL for this functionality into a new file like centroid.sql, for example. Such a file separation is reasonable, because all the stuff related to this function will be placed in the single file. If we add some other overloaded functions like centroid(spoly) we will still have the single test file. The test code will not be placed into multiple files.
I also would consider the case when two points are located in the same big circle in opposite directions. The 3D center mass in this case reside in the center of the sphere. There are two points may be returned. Which point to choose?
Closed until it will be polished in the author's original branch.
This constitutes an API change, so the version number will need to be incremented in some fashion. I'm not sure if that's been decided in issue #9 yet. An upgrade script will also be needed.
make test
failed. You'll need to updateexpected/init_test.out.in
at least.make installcheck
also failed with most of the tested PostgreSQL versions but not version 10. That's weird. Not sure why that is.