Commit 546d5650 authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Added from_polygons method to MultiPolygonData.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@6627 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 977bb7a9
......@@ -404,6 +404,19 @@ class MultiPolygonData(MultiData):
return cls.from_wkt(geom.ExportToWkt(), values=values, labels=labels,
style_params=style_params)
@classmethod
def from_polygons(cls, pg_list):
"""
Construct from list of polygons
:param pg_list:
list with instances of :class:`PolygonData`
"""
mpg = pg_list[0].to_multi_polygon()
for pg in pg_list[1:]:
mpg.append(pg)
return mpg
def clip_to_polygon(self, polygon):
# TODO: set style_params
shape = self.to_shapely()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment