Many geo libraries (for example, geoPHP) support finding the centroid of a geoJSON shapes:
$geom = geoPHP::load(file_get_contents('USA.json'), 'json');
$centroid = $geom->centroid();
The code will find the centerpoint of that shape, but does not handle crossing the 180th meridian in a manner that works well for centering on that shape on a continuous map. For a country shape like Russia, the bounding box and the centerpoint are based on a non-continuous shape:
The centerpoint is calculated for the shape based on this coordinate system, rather than if the shape would "wrap" around the meridian. Is the a library or tool which can calculate the centerpoint of these shapes while accounting for wrapping?
(This is tangential to my question here: Display GeoJSON with leaflet that spans the 180th meridian)