Commit ffdc3a57 authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Added get_region method to SingleData and MultiData.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@6044 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 24a25f50
......@@ -262,6 +262,16 @@ class SingleData(BasemapData):
poly = geom.Buffer(distance)
return PolygonData.from_ogr(poly)
def get_region(self):
"""
Determine bounding region
:return:
(xmin, xmax, ymin, ymax) tuple of floats
"""
geom = self.to_ogr_geom()
return geom.GetEnvelope()
class MultiData(BasemapData):
def __len__(self):
......@@ -613,6 +623,16 @@ class MultiData(BasemapData):
return PolygonData.from_ogr(poly)
def get_region(self):
"""
Determine bounding region
:return:
(xmin, xmax, ymin, ymax) tuple of floats
"""
geom = self.to_ogr_geom()
return geom.GetEnvelope()
def export_ogr(lbm_data, layer_name):
"""
......
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