3

I Have a large Point shapefile (xyz, about 65,000 points) from a LiDAR las file and am trying to interpolate this onto a grid using gdal_grid:

gdal_grid -ot Float64 
          -txe  422306.5970  422343.9970 
          -tye 4037022.9899 4036967.3399 
          -outsize 747 1112
          -a linear:radius=0:nodata=0
          in.shp out.tif

This runs without error and produces a map that looks like the first image below. You'll notice the triangular pattern, as if most of the points are ignored. The values in this funny image are within <1 of what they should be, so gdal_grid appears to be reading the z field appropriately, it is just missing most points it seems. If I try invdist or average, keeping all else the same, the issue goes away and the grid looks as it should (see second image with same color scale). In this example, the variation is between 1091 and 1093. I tried scaling the Z to make the variation larger in the shapefile and still found the same issue. I also tried the -z_multiply and -z_increase to no avail. Unfortunately I need bilinear interpolation so I'm at an impasse. Any ideas?

not working

I get the output below by only changing the interpolation method to invdist:

gdal_grid -ot Float64 
          -txe  422306.5970  422343.9970 
          -tye 4037022.9899 4036967.3399 
          -outsize 747 1112
          -a invdist:radius1=1:radius2=1
          in.shp out.tif

working

user2611761
  • 169
  • 1
  • 1
  • 11

1 Answers1

0

Sorry to be late, but I faced the same issue and I couldn't find any explanation. Then I noticed that both OP and mine dataset origin parameters were pretty high.

I don't know anything about this specific implementation of Delaunay algorithm, but my guess is that for small changes of X,Y (small compared to the absolute space position of each point, not sure what is the ratio) are ignored and represented under a bigger triangle, thus losing details and precision.

You can clearly appreciate the difference between an interpolation made with a point cloud of absolute values and one with relative ones:

result of gdal_grid with original parameters:

result of gdal_grid with (0,0) as origin

I solved by removing a fixed offset from the original points, interpolating and then adding the same offset.

I hope this can help.