Hello,
I’ve been trying to read some geotiff datasets. Reading it with GeoTIFF.jl
results in a GeoTIFF.GeoTIFFImageIterator{TiffImages.StridedTaggedImage{...}}}
.
This case is not really documented anywhere neither in GeoTIFF
nor in TiffImages
so I am unsure on how one is supposed to manipulate it.
This is the full output:
GeoTIFF Output
GeoTIFF.GeoTIFFImageIterator{TiffImages.StridedTaggedImage{UInt64, Matrix{ColorTypes.Gray{Float32}}}, Base.Generator{Vector{TiffImages.IFD{UInt64}}, GeoTIFF.var"#19#20"}}(Any[ColorTypes.Gray{Float32}[Gray{Float32}(-7.5412407f0) Gray{Float32}(-7.70549f0) … Gray{Float32}(-2375.686f0) Gray{Float32}(-2376.507f0); Gray{Float32}(-8.608861f0) Gray{Float32}(-8.773109f0) … Gray{Float32}(-2374.7825f0) Gray{Float32}(-2376.425f0); … ; Gray{Float32}(43.62238f0) Gray{Float32}(45.018497f0) … Gray{Float32}(-1532.1022f0) Gray{Float32}(-1532.1842f0); Gray{Float32}(45.10062f0) Gray{Float32}(46.16824f0) … Gray{Float32}(-1532.1022f0) Gray{Float32}(-1532.1842f0)], ColorTypes.Gray{Float32}[Gray{Float32}(-8.157152f0) Gray{Float32}(-8.732026f0) … Gray{Float32}(-2377.2463f0) Gray{Float32}(-2375.85f0); Gray{Float32}(-10.087005f0) Gray{Float32}(-10.497636f0) … Gray{Float32}(-2377.6362f0) Gray{Float32}(-2375.727f0); … ; Gray{Float32}(43.66345f0) Gray{Float32}(43.499256f0) … Gray{Float32}(-1532.1227f0) Gray{Float32}(-1532.2664f0); Gray{Float32}(44.977463f0) Gray{Float32}(44.669476f0) … Gray{Float32}(-1532.1022f0) Gray{Float32}(-1532.1432f0)], ColorTypes.Gray{Float32}[Gray{Float32}(-9.368346f0) Gray{Float32}(-10.163881f0) … Gray{Float32}(-2377.9905f0) Gray{Float32}(-2376.6147f0); Gray{Float32}(-11.5189495f0) Gray{Float32}(-11.585778f0) … Gray{Float32}(-2375.5735f0) Gray{Float32}(-2376.148f0); … ; Gray{Float32}(43.396812f0) Gray{Float32}(43.288292f0) … Gray{Float32}(-1532.1022f0) Gray{Float32}(-1532.4409f0); Gray{Float32}(44.202477f0) Gray{Float32}(42.852448f0) … Gray{Float32}(-1532.1022f0) Gray{Float32}(-1532.1586f0)], ColorTypes.Gray{Float32}[Gray{Float32}(-10.659187f0) Gray{Float32}(-11.235324f0) … Gray{Float32}(-2376.605f0) Gray{Float32}(-2376.5815f0); Gray{Float32}(-11.747573f0) Gray{Float32}(-11.647497f0) … Gray{Float32}(-2372.8823f0) Gray{Float32}(-2375.5977f0); … ; Gray{Float32}(43.17711f0) Gray{Float32}(43.858208f0) … Gray{Float32}(-1531.9242f0) Gray{Float32}(-1532.7655f0); Gray{Float32}(43.435093f0) Gray{Float32}(44.234425f0) … Gray{Float32}(-1531.7432f0) Gray{Float32}(-1532.2009f0)], ColorTypes.Gray{Float32}[Gray{Float32}(-11.322267f0) Gray{Float32}(-11.448627f0) … Gray{Float32}(-2370.4438f0) Gray{Float32}(-2375.417f0); Gray{Float32}(-11.569621f0) Gray{Float32}(-11.449963f0) … Gray{Float32}(-2366.1345f0) Gray{Float32}(-2371.188f0); … ; Gray{Float32}(44.226574f0) Gray{Float32}(43.909412f0) … Gray{Float32}(-1531.3268f0) Gray{Float32}(-1532.9606f0); Gray{Float32}(43.67626f0) Gray{Float32}(44.4127f0) … Gray{Float32}(-1530.5358f0) Gray{Float32}(-1532.1583f0)], ColorTypes.Gray{Float32}[Gray{Float32}(-11.4475765f0) Gray{Float32}(-11.208084f0) … Gray{Float32}(-2365.8428f0) Gray{Float32}(-2370.7974f0); Gray{Float32}(-11.140415f0) Gray{Float32}(-11.298808f0) … Gray{Float32}(-2354.5442f0) Gray{Float32}(-2360.42f0); … ; Gray{Float32}(43.584164f0) Gray{Float32}(43.737946f0) … Gray{Float32}(-1529.1589f0) Gray{Float32}(-1533.4852f0); Gray{Float32}(44.05623f0) Gray{Float32}(44.68009f0) … Gray{Float32}(-1528.362f0) Gray{Float32}(-1531.7451f0)]], Base.Generator{Vector{TiffImages.IFD{UInt64}}, GeoTIFF.var"#19#20"}(GeoTIFF.var"#19#20"(), TiffImages.IFD{UInt64}[IFD, with tags:
Tag(IMAGEWIDTH, 16666)
Tag(IMAGELENGTH, 23333)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[424318014, 424600685, 424898509, 425059230, 425180156, ...])
Tag(TILEBYTECOUNTS, UInt32[282663, 297816, 160713, 120918, 132183, ...])
Tag(SAMPLEFORMAT, 3)
Tag(MODELPIXELSCALE, Float64[0.0002999999999999996, 0.0003000000000000001, 0.0])
Tag(MODELTIEPOINT, Float64[0.0, 0.0, 0.0, 142.0000611111, -10.000138888905807, ...])
Tag(GEOKEYDIRECTORY, UInt16[1, 1, 0, 7, 1024, ...])
Tag(GEODOUBLEPARAMS, Float64[298.257223563, 6.378137e6])
Tag(GEOASCIIPARAMS, "WGS 84|")
Tag(GDALNODATA, "-9999"), IFD, with tags:
Tag(SUBFILETYPE, 1)
Tag(IMAGEWIDTH, 8333)
Tag(IMAGELENGTH, 11667)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[110023558, 110944836, 111707108, 112501107, 113298705, ...])
Tag(TILEBYTECOUNTS, UInt32[921270, 762264, 793991, 797590, 899336, ...])
Tag(SAMPLEFORMAT, 3)
Tag(GDALNODATA, "-9999"), IFD, with tags:
Tag(SUBFILETYPE, 1)
Tag(IMAGEWIDTH, 4167)
Tag(IMAGELENGTH, 5834)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[27895940, 28804616, 29687974, 30614470, 31549359, ...])
Tag(TILEBYTECOUNTS, UInt32[908668, 883350, 926488, 934881, 886679, ...])
Tag(SAMPLEFORMAT, 3)
Tag(GDALNODATA, "-9999"), IFD, with tags:
Tag(SUBFILETYPE, 1)
Tag(IMAGEWIDTH, 2084)
Tag(IMAGELENGTH, 2917)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[6818639, 7745514, 8691403, 9563744, 10427788, ...])
Tag(TILEBYTECOUNTS, UInt32[926867, 945881, 872333, 864036, 64373, ...])
Tag(SAMPLEFORMAT, 3)
Tag(GDALNODATA, "-9999"), IFD, with tags:
Tag(SUBFILETYPE, 1)
Tag(IMAGEWIDTH, 1042)
Tag(IMAGELENGTH, 1459)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[1416326, 2378142, 3259160, 3293416, 4254955, ...])
Tag(TILEBYTECOUNTS, UInt32[961808, 881010, 34248, 961531, 892386, ...])
Tag(SAMPLEFORMAT, 3)
Tag(GDALNODATA, "-9999"), IFD, with tags:
Tag(SUBFILETYPE, 1)
Tag(IMAGEWIDTH, 521)
Tag(IMAGELENGTH, 730)
Tag(BITSPERSAMPLE, 32)
Tag(COMPRESSION, COMPRESSION_ADOBE_DEFLATE)
Tag(PHOTOMETRIC, 1)
Tag(SAMPLESPERPIXEL, 1)
Tag(PLANARCONFIG, 1)
Tag(PREDICTOR, 1)
Tag(TILEWIDTH, 512)
Tag(TILELENGTH, 512)
Tag(TILEOFFSETS, UInt64[27052, 977349, 996614, 1407686])
Tag(TILEBYTECOUNTS, UInt32[950289, 19257, 411064, 8632])
Tag(SAMPLEFORMAT, 3)
Tag(GDALNODATA, "-9999")]))
It seems that the dataset contains the same region but at different resolutions.
I can access the raw elevation data, by iterating manually or defining nth(itr, n) = first(Iterators.drop(itr, n-1))
to access the images, but the extracted images don’t seem to have any metadata.
I would need the spatial information of the dataset, such as resolution, or extents, because I need to extract a cutout, but I can’t seem to find a way to do it with this dataset.
I have also tried with Rasters.jl
but to no avail.
Am I using the wrong package? is GeoTIFF.jl
too low level?