mjaschen / phpgeo

Simple Yet Powerful Geo Library for PHP
https://phpgeo.marcusjaschen.de
MIT License
1.55k stars 195 forks source link

[FEATURE] Compute center of a polygon #59

Open aarongerig opened 4 years ago

aarongerig commented 4 years ago

It would be nice to have a method in the Polygon class, which computes and returns the center of all coordinates.

Is this something you would be interested in? See http://tutorialspots.com/php-how-to-determine-the-center-of-a-polygon-637.html

aarongerig commented 4 years ago

ping @mjaschen :)

mjaschen commented 4 years ago

Hi,

that'd be a nice addition. The referenced algorithms are for planar polygons only. We have to find something that works on the surface of an ellipsoid. Lets see if we find the time for research and implementation :-)

aarongerig commented 4 years ago

WDYT about this one, @mjaschen? https://bell0bytes.eu/centroid-convex/