X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8c14df55a61d71f2476c8a17287e1bd162a5c6a6..1f0796778754d8df0dfab9dd01302e26a397f064:/src/nominatim_db/utils/centroid.py?ds=inline diff --git a/src/nominatim_db/utils/centroid.py b/src/nominatim_db/utils/centroid.py index 21a7c779..a45d958b 100644 --- a/src/nominatim_db/utils/centroid.py +++ b/src/nominatim_db/utils/centroid.py @@ -10,6 +10,7 @@ Functions for computation of centroids. from typing import Tuple, Any from collections.abc import Collection + class PointsCentroid: """ Centroid computation from single points using an online algorithm. More points may be added at any time. @@ -32,11 +33,9 @@ class PointsCentroid: return (float(self.sum_x/self.count)/10000000, float(self.sum_y/self.count)/10000000) - def __len__(self) -> int: return self.count - def __iadd__(self, other: Any) -> 'PointsCentroid': if isinstance(other, Collection) and len(other) == 2: if all(isinstance(p, (float, int)) for p in other):