Vous êtes sur la page 1sur 2

3/19/2017 catalog_applyJeanRomain/lidRWiki

This repository Search Pull requests Issues Gist

JeanRomain / lidR Watch 5 Star 11 Fork 7

Code Issues 1 Pull requests 0 Projects 1 Wiki Pulse Graphs

catalog_apply Edit New Page

JeanRomain Roussel edited this page on Dec 5, 2016 3 revisions

Process all the file of a Catalog Pages 28

The function catalog_apply enable to analyze all the tiles of a catalog in a parallelized loop. When
Home
parallelized, the behaviors of the function is different on Unix GNU/Linux and Mac and Windows
platform. Read the documentation for technical details. Catalog functions

catalog
Create your own process function catalog_select
catalog_queries
The input of the catalog_apply function is a function. This function must be defined by the user catalog_index

and must have a single parameter which is the name of a las or laz file. Then, the user can do catalog_apply

whatever he want in this function. Typically, open the las files and process it. The following example las functions
is very basic see also grid_metrics.
lasclassify
lasclip
analyse_tile=function(LASFile)
lasdecimate
{
#Loadthedata lasground
lidar=readLAS(LASFile) lasfilter
lasflightline
#computemymetrics lasnormalize
metrics=grid_metrics(lidar,myMetrics(X,Y,Z,Intensity,ScanAngle,pulseID))
laspulse

lasroi
return(metrics)
} lasscanline
lastrees
readLAS
Obviously the function can be more complicated. For example it can filter lakes from shapefile see writeLAS
also lasclassify. The function myMetrics must be written by the user too see also grid_metrics.
grid functions

Apply this function on the catalog grid_metrics


grid_metrics3d

By default it detects how many core you have. But you can add an optional parameter mc.core= grid_canopy
grid_tincanopy
3. For technical reasons explained in the documentation, the code for Unix GNU/Linux and Mac
grid_density
users differ from those for Windows users. Note that code for Windows works for both platform
grid_terrain
but not the opposite. Read the documentation carefully.
grid_hexametrics

Unix other

stdmetrics
output=project%>%catalog_apply(analyse_tile)
lasmetrics
plot

Windows
Clone this wiki locally
In windows mode, the child process cannot access to a shared memory. So, users must export their
https://github.com/JeanRomain/lidR.wiki.git
object themselves. Read the documentation carefully.
Clone in Desktop

https://github.com/JeanRomain/lidR/wiki/catalog_apply 1/2
3/19/2017 catalog_applyJeanRomain/lidRWiki

export=c("readLAS","grid_metrics","myMetrics")
output=project%>%catalog_apply(analyse_tile,varlist=export)

2017 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub API Training Shop Blog About

https://github.com/JeanRomain/lidR/wiki/catalog_apply 2/2