diff --git a/export_heightmaps.py b/export_heightmaps.py index 0a5395b..9eba2c3 100644 --- a/export_heightmaps.py +++ b/export_heightmaps.py @@ -23,8 +23,8 @@ if ds is None: band = ds.GetRasterBand(1) -# Strategy B: compute global min/max for CURRENT downloaded AOI -gmin, gmax = band.ComputeRasterMinMax(True) +# Strategy B: compute global min/max for CURRENT downloaded AOI (full scan for stability) +gmin, gmax = band.ComputeRasterMinMax(False) print(f"GLOBAL_MIN={gmin}, GLOBAL_MAX={gmax}") # Export manifest for Unity placement later @@ -59,7 +59,8 @@ with open(manifest_path, "w", encoding="utf-8") as f: width=OUT_RES, height=OUT_RES, resampleAlg=RESAMPLE, - dstNodata=-9999, + srcNodata=-9999, + dstNodata=gmin, # fill nodata with global min to avoid deep pits ) gdal.Warp(tmp_path, ds, options=warp_opts)