public void SetFilters( IEnumerable<CIMPointCloudFilter> filters )
Public Sub SetFilters( _ ByVal filters As IEnumerable(Of CIMPointCloudFilter) _ )
Parameters
- filters
- The enumeration of filters to set
public void SetFilters( IEnumerable<CIMPointCloudFilter> filters )
Public Sub SetFilters( _ ByVal filters As IEnumerable(Of CIMPointCloudFilter) _ )
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
//Must be called on the MCT //var pcsl = ...; //Retrieve the available classification codes //At 2.x - var dict = pcsl.QueryAvailableClassCodesAndLabels(); var dict = pcsl.GetAvailableClassCodesAndLabels(); //Filter out low noise and unclassified (7 and 1 respectively) //consult https://pro.arcgis.com/en/pro-app/help/data/las-dataset/storing-lidar-data.htm var filterDef = new PointCloudFilterDefinition() { ClassCodes = dict.Keys.Where(c => c != 7 && c != 1).ToList(), ReturnValues = new List<PointCloudReturnType> { PointCloudReturnType.FirstOfMany } }; //apply the filter pcsl.SetFilters(filterDef.ToCIM());
//Must be called on the MCT //var pcsl = ...; var filters = pcsl.GetFilters(); PointCloudFilterDefinition fdef = null; if (filters.Count() == 0) { fdef = new PointCloudFilterDefinition() { //7 is "edge of flight line" - exclude ClassFlags = new List<ClassFlag> { new ClassFlag(7, ClassFlagOption.Exclude) } }; } else { fdef = PointCloudFilterDefinition.FromCIM(filters); //keep any include or ignore class flags var keep = fdef.ClassFlags.Where( cf => cf.ClassFlagOption != ClassFlagOption.Exclude).ToList(); //7 is "edge of flight line" - exclude keep.Add(new ClassFlag(7, ClassFlagOption.Exclude)); fdef.ClassFlags = keep; } //apply pcsl.SetFilters(fdef.ToCIM());
Target Platforms: Windows 11, Windows 10