gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Add capability to quantize geometry coordinates for higher compression efficiency

Open rouault opened this issue 3 years ago • 1 comments

and GPKG: add creation options to quantify coordinates

-  **XY_QUANTIZED_PRECISION** =float or string. (GDAL >= 3.7)
   Desired precision for X/Y coordinate quantization.
   This parameter will influence the number of nullified
   least significant bits in the mantissa of the binary representation of
   coordinates as IEEE-754 double-precision floating-point numbers.
   This is only useful if the file is compressed.
   By default, the value is understood as expressed in the units of the CRS
   of the layer (for example, for a geographic Earth CRS, "8.9e-9" corresponds
   to a millimetric precision), unless the 'm', 'cm' or 'mm' suffixes are added
   to express respectively the value in metre, centimetre or millimetre (will work
   for a geographic or projected CRS). For example, "1 mm" for a millimetric
   precision.
-  **Z_QUANTIZED_PRECISION** =float or string. (GDAL >= 3.7)
   Desired precision for Z coordinate quantization.
   This parameter will influence the number of nullified
   least significant bits in the mantissa of the binary representation of
   coordinates as IEEE-754 double-precision floating-point numbers.
   This is only useful if the file is compressed.
   By default, the value is understood as expressed in the units of the CRS
   of the layer, unless the 'm', 'cm' or 'mm' suffixes are added
   to express respectively the value in metre, centimetre or millimetre (will work
   for a geographic or projected CRS). For example, "1 mm" for a millimetric
   precision.
-  **M_QUANTIZED_PRECISION** =float. (GDAL >= 3.7)
   Desired precision for M coordinate quantization.
   This parameter will influence the number of nullified
   least significant bits in the mantissa of the binary representation of
   coordinates as IEEE-754 double-precision floating-point numbers.
   This is only useful if the file is compressed.

and ogr2ogr: add -xy_quantized_prec/-z_quantized_prec/-m_quantized_prec options

On a test dataset, setting XY_QUANTIZED_PRECISION=0.001m reduces the size of the .zip of the .gpkg file from 766 MB to 667 MB (13% size decrease).

rouault avatar Dec 22 '22 17:12 rouault

I'm putting this on hold because I'm wondering if that shouldn't be part of a larger "framework" to convey coordinate precision between drivers

rouault avatar Feb 20 '23 14:02 rouault

closing as superseded per https://github.com/OSGeo/gdal/pull/9378

rouault avatar Mar 06 '24 19:03 rouault