Skip to main content
Computes the approximate geometric median of a MultiPoint geometry using the Weiszfeld algorithm. The geometric median provides a centrality measure that is less sensitive to outlier points than the centroid. The algorithm will iterate until the distance change between successive iterations is less than the supplied tolerance parameter. If this condition has not been met after maxIter iterations, the function will produce an error and exit, unless failIfNotConverged is set to false. If a tolerance value is not provided, a default tolerance value is 1e-6. SQL reference: ST_GeometricMedian

Signature

Parameters

ColumnOrName
required
MultiPoint or Point geometry.
Optional[Union[ColumnOrName, float]]
default:"1e-06"
Distance limit change between successive iterations, defaults to 1e-6.
Optional[Union[ColumnOrName, int]]
default:"1000"
Max number of iterations, defaults to 1000.
Optional[Union[ColumnOrName, bool]]
default:"False"
Generate error if not converged within given tolerance and number of iterations, defaults to False

Returns

Column
Point geometry column.