I’ve created a virtual raster using gdalbuildvrt
, which covers a large extent (England) at a high resolution. The data is fairly sparse, focused around the coastlines with no files covering inland areas. I’m trying to read the data in Python using rasterio
.
When I try to invert the affine transformation (to get world coordinates converted to pixel coordinates) I getting the following error:
>>> layer.affine
Affine(0.0002777778000000001, 0.0, -5.5000000044,
0.0, -0.0002777778000000001, 55.0000000836)
>>> layer.affine.__invert__()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:Python27libsite-packagesaffine-1.0-py2.7.eggaffine__init__.py", line 407, in __invert__
"Cannot invert degenerate transform")
affine.TransformNotInvertibleError: Cannot invert degenerate transform
I don’t get this error accessing the individual raster files. I have some idea of what it means, but not how to work around it. Perhaps it needs approaching in a different way? How do I access this data without having to worry about which file it’s stored in?