1

Context

I have some GeoTIFF files that are loaded directly into OpenLayers via a WebGLTile Layer with a GeoTIFF source. My code is similar to the example in this workshop. I am also registering a non-default projection, EPSG 6931, and applying it to my map on initialization--this is the same CRS defined in my GeoTIFF raster data. So far, the GeoTIFF renders as expected and aligns with my base map and vector tile layers.

The issue

When adding a DragRotate feature, however, I came across some unexpected behavior. My raster layer distorts/stretches, forming a horizontal line of pixels across the map and then disappearing. My base map and Mapbox Vector Tile Layers rotate as expected. I am using a custom TileGrid that's applied to all of my layers. The GeoTIFF initially renders correctly, but distorts as I use DragRotate.

distorted GeoTIFF when using DragRotate

What I've tried so far

I have looked into georeferencing as a possible solution to my problem, but I'm not sure if I understand it correctly. My GeoTIFF data already has the CRS I want defined. I also looked at the getRotation and setRotation properties of View, but that doesn't seem like it would solve my distorted image from what I've gathered in the documentation.

Questions

How can I get my raster data to rotate like the base map and vector tile layers without distorting? Would serving my GeoTIFF from a proper tile server fix this (like shown in this example)? If so, is this possibly a bug in OpenLayers ol/source/GeoTIFF or ol/layer/WebGLTile?

UPDATE

Set up a WMS service in GeoServer and I'm able to use DragRotate without this issue. I'm still not sure what's causing the behavior when I use ol/layer/WebGLTile.

4
  • I don't see any problems with the OpenLayers examples, both background and geotiff rotate in a custom projection - although GeoTIFF does not work in codesandbox so I have to resort to the full built to demonstrate it here jsbin.com/waloyet/edit?html,js,output
    – Mike
    Commented Dec 9, 2021 at 9:38
  • Coding question on GIS SE site should include relevant existing code, otherwise it's most likely to be closed as not compliant with the site policy. Please edit your question and add relevant existing code.
    – TomazicM
    Commented Dec 9, 2021 at 10:51
  • I also tried GeoTIIF layer drag rotation and had no problems. Could you share offending GeoTIFF?
    – TomazicM
    Commented Dec 9, 2021 at 18:04
  • I'm unable to share my code or data, but I'm able to confirm the issue is related to my GeoTIFF file.
    – 0x00
    Commented Dec 9, 2021 at 22:07

1 Answer 1

0

I copied the example from @Mike's comment and swapped out the source url for my locally hosted GeoTIFF url. I got the same distorting behavior as before, which confirms the problem is within my GeoTIFF file. Uploading my GeoTIFF to GeoServer and using a WMS service solved my issue.

Not the answer you're looking for? Browse other questions tagged or ask your own question.