r.in.xyz is designed for processing massive point cloud datasets, for example raw LIDAR or sidescan sonar swath data. It has been tested with datasets as large as 1.5 billion points.
Available statistics for populating the raster are:
n | number of points in cell |
min | minimum value of points in cell |
max | maximum value of points in cell |
range | range of points in cell |
sum | sum of points in cell |
mean | average value of points in cell |
stddev | standard deviation of points in cell |
variance | variance of points in cell |
coeff_var | coefficient of variance of points in cell |
median | median value of points in cell |
percentile | pth percentile of points in cell |
skewness | skewness of points in cell |
trimmean | trimmed mean of points in cell |
The default map type=FCELL is intended as compromise between preserving data precision and limiting system resource consumption. If reading data from a stdin stream, the program can only run using a single pass.
wc -l inputfile.txt g.region -p # points_per_cell = n_points / (rows * cols) g.region -e # UTM location: # points_per_sq_m = n_points / (ns_extent * ew_extent) # Lat/Lon location: # points_per_sq_m = n_points / (ns_extent * ew_extent*cos(lat) * (1852*60)^2)
If you only intend to interpolate the data with r.to.vect and v.surf.rst, then there is little point to setting the region resolution so fine that you only catch one data point per cell -- you might as well use "v.in.ascii -zbt" directly.
Blank lines and comment lines starting with the hash symbol (#) will be skipped.
The zrange parameter may be used for filtering the input data by vertical extent. Example uses might include preparing multiple raster sections to be combined into a 3D raster array with r.to.rast3, or for filtering outliers on relatively flat terrain.
In varied terrain the user may find that min maps make for a good noise filter as most LIDAR noise is from premature hits. The min map may also be useful to find the underlying topography in a forested or urban environment if the cells are over sampled.
The user can use a combination of r.in.xyz output maps to create custom filters. e.g. use r.mapcalc to create a mean-(2*stddev) map. [In this example the user may want to include a lower bound filter in r.mapcalc to remove highly variable points (small n) or run r.neighbors to smooth the stddev map before further use.]
Typical commands to create a DEM using a regularized spline fit:
r.univar lidar_min r.to.vect -z feature=point in=lidar_min out=lidar_min_pt v.surf.rst layer=0 in=lidar_min_pt elev=lidar_min.rst
# scan and set region bounds r.in.xyz -s fs=, in=lidaratm2.txt out=test g.region n=35.969493 s=35.949693 e=-75.620999 w=-75.639999 g.region res=0:00:00.075 -a # create "n" map containing count of points per cell for checking density r.in.xyz in=lidaratm2.txt out=lidar_n fs=, method=n zrange=-2,50 # check point density [rho = n_sum / (rows*cols)] r.univar lidar_n | grep sum # create "min" map (elevation filtered for premature hits) r.in.xyz in=lidaratm2.txt out=lidar_min fs=, method=min zrange=-2,50 # zoom to area of interest g.region n=35:57:56.25N s=35:57:13.575N w=75:38:23.7W e=75:37:15.675W # check number of non-null cells (try and keep under a few million) r.univar lidar_min | grep '^n:' # convert to points r.to.vect -z feature=point in=lidar_min out=lidar_min_pt # interpolate using a regularized spline fit v.surf.rst layer=0 in=lidar_min_pt elev=lidar_min.rst # set color scale to something interesting r.colors lidar_min.rst rule=bcyr -n -e # prepare a 1:1:1 scaled version for NVIZ visualization (for lat/lon input) r.mapcalc "lidar_min.rst_scaled = lidar_min.rst / (1852*60)" r.colors lidar_min.rst_scaled rule=bcyr -n -e
Last changed: $Date$