This document is archived and information here might be outdated. Recommended version. |
Set points' class code.
[Visual Basic .NET] Public Sub SetClassCode ( _ ByVal pTrackCancel As ITrackCancel, _ ByVal FileIndex As Integer, _ ByVal pAOI As Object, _ ByVal bufferDistance As Double, _ ByVal pZRange As IDoubleArray, _ ByVal pFilter As ILasAttributeFilter, _ ByVal newCode As Integer, _ ByVal bCalculateStats As Boolean _ )
[C#] public void SetClassCode ( ITrackCancel pTrackCancel, int FileIndex, object pAOI, double bufferDistance, IDoubleArray pZRange, ILasAttributeFilter pFilter, int newCode, bool bCalculateStats );
[C++]
HRESULT SetClassCode(
ITrackCancel* pTrackCancel,
long FileIndex,
LPUNKNOWN pAOI,
double bufferDistance,
IDoubleArray* pZRange,
ILasAttributeFilter* pFilter,
long newCode,
VARIANT_BOOL bCalculateStats
);
[C++] Parameters pTrackCancel [in]
pTrackCancel is a parameter of type ITrackCancel* FileIndex [in]
FileIndex is a parameter of type long pAOI [in]
pAOI is a parameter of type IUnknown bufferDistance [in]
bufferDistance is a parameter of type double pZRange [in]
pZRange is a parameter of type IDoubleArray* pFilter [in]
pFilter is a parameter of type ILasAttributeFilter* newCode [in]
newCode is a parameter of type long bCalculateStats [in]
bCalculateStats is a parameter of type bool
SetClassCode is used to set/change class codes for points in las files. Spatial and attribute filters determine what points get modified.
pTrackCancel references a CancelTracker that can be used to stop the process. This can be set to NULL if the ability for the user to cancel isn't required.
fileIndex is the index to the specific las file, as referenced by the las dataset, that will be modified. Valid fileIndex values range from 0 .. ILasDataset.FileCount-1.
pAOI is the area of interest. Las points coincident or intersected by this area will potentially be modified. pAOI may be an individual point, polyline, or polygon geometry as well as a feature class containing one of these geometry types. If a feature class is specified then each shape it contains will be used as a separate area of interest. Passing individual geometries is best used in conjunction with interactive tools. Passing a feature class is the most efficient method when you have many pre-existing shapes such as a collection of water bodies or breaklines that are being used to code the points. Z values of inputs are ignored. The pZRange parameter can be used to specify a height constraint.
bufferDistance modifies the input pAOI geometry. Each shape will be buffered by this amount. The result is used as the AOI. Negative buffers can be used on polygons. For no buffer give a distance of 0.0.
pZRange is a DoubleArray used to specify a height range that acts as an additional constraint to the pAOI. You can either provide a NULL pointer if you're not interested in filtering by height or a DoubleArray with two values representing zmin and zmax.
pFilter is a LasAttributeFilter that adds qualitiers to control what las points get operated on. In addition to satisfying the pAOI and pZRange qualifiers, input points would also need to pass through this filter. A NULL pointer can be used if this filter isn't needed.
newCode is written out as the new classification value for las points that satisfy the criteria set up by the other parmeters of this method.
bCalculateStats informs the las dataset whether or not to (re)generate the las file statistics after performing the edit. If no further edits will be made to the las file, and statistics exist but will be invalidated with this call, or are desired to be made from scratch, then set this to TRUE. Otherwise, set it to FALSE to avoid an unnecessary expense.
Notes:
This method edits the las files containing the points. There is no support for undo. Consider the need to backup your las files before calling ILasPointEdit methods.