@@ -405,9 +405,8 @@ module GMTDGTLidarExt
405405
406406 # Resolve output CRS: "geog" → EPSG:4326, bare digits → EPSG:<n>, anything else → pass directly
407407 t_srs = isempty (proj) ? " " :
408- proj == " geog" ? " EPSG:4326" :
409- all (isdigit, proj) ? " EPSG:$proj " :
410- proj
408+ startswith (proj, " geo" ) ? " EPSG:4326" :
409+ all (isdigit, proj) ? " EPSG:$proj " : proj
411410
412411 # When tiles are explicitly provided from dgt_lidar, STAC selected exactly the right tiles — no clipping needed.
413412 # For point queries the bbox is epsilon (lon±1e-5) — also skip clip.
@@ -417,12 +416,11 @@ module GMTDGTLidarExt
417416 # gdalwarp: -te xmin ymin xmax ymax (bbox[1]=min_lon, bbox[3]=min_lat, bbox[2]=max_lon, bbox[4]=max_lat)
418417 opts = String[]
419418 if ! skip_clip
420- append! (opts, [" -te" , string (bbox[1 ]), string (bbox[3 ]), string (bbox[2 ]), string (bbox[4 ]),
421- " -te_srs" , " EPSG:4326" ])
419+ append! (opts, [" -te" , string (bbox[1 ]), string (bbox[3 ]), string (bbox[2 ]), string (bbox[4 ]), " -te_srs" , " EPSG:4326" ])
422420 end
423421 ! isempty (t_srs) && append! (opts, [" -t_srs" , t_srs])
424- inc != 0 && append! (opts, [" -tr" , string (inc), string (inc)])
425- append! (opts, [" -r" , method, fmt_opts... ])
422+ inc != 0 && append! (opts, [" -tr" , string (inc), string (inc)])
423+ append! (opts, [" -r" , method, fmt_opts... , " -dstnodata " , " NaN " ])
426424 if use_mem
427425 vsimem = " /vsimem/dgt_mosaic_$(rand (UInt32)) .tiff"
428426 GMT. gdalwarp (vrt_ds, opts; dest= vsimem)
@@ -433,8 +431,8 @@ module GMTDGTLidarExt
433431 GMT. gdalwarp (vrt_ds, opts; dest= outfile)
434432 else
435433 # bbox = [min_lon, max_lon, min_lat, max_lat]; -projwin expects: ulx uly lrx lry
436- opts = skip_clip ? [fmt_opts... ] :
437- [" -projwin" , string (bbox[1 ]), string (bbox[4 ]), string (bbox[2 ]), string (bbox[3 ]),
434+ opts = skip_clip ? [" -a_nodata " , " NaN " , fmt_opts... ] :
435+ [" -a_nodata " , " NaN " , " - projwin" , string (bbox[1 ]), string (bbox[4 ]), string (bbox[2 ]), string (bbox[3 ]),
438436 " -projwin_srs" , " EPSG:4326" , fmt_opts... ]
439437 if use_mem
440438 vsimem = " /vsimem/dgt_mosaic_$(rand (UInt32)) .tiff"
0 commit comments