diff --git a/geoarray/baseclasses.py b/geoarray/baseclasses.py index 1dce8c36921fcfdfdd63e288d92989089b680211..2d11c3bf4d0270efa32ab0f651c82ee3fb043417 100644 --- a/geoarray/baseclasses.py +++ b/geoarray/baseclasses.py @@ -1043,7 +1043,7 @@ class GeoArray(object): dill.dump(self, outF) def _get_plottable_image(self, xlim=None, ylim=None, band=None, boundsMap=None, boundsMapPrj=None, res_factor=None, - nodataVal=None, out_prj=None): + nodataVal=None, out_prj=None, ignore_rotation=False): # handle limits if boundsMap: boundsMapPrj = boundsMapPrj if boundsMapPrj else self.prj @@ -1064,7 +1064,7 @@ class GeoArray(object): image2plot = image2plot.astype(np.int32) # rotated images always have to be resampled for plotting - if gt[2] or gt[4]: + if not ignore_rotation and gt[2] or gt[4]: out_prj = out_prj or self.projection if res_factor != 1. and image2plot.shape[0] * image2plot.shape[1] > 1e6: # shape > 1000*1000 @@ -1095,7 +1095,7 @@ class GeoArray(object): def show(self, xlim=None, ylim=None, band=None, boundsMap=None, boundsMapPrj=None, figsize=None, interpolation='none', vmin=None, vmax=None, pmin=2, pmax=98, cmap=None, nodataVal=None, - res_factor=None, interactive=False, ax=None): + res_factor=None, interactive=False, ax=None, ignore_rotation=False): """Plots the desired array position into a figure. :param xlim: [start_column, end_column] @@ -1117,6 +1117,8 @@ class GeoArray(object): :param interactive: activates interactive plotting based on 'holoviews' library. NOTE: this deactivates the magic '% matplotlib inline' in Jupyter Notebook :param ax: only usable in non-interactive mode + :param ignore_rotation: whether to ignore an image rotation angle included in the GDAL GeoTransform tuple for + plotting (default: False) :return: """ @@ -1126,7 +1128,7 @@ class GeoArray(object): nodataVal = nodataVal if nodataVal is not None else self.nodata if self.nodata is not None else -9999 image2plot, gt, prj = \ self._get_plottable_image(xlim, ylim, band, boundsMap=boundsMap, boundsMapPrj=boundsMapPrj, - res_factor=res_factor, nodataVal=nodataVal) + res_factor=res_factor, nodataVal=nodataVal, ignore_rotation=ignore_rotation) # set color palette palette = plt.get_cmap(cmap) if cmap and isinstance(cmap, str) else cmap if cmap else plt.get_cmap('gray') diff --git a/geoarray/version.py b/geoarray/version.py index 40c0f8a0b59168e82c1c0694c5162c8d9d21948c..75faeb3e0840b1f3e90c9700d85b6ff98ec87289 100644 --- a/geoarray/version.py +++ b/geoarray/version.py @@ -1,2 +1,2 @@ -__version__ = '0.8.17' -__versionalias__ = '20190510.01' +__version__ = '0.8.18' +__versionalias__ = '20190514.01'