Closed drnextgis closed 2 years ago
fwiw, I'm happy to re-write this function to improve the user experience. @constantinius , just let me know what you'd like the intended functionality to be. thank you.
If I understood it correctly getGDALMetadata()
(without specifying a band) should return:
{
LOL: 'WUT'
}
in case of a raster with the following metadata:
> image.fileDirectory.GDAL_METADATA;
'<GDALMetadata>\n' +
' <Item name="LOL">WUT</Item>\n' +
' <Item name="STATISTICS_MAXIMUM" sample="0">255</Item>\n' +
' <Item name="STATISTICS_MEAN" sample="0">228.06239581697</Item>\n' +
' <Item name="STATISTICS_MINIMUM" sample="0">0</Item>\n' +
' <Item name="STATISTICS_STDDEV" sample="0">72.29049275142</Item>\n' +
' <Item name="STATISTICS_VALID_PERCENT" sample="0">100</Item>\n' +
' <Item name="STATISTICS_MAXIMUM" sample="1">255</Item>\n' +
' <Item name="STATISTICS_MEAN" sample="1">223.45111593246</Item>\n' +
' <Item name="STATISTICS_MINIMUM" sample="1">0</Item>\n' +
' <Item name="STATISTICS_STDDEV" sample="1">73.473561068089</Item>\n' +
' <Item name="STATISTICS_VALID_PERCENT" sample="1">100</Item>\n' +
' <Item name="STATISTICS_MAXIMUM" sample="2">255</Item>\n' +
' <Item name="STATISTICS_MEAN" sample="2">227.75670581369</Item>\n' +
' <Item name="STATISTICS_MINIMUM" sample="2">0</Item>\n' +
' <Item name="STATISTICS_STDDEV" sample="2">73.296580537495</Item>\n' +
' <Item name="STATISTICS_VALID_PERCENT" sample="2">100</Item>\n' +
' <Item name="STATISTICS_MAXIMUM" sample="3">255</Item>\n' +
' <Item name="STATISTICS_MEAN" sample="3">73.349654800482</Item>\n' +
' <Item name="STATISTICS_MINIMUM" sample="3">0</Item>\n' +
' <Item name="STATISTICS_STDDEV" sample="3">115.34685952339</Item>\n' +
' <Item name="STATISTICS_VALID_PERCENT" sample="3">100</Item>\n' +
'</GDALMetadata>\n' +
'\x00'
But at the moment geotiff.js
is mixing dataset-level metadata with the metadata of last sample:
> image.getGDALMetadata()
{
LOL: 'WUT',
STATISTICS_MAXIMUM: '255',
STATISTICS_MEAN: '73.349654800482',
STATISTICS_MINIMUM: '0',
STATISTICS_STDDEV: '115.34685952339',
STATISTICS_VALID_PERCENT: '100'
}
@drnextgis , thanks for drafting that up. It wouldn't be difficult to update the code to reflect this test case. I'll let @constantinius weigh in before working up a PR.
Sorry, have missed this. I think it is most useful for getGDALMetadata()
with no argument to only return global metadata, not any band specific metadata. Feel free to draft a PR @DanielJDufour
I'm on it
It is saying here:
The question is what dataset-level metadata is? As I can see it simply returns metadata of the last band:
cc @rouault