Skip to content

Commit fea01af

Browse files
committed
docs(dem_quantize): update quantization method to use resolution and gradient criteria
1 parent 476db16 commit fea01af

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

versatiles_pipeline/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ using the URL template from the TileJSON `tiles` array.
142142
## `dem_quantize`
143143

144144
Quantize DEM (elevation) raster tiles by zeroing unnecessary low bits.
145-
Scans each tile's elevation range, calculates how many bits of precision
146-
are needed for the requested accuracy, and zeros out the rest.
147-
This makes tiles much more compressible (PNG/WebP) without losing
148-
meaningful detail.
145+
Computes a per-tile quantization mask from two physically meaningful criteria:
146+
resolution relative to tile size, and maximum gradient distortion.
147+
The stricter (smaller step) wins. Single-pass — no min/max scan needed.
149148

150149
### Parameters
151150

152-
- *`bits`: u8 (optional)* - Number of bits of precision to retain within the tile's elevation range. 2^bits = number of distinct levels. Defaults to 8 (256 levels).
151+
- *`resolution_ratio`: f64 (optional)* - Minimum elevation resolution as fraction of tile ground size. E.g. 0.001 means for a 1000 m tile, keep 1 m resolution. Defaults to 0.001.
152+
- *`max_gradient_error`: f64 (optional)* - Maximum allowed gradient change in degrees due to quantization. Defaults to 1.0.
153153
- *`encoding`: String (optional)* - Override auto-detection of DEM encoding. Values: "mapbox", "terrarium".
154154

155155
## `filter`

0 commit comments

Comments
 (0)