
Dylan Beaudette <debeaudette <at> ucdavis.edu> writes:

> 
> On Tuesday 08 September 2009, Michael Denslow wrote:
> > Dear R-sig-geo,
> >
> > I am posting the following question for one of my professors. I would
> > appreciate it if you could help me point him in the right direction.
> >
> > He is looking for a function which could take a lidar point shapefile
> > and decimate (remove) a selected number of points
> > from the file. Below is what he asked me. The file of the merged LIDAR
> > tiles contains roughly 350,000,000 points.
> >
> > "I am looking for some software to take a shapefile of lidar elevation
> > points and remove a selected number of points. The shapefile
> > (with fewer points) would then be used to generate a DEM. A
> > calculation of the appropriate resolution for a DEM can be made based
> > on a relationship between the
> > number of points and extent of the study area. The goal is to create
> > DEMs at a series of resolutions with the appropriate points to area
> > relationship. So a
> > software program with which you could remove a selected number of
> > lidar points would be helpful."
> >
> > I imagine that one of the packages that deals with point data (e.g.
> > sp, spatstat) can do this kind of thing but I am not sure how to get
> > him started. Can anyone point me to a specify function or make a
> > suggestion.
> >
> > Thanks in advance,
> > Michael
> 
> Hi,
> 
> I would recommend the r.in.xyz command within GRASS GIS. It can be used for 
> operations very similar to what you are looking for. The resulting file is a 
> raster, decimated to some set resolution. Some screen shots:
> 
> http://hamish.bowman.googlepages.com/grassfiles#xyz
> 
> Cheers,
> Dylan
> 

hi,

I did something similar (with a MUCH smaller LIDAR dataset) a while back to
randomly remove data points, but it probably can be modified to remove specific
points as well.  I didn't know about r.in.xyz, so you should check that out
first.  Note: This method most likely will a very long time with the large
dataset you have (mine was ~ 100,000 points).

I first converted the raw .las file to a text file with data in columns. This
can be done using las2txt on the following website (there are others out there
as well):
http://www.cs.unc.edu/~isenburg/lastools/
Or outputting the shapefile as an ascii (with each point as a row).

Once in .txt format, I read in the points to R:
dat <- read.table("lidarpts.txt", header=TRUE, sep="",
na.strings = "NA")

n.rm <- nrow(dat)*(0.5)  # Change multiplier to adjust number of points to 
# keep.  This will keep half the points.

n.rand <- floor(runif(n.rm, 1, nrow(dat)))  # Vector of length n.rm containing 
# random numbers between 1  and the number of rows in the .txt file. 

newdat <- dat[n.rand,]  # Selects only the rows specified in n.rand.  This 
# matrix would contain half the data points of the original, chosen at random. 
# Save this as a .txt file, import into ArcGIS, and then interpolate surface. 

HTH,

Ken



_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 

S:WM_HYGN_faster:082009
	[[alternative HTML version deleted]]

