Problem
to_geotiff(..., compression='lerc') always calls lerc_compress with max_z_error=0.0 (lossless). LERC's main draw is that you can trade a small per-pixel error budget for big size savings on float data, and there is currently no public way to set that budget.
xrspatial/geotiff/_writer.py:401-404, 464-467, 1106-1109 all call lerc_compress(strip_data, ..., samples=samples, dtype=dtype) without forwarding a max_z_error argument, so it falls through to the function default of 0.0 in _compression.py:1018-1020.
Repro
```python
import numpy as np, xarray as xr, os
from xrspatial.geotiff import to_geotiff
data = xr.DataArray(np.random.rand(1024, 1024).astype(np.float32))
to_geotiff(data, '/tmp/lossless.tif', compression='lerc')
to_geotiff(data, '/tmp/lossy.tif', compression='lerc') # no way to ask for lossy
print(os.path.getsize('/tmp/lossless.tif'),
os.path.getsize('/tmp/lossy.tif')) # identical
```
Suggested fix
Add max_z_error: float = 0.0 to to_geotiff and forward it through _write_stripped, _prepare_tile, the streaming writer, COG, and VRT paths into lerc_compress. Validate that max_z_error == 0 (or raise) when the selected compression is not LERC, so callers don't silently get the value ignored.
Problem
to_geotiff(..., compression='lerc')always callslerc_compresswithmax_z_error=0.0(lossless). LERC's main draw is that you can trade a small per-pixel error budget for big size savings on float data, and there is currently no public way to set that budget.xrspatial/geotiff/_writer.py:401-404, 464-467, 1106-1109all calllerc_compress(strip_data, ..., samples=samples, dtype=dtype)without forwarding amax_z_errorargument, so it falls through to the function default of0.0in_compression.py:1018-1020.Repro
```python
import numpy as np, xarray as xr, os
from xrspatial.geotiff import to_geotiff
data = xr.DataArray(np.random.rand(1024, 1024).astype(np.float32))
to_geotiff(data, '/tmp/lossless.tif', compression='lerc')
to_geotiff(data, '/tmp/lossy.tif', compression='lerc') # no way to ask for lossy
print(os.path.getsize('/tmp/lossless.tif'),
os.path.getsize('/tmp/lossy.tif')) # identical
```
Suggested fix
Add
max_z_error: float = 0.0toto_geotiffand forward it through_write_stripped,_prepare_tile, the streaming writer, COG, and VRT paths intolerc_compress. Validate thatmax_z_error == 0(or raise) when the selected compression is not LERC, so callers don't silently get the value ignored.