def midpoint(self):
        """Calculate the midpoint between locations in segments.

        Returns:
            list of Point: Groups of midpoint between points in segments
        """
        midpoints = []
        for segment in self:
            if len(segment) < 2:
                midpoints.append([])
            else:
                midpoints.append(segment.midpoint())
        return midpoints
Calculate the midpoint between locations in segments.

        Returns:
            list of Point: Groups of midpoint between points in segments