Commit 9edd7fdf authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

GeoArray.geotransform now always returns a list.

parent 8160ea9f
......@@ -684,11 +684,10 @@ class GeoArray(object):
# set private class variables (in order to avoid recursion error)
self._shape = tuple([ds.RasterYSize, ds.RasterXSize] + ([ds.RasterCount] if ds.RasterCount > 1 else []))
self._dtype = gdal_array.GDALTypeCodeToNumericTypeCode(ds.GetRasterBand(1).DataType)
self._geotransform = ds.GetGeoTransform()
self._geotransform = list(ds.GetGeoTransform())
# for some reason GDAL reads arbitrary geotransforms as (0, 1, 0, 0, 0, 1) instead of (0, 1, 0, 0, 0, -1)
# => force ygsd to be negative
self._geotransform = tuple(list(self._geotransform)[:5] + [-abs(self._geotransform[5])])
self._geotransform[5] = -abs(self._geotransform[5]) # => force ygsd to be negative
# temp conversion to EPSG needed because GDAL seems to modify WKT string when writing file to disk
# (e.g. using gdal_merge) -> conversion to EPSG and back undos that
......
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