This repository serves only as an example methodology for calculating the weighted geometric median of 3D points.
For a recent project I was asked to write some software to calculate weighted median centers for sets of related 3D points. There are several definitions that can be used to define exactly what median center means, and here I am sharing a method known as the center of minimum aggregate travel.
The geometric median is the point to which the population has the smallest possible sum of distances (or equivalently, the smallest average distance). Because of this property, it is also known as the point of minimum aggregate travel. Unfortunately, there is no direct closed-form expression for the geometric median; it is typically computed using iterative methods.
Below is a table representing data borrowed from the Geospatial Analysis Online textbook that has been slightly modified for testing and verification purposes.
The textbook data is actually 2D and unweighted, but we can add a third dimension and set all weights to 1 to use the data for verification.
See the unit test for an example.