Commit d989962a authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added GeoArray.is_rotated attribute. Bumped version.

parent 24204881
Pipeline #40196 failed with stage
in 1 minute and 42 seconds
......@@ -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)
-------------------
......
......@@ -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
......
......@@ -22,5 +22,5 @@
# limitations under the License.
__version__ = '0.15.7'
__versionalias__ = '20220113.01'
__version__ = '0.15.8'
__versionalias__ = '20220316.01'
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