Commit 016e38ae authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

GeoArray.clip_to_poly(): Fix for not updating self._footprint_poly.

parent 8b4847cb
Pipeline #1273 passed with stages
in 15 minutes
......@@ -1073,12 +1073,13 @@ class GeoArray(object):
'matplotlib.org/basemap) if you want to plot maps. It is not automatically installed.')
raise
try:
# noinspection PyUnresolvedReferences
import mpld3
if zoomable:
mpld3.enable_notebook()
else:
mpld3.disable_notebook()
except Exception:
except ImportError:
if zoomable:
zoomable = False
warnings.warn('mpld3 is not available. Zooming disabled.')
......@@ -1284,10 +1285,17 @@ class GeoArray(object):
self.arr, self.gt, self.projection = self.get_mapPos(mapBounds=poly.bounds, mapBounds_prj=self.prj)
self.mask_nodata.arr, self.mask_nodata.gt, self.mask_nodata.projection = \
self.mask_nodata.get_mapPos(mapBounds=poly.bounds, mapBounds_prj=self.prj)
assert self.shape == self.mask_nodata.shape
if self._mask_baddata is not None:
self.mask_baddata.arr, self.mask_baddata.gt, self.mask_baddata.projection = \
self.mask_baddata.get_mapPos(mapBounds=poly.bounds, mapBounds_prj=self.prj)
assert self.shape == self.mask_baddata.shape
# update footprint polygon
if self._footprint_poly:
if not (self.footprint_poly.within(self.box.mapPoly) or self.footprint_poly.equals(self.box.mapPoly)):
self.footprint_poly = self.footprint_poly.intersection(self.box.mapPoly)
def get_mapPos(self, mapBounds, mapBounds_prj, band2get=None, out_prj=None, arr_gt=None, arr_prj=None, fillVal=None,
rspAlg='near', progress=None, v=False): # TODO implement slice for indexing bands
......
Markdown is supported
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