0

I am trying to add a COG GeoTiff Layer to an openlayers 7.4.0 Map (geotiff 2.0.7) and it seems to fail during rendering. The HTTP range requests seem to be successful and I also don't get any other errors related to loading this GeoTiff. It seems the Tile supplied to TileLayer is of type "DataTile" and not "ImageTile" and does therefore not provide the getImage() methode called.

The exception thrown is:

Uncaught TypeError: tile.getImage is not a function
    getTileImage TileLayer.js:637
    drawTileImage TileLayer.js:586
    renderFrame TileLayer.js:519
    render Layer.js:372
    renderFrame Composite.js:123
    renderFrame_ Map.js:1569
    animationDelay_ Map.js:1423
    render Map.js:1456
    handleTileChange_ Map.js:1346
    handleTileChange TileQueue.js:97
    dispatchEvent Target.js:114
    changed Tile.js:139
    load DataTile.js:182
    promise callback*load DataTile.js:179
    loadMoreTiles TileQueue.js:120
    ....

the COG has the following properties:

Origin = (1046736.131588369375095,6280465.460391016677022)
Pixel Size = (7.416885125316582,-7.416885125316582)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
  LAYOUT=COG
Corner Coordinates:
Upper Left  ( 1046736.132, 6280465.460) (  9d24'10.77"E, 49d 1'58.86"N)
Lower Left  ( 1046736.132, 5831239.562) (  9d24'10.77"E, 46d18'59.96"N)
Upper Right ( 1918494.559, 6280465.460) ( 17d14' 2.87"E, 49d 1'58.86"N)
Lower Right ( 1918494.559, 5831239.562) ( 17d14' 2.87"E, 46d18'59.96"N)
Center      ( 1482615.345, 6055852.511) ( 13d19' 6.82"E, 47d41'33.07"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Gray
  NoData Value=127
  Overviews: 58768x30284, 29384x15142, 14692x7571, 7346x3785, 3673x1892, 1836x946, 918x473, 459x236
  Metadata:
    RepresentationType=ATHEMATIC

Any ideas why the Tile is loaded as DataLayer?

  • looked into the tile variable and found it is of type DataTile, but I was expecting an ImageTile
  • verified the http range requests work
2
  • DataTile is correct. The error is probably due to using ol/layer/Tile instead of ol/layer/WebGLTile Commented Sep 11, 2023 at 13:54
  • Indeed, that was the problem - thanks a lot. Too bad the API allows for both, even when using TypeScript. Commented Sep 11, 2023 at 14:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.