opengeospatial / geopackage-tiled-gridded-coverage

A GeoPackage extension for tiled, gridded coverage data
Apache License 2.0
5 stars 8 forks source link

Specify if offset is added or subtracted, and interaction with scale #7

Closed bradh closed 8 years ago

bradh commented 9 years ago

gpkg_2D_gridded_coverage_ancillary has a column offset, which is not well specified.

Given a DEM with a negative minimum height (relative to the vertical datum) - say -20 metres, if the samples are offset by 20 metres such that the range of altitude is [0 ... max + 20], then should the offset be -20 or 20? Equivalently, given a sample value of X, should I add the offset value or subtract the offset value to get the true elevation relative to datum.

Similarly, if the scale is != 1, does the offset get affected by scale or not? That is, is offset scaled by the scale multiple before being stored?

bradh commented 9 years ago

After this is clarified, then we need to figure out if the min, max, mean and std_dev fields in gpkg_2D_gridded_tile_ancillary are scaled and offset or not.

jyutzler commented 9 years ago

Today the SWG agreed that the offset shall be added to the stored value and the scale shall be multiplied.

I forgot to ask today on the other two questions.

I believe

So as to not delay things further, I will ask SWG members to review these two questions and make sure we are in agreement.

rouault commented 8 years ago

I had the same question while reading the spec. For reference, in GDAL VRT, the use of scale and offset is the same as the one suggested by @jyutzler : "For linear scaling, applying the scale ratio, then scale offset ". In code : fResult = (float) (fResult * dfScaleRatio + dfScaleOff);

jyutzler commented 8 years ago

In today's SWG we agreed to update the text to make it consistent with what is here.