geoblaze icon indicating copy to clipboard operation
geoblaze copied to clipboard

Issue parsing geotiffs with deflate compression

Open miccoh1994 opened this issue 5 years ago • 6 comments

The Bug I am accessing data from an API that returns a deflated tiff which I save to a file ('image.tiff').

However, when I try and load this tiff with geoblaze in a nodejs application:

    let imgUrl = 'http://localhost:3000/1.tiff';
    inputImage = await geoblaze.load(imgUrl).catch(e => console.log(e));

I get the following:

Error: Geoblaze had a problem parsing this file. Please make sure that you are sending a proper GeoTIFF file and try again.

However if I take that same geotiff and load it into a GIS (QGIS or Global Mapper) and export it with no compression or with compression such as 'packbits' the data loads correctly.

Typically we expect that since geoblaze is based on geotiff.js (which apparently supports deflate compression) geoblaze should be able to load deflataed geotiffs. Am I missing something here?

miccoh1994 avatar Mar 27 '20 12:03 miccoh1994

Hi, @miccoh1994 . I'll update GeoBlaze dependencies and let's see if that helps.

DanielJDufour avatar Mar 27 '20 12:03 DanielJDufour

If it is helpful, when I try load the same geotiff at app.geotiff.io. The console logs:

Error: Unknown compression method identifier: 32946

miccoh1994 avatar Mar 27 '20 13:03 miccoh1994

Hi, @miccoh1994 . I believe I fixed this by upgrading the geotiff dependency and publishing a new version (https://www.npmjs.com/package/geoblaze). Could you reinstall and see if it works?

DanielJDufour avatar Mar 28 '20 03:03 DanielJDufour

Hi Daniel, thanks a lot for the publishing the new version. unfortunatley it didn't help.

I figured out the issue is actually a bad build of the georaster dependecy. Had to rebuild georaster then update the node modules in geoblaze then rebuild geoblaze. That fixed the issue! Should I got file an issue at the georaster repo??

miccoh1994 avatar Mar 29 '20 10:03 miccoh1994

The issue only occured with minified georaster and geoblaze

miccoh1994 avatar Mar 29 '20 10:03 miccoh1994

Yes, please file an issue with GeoRaster! Thank you!!

DanielJDufour avatar Mar 29 '20 13:03 DanielJDufour