Thinning LiDAR

kia ora folks…

just a quick one to see if anyone has any experience using gmt to thin down lidar files?

I have 1m resolution .tif files that I want to make smaller, to say 5 m resolution.

have been using this command:

grdfilter nanned.grd -Gfiltered_nanned.grd -Fm0.005 -D1 -Ni -I0.0000488056698375

where ‘nanned.grd’ is the original .tif tile with the NaN values removed, it covers a craggy coastline and i am sacking off all the stuff out in the deep water.

I did the Nan removal with:

grdmath $datafile -1.0 GT $datafile MUL 0 NAN = nanned.grd

the commands above are giving me (what i think) are good results, but I was wondering if anyone had any specific recommendations on the best filter to use. I am using ‘median’ (-Fm)

the long number after the -I flag is 5x the original grid resolution,

the file is in lat/long WGS84 coordinates, hence -D1 (grid in degrees, filter width in km (5 m = 0.005 km)

after this, i will write them out to .xyz files to combine with bathymetry data from digitized nautical charts and then finally grid in to 10 or 20 m resolution modelling grids.

happy to hear what anyone has to say, suggestions etc.

attached are plots of the original file, NaNs removed and the thinned file.



I’d probably use the same method.
I’d maybe add some coast and clip for aesthetic.

cool, cheers… yeah these are just demo plots… they will be combined with other offshore data to make computational modelling grids. plots will be made from the eventual output…

Tsunamis inundating LIDAR DEMs?

I would recommend applying a gaussian filter to the very high resolution data, not a median filter, before downsampling.

1 Like

You could share that in #Show-your-nice-example-script once you’re done :wink:

just making modelling grids for an inundation study, thousands of lidar tiles… all at 1 m resolution. need them to be a bit lighter to make the modelling grids at 10 to 20 m resolution.

Why gaussian filter is better than median in this case? Is there any relevant reading on the matter? Thanks.

I have not worked with a lot of lidar topographic data, only DEMs from other sources. The gaussian filter is a better filter for continuous geophysical signals because it is a linear filter and you can estimate the change in uncertainty. Lidar topographic data might have points with large errors, depending on how it was processed, so in that case a median filter might work better as it will be less affected by scattered points that have large errors.

I can’t think of a publication on this. Maybe @pwessel has a suggestion?