0
votes
1answer
470 views

How to calculate centroid of a polygon defined by a list of longitude/latitude points? [duplicate]

I've imported some polygons (ways) from OpenStreetMap and now want to calculate the centroids of them. For this purpose I wrote following code: final List<Point2D.Double> points = ...
2
votes
2answers
1k views

Formula to get polygon centroid

I need to compute the centroid position of an irregular polygon with lat and lon coordinates in Java. Which formula should I use to correctly compute a centroid?