-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoTIFF layers do not support TIFFs with GeoTransform/rotation #15294
Comments
After looking into this some more, I think it might be a bug or unsupported feature in geotiff.js. Any insights appreciated. |
Also the image is rotated 90 degrees compared with the correctly placed one. |
Possibly related to this issue from over a year ago: geotiffjs/geotiff.js#313 |
I don't think that's the problem. If the GeoTIFF image in question uses a projection with an axis order different than |
@ahocevar The GeoTIFF is misplaced in the reported UTM projection but reasonably close to the expected position, rotated and slightly smaller than expected. Swapping axes would make it much more displaced. |
After checking the two outputs more thoroughly the top left corner as seen in OpenLayers is in the correct position - the image is rotated slightly less then 90 degrees around that point (which should be at top right when corrected) and is also downscaled. It does seem related to geotiffjs/geotiff.js#313 |
Fixing the calculation of the resolution in Geotiff.js (I'll file a PR for Geotiff.js soon) corrected the error in size, but it is still rendered in an incorrect position and rotation. I think that this problem is on the OpenLayers side, which would need to make use of the transformation properties of the TIFF in the rendering of the image. |
The changes to geotiff.js are in this PR: geotiffjs/geotiff.js#403 |
Your example link is no longer working. Are you are to recreate it? To support rotation I think the tilegrid would need to be considered to be in a custom rotated or skewed projection derived from the reported projection similar to the images in #12601. If the reported projection needs a proj4 lookup as in https://openlayers.org/en/latest/examples/cog-projection.html some changes to proj4 registration process would be needed as transforms between the rotated projection and any other possible view projections could not be defined until then. |
It happens the same to me #15370 |
A fix is definitely possible, there is some discussion about and links to Umbra COGs in stac-utils/stac-layer#61. While geotiffjs/geotiff.js#403 will fix the scale issue, it is necessary to consider the tile grid to be in a rotated projection for it to be positioned correctly. A recent change to geotiff.js geotiffjs/geotiff.js#361 does the opposite of that, and it now returning the larger bounding box which encloses the rotated tile grid in an unrotated projection, which is of no use to OpenLayers (and probably of limited use to Leaflet) so OpenLayers will need to apply the old method directly. |
Describe the bug
When trying to add a certain GeoTIFF to an OpenLayers map, it renders in an incorrect location. The GeoTIFF in question is https://unnerving-monsoon.ams3.cdn.digitaloceanspaces.com/Georgia/2023-10-30-06-47-55_UMBRA-04.tif. This is not reproduced in QGIS or other COG tools.
To Reproduce
Steps to reproduce the behavior:
It can also be reproduced by adding the following source to an OpenLayers map:
Expected behavior
The projection and extent is read and interpreted correctly.
The text was updated successfully, but these errors were encountered: