diff --git a/AUTHORS.rst b/AUTHORS.rst index 1e160cd39b33e882587301186ce7567f647217f8..e6a25535204e5d1d45a3f5bc28a454a61f0755b4 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -6,7 +6,7 @@ Development Lead ---------------- * Daniel Scheffler -** +** Contributors diff --git a/HISTORY.rst b/HISTORY.rst index 6235005a335ddb1e65c478bff04ab6007671db7d..594bef81f6c216e23373ea07b6b97701c441ee67 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,12 @@ History ======= +0.15.8 (16.03.2022) +------------------- + +* Added GeoArray.is_rotated attribute to detect pseudo-projections. + + 0.15.7 (13.01.2022) ------------------- diff --git a/geoarray/baseclasses.py b/geoarray/baseclasses.py index 59f2709442a4977e99d5c287389be596246c0bdc..5b36be167ab2b534a41cc030d7bd82499095f030 100644 --- a/geoarray/baseclasses.py +++ b/geoarray/baseclasses.py @@ -365,12 +365,18 @@ class GeoArray(object): """Return 'True' if the image has a valid geoinformation with map instead of image coordinates.""" return all([self.gt, list(self.gt) != [0, 1, 0, 0, 0, -1], self.prj]) + @property + def is_rotated(self): + # type: () -> bool + """Return 'True' if the image has a rotation in the map info (i.e., is pseudo-projected).""" + return self.gt[2] or self.gt[4] + @property def nodata(self): """Get the nodata value of the GeoArray instance. If GeoArray has been instanced with a file path the metadata of the file on disk is checked for an existing - nodata value. Otherwise (if no value is exlicitly given during object instanciation) an automatic detection + nodata value. Otherwise, (if no value is exlicitly given during object instanciation) an automatic detection based on 3x3 windows at each image corner is run that analyzes the mean and standard deviation of these windows. """ if self._nodata is not None: @@ -1177,7 +1183,7 @@ class GeoArray(object): image2plot = image2plot.astype(int) # rotated images always have to be resampled for plotting - if not ignore_rotation and (gt[2] or gt[4]): + if not ignore_rotation and self.is_rotated: out_prj = out_prj or self.projection if res_factor != 1. and image2plot.shape[0] * image2plot.shape[1] > 1e6: # shape > 1000*1000 diff --git a/geoarray/version.py b/geoarray/version.py index e21841ac88708cb602e9ac005700e9cba7a71c14..482ce67977b6b1f95ac3e6d800e5c6a2f815753b 100644 --- a/geoarray/version.py +++ b/geoarray/version.py @@ -22,5 +22,5 @@ # limitations under the License. -__version__ = '0.15.7' -__versionalias__ = '20220113.01' +__version__ = '0.15.8' +__versionalias__ = '20220316.01'