def from_points ( cls , list_of_lists ) : result = [ ] for l in list_of_lists : curve = [ ] for point in l : curve . append ( ( point . lon , point . lat ) ) result . append ( curve ) return Polygon ( result )
create polygon from lists of points python
Creates a * Polygon * instance out of a list of lists each sublist being populated with pyowm . utils . geo . Point instances : param list_of_lists : list : type : list_of_lists : iterable_of_polygons : returns : a * Polygon * instance
def from_points(cls, list_of_lists):
        """
        Creates a *Polygon* instance out of a list of lists, each sublist being populated with
        `pyowm.utils.geo.Point` instances
        :param list_of_lists: list
        :type: list_of_lists: iterable_of_polygons
        :returns:  a *Polygon* instance

        """
        result = []
        for l in list_of_lists:
            curve = []
            for point in l:
                curve.append((point.lon, point.lat))
            result.append(curve)
        return Polygon(result)