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
Cannot display tiff #157
Comments
Compression is deflate for the not working. Instead for working tff is lzw |
Hi @rtrap-rsi Can you provide the raw image itself? Deflate compression is actually implemented and works for many other images, so it may not be the cause of the error. |
Hi @constantinius, thank you for taking the time for this. Raw you mean the tiff file? if so |
And you're right, if I save it with Gimp without compression, I can't still see it... I don't know if it is useful but if I upload on app.geotiff.io or geotiffjs.github.io/cog-explorer it throw an error: The image does not have an affine transformation. I hosted here a copy to solve cors problem: https://trap-rsi-test.herokuapp.com/images/RR_FC_202006091230.geo.tiff |
Here's the output from gdalinfo:
It seems that the issue is that there is no coordinate system set. |
You're right and the one who send me the tiff corrected this. The new version still doesn't work T-T Driver: GTiff/GeoTIFF |
Here's the output of require("geotiff").fromFile("./RR_FC_202006171100.geo.tiff").then(geotiff => geotiff.getImage()).then(image => image.getGeoKeys()).then(console.log) {
GTModelTypeGeoKey: 1,
GTRasterTypeGeoKey: 1,
GTCitationGeoKey: 'SWISS_GRID',
GeographicTypeGeoKey: 32767,
GeogCitationGeoKey: 'GCS Name = SWISS_GRID|Datum = CH-1903|Ellipsoid = BESSEL 1841|Primem = Greenwich|',
GeogGeodeticDatumGeoKey: 32767,
GeogAngularUnitsGeoKey: 9102,
GeogEllipsoidGeoKey: 32767,
GeogSemiMajorAxisGeoKey: 6377397.155,
GeogInvFlatteningGeoKey: 299.1528128,
GeogPrimeMeridianLongGeoKey: 0,
GeogTOWGS84GeoKey: Float64Array(3) [ 674.374, 15.056, 405.346 ],
ProjectedCSTypeGeoKey: 32767,
ProjectionGeoKey: 32767,
ProjCoordTransGeoKey: 3,
ProjLinearUnitsGeoKey: 9001,
ProjFalseEastingGeoKey: 600000,
ProjFalseNorthingGeoKey: 200000,
ProjCenterLongGeoKey: 7.43958333333333,
ProjCenterLatGeoKey: 46.9524055555556,
ProjScaleAtCenterGeoKey: 1,
ProjAzimuthAngleGeoKey: 90,
ProjRectifiedGridAngleGeoKey: 90
} |
Here's the tiffdump from the new file:
|
Thank you @DanielJDufour! I haven't a lot of knowledge in these field but it seems good, no? There is an oldest example of image https://trap-rsi-test.herokuapp.com/images/RR_FC_201907251240.geo.tiff and this one work without problem. |
It's interesting that GeographicTypeGeoKey, GeogGeodeticDatumGeoKey, GeogEllipsoidGeoKey, ProjectedCSTypeGeoKey, and ProjectionGeoKey have the value of 32767. 32767 is the maximum value for an int. With the Universal Transverse Mercator projection, 32767 standards for It's possible that this projection value is throwing off your visualization. I know that georaster-layer-for-leaflet thinks this file is in UTM because of the projection code (https://geotiff.github.io/georaster-layer-for-leaflet-example/examples/load-file.html) |
Do you know the projection of the map you are using to display this GeoTIFF? I would recommend just reprojecting the tiff into whatever projection that is (maybe http://epsg.io/3857) or http://epsg.io/4326 and see if that works. |
Tried this, because I'm using https://github.com/stuartmatthews/leaflet-geotiff but I can't see it: |
Can you give me a link to the new tiff? |
Here's the gdalinfo for the reprojected tiff:
|
The origin and pixel size seems to be incorrectly configured. The origin should be in latitude and longitude and the pixel size should be in degrees not pixels. |
There seems like there was an issue converting the file into 4326. Is it possible that the projection is being set, but the file isn't actually being reprojected? |
It's possible... I used gdalwarp. Could you try? There are other methods? |
Any news on this? I couldn't find a solution |
Hi @rtrap-rsi This is not a problem with geotiff.js, so I will close this issue now. Regarding the input TIFF: warping it will most likely only work if the original image was already correctly georeferenced. When I try to warp myself (
Which is an indication that GDAL is not able to create a warping algorithm with that geolocation info. I have never encountered such an issue (as I'm usually not dealing with special coordinate systems) but I'm sure that there is a solution to be found (I suggest the GDAL/Proj user mailing list or online documentation). When you managed to obtain a georeferenced image, and it is still not rendering correctly, feel free to re-open this issue. |
Hello, is there a reason why I cannot display this type of tiff? I'm using the latest stable version (0.4.1). It doesn't throw any error but it isn't displayed on the leaflet layer... It works with other tiff.
Tiff dump
Magic: 0x4949 Version: 0x2a
Directory 0: offset 32450 (0x7ec2) next 0 (0)
ImageWidth (256) SHORT (3) 1<631>
ImageLength (257) SHORT (3) 1<461>
BitsPerSample (258) SHORT (3) 4<8 8 8 8>
Compression (259) SHORT (3) 1<8>
Photometric (262) SHORT (3) 1<2>
FillOrder (266) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 1<8>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<4>
RowsPerStrip (278) SHORT (3) 1<461>
StripByteCounts (279) LONG (4) 1<32442>
PlanarConfig (284) SHORT (3) 1<1>
PageNumber (297) SHORT (3) 2<0 1>
Whitepoint (318) RATIONAL (5) 2<0.3127 0.329>
PrimaryChromaticities (319) RATIONAL (5) 6<0.64 0.33 0.3 0.6 0.15 0.06>
ExtraSamples (338) SHORT (3) 1<2>
33550 (0x830e) DOUBLE (12) 3<1000 1000 0>
33922 (0x8482) DOUBLE (12) 6<0 0 0 255000 480000 0>
34735 (0x87af) SHORT (3) 96<1 1 0 23 1024 0 1 1 1025 0 1 1 1026 34737 11 0 2048 0 1 32767 2049 34737 82 11 ...>
34736 (0x87b0) DOUBLE (12) 13<6.3774e+06 299.153 0 674.374 15.056 405.346 600000 200000 7.43958 46.9524 1 90 90>
34737 (0x87b1) ASCII (2) 94<SWISS_GRID|GCS Name = SW ...>
The text was updated successfully, but these errors were encountered: