openlayers / openlayers

OpenLayers
https://openlayers.org
BSD 2-Clause "Simplified" License
11.12k stars 3.01k forks source link

GeoTIFF rotation #15370

Open carmenmarquez opened 7 months ago

carmenmarquez commented 7 months ago

Hello, I'm trying to load a TIF into OpenLayers but it doesn't seem to be rotating the image. In QGIS it is displayed correctly. The URL is: http://ftpcdd.cnig.es/Vuelos_2015_2016/Vuelos_2015/Baleares/1.VF/1.08_PNOA_L6_2015_BAL_25cm_VF_img8c_rgb_hu31/h50_0697_fot_002-0015.tif The projection is EPSG:25831.

Example: const sources = [new GeoTIFF({ convertToRGB: 'auto', sources: [{ url: 'https://ftpcdd.cnig.es/Vuelos_2022/Vuelos_2022/extremadura_2022/Sur/01.VF/01.08_PNOA_2022_EXT_S_22cm_VF_img8c_rgb_hu29/h50_0752_fot_02-3221_cog.tif', }, ], })];

const layer = new TileLayer({ sources: sources, });

I attach a screenshot of how it is displayed in QGIS and OpenLayers.

all the best QGIS Ol

mike-000 commented 7 months ago

Duplicate of #15294

mike-000 commented 7 months ago

It would work with #15402 https://jsfiddle.net/c9mejsLa/

carmenmarquez commented 7 months ago

Hi Mike, thank you very much for your response. I wanted to ask:

mike-000 commented 7 months ago

You can view it in any projection you want, but you must ensure the COG projection is registered with proj4 https://jsfiddle.net/1xpc7t4r/