示例#1
0
        private static PointCloudAnalysisResult QuantEstimateDensity(IPointCloudBinarySource source, int maxSegmentLength, SQuantizedExtentGrid <int> tileCounts, ProgressManager progressManager)
        {
            Statistics stats = null;
            List <PointCloudBinarySourceEnumeratorSparseGridRegion> gridIndexSegments = null;

            var extent          = source.Extent;
            var quantizedExtent = source.QuantizedExtent;

            var statsMapping = new ScaledStatisticsMapping(quantizedExtent.MinZ, quantizedExtent.RangeZ, 1024);
            var gridCounter  = new GridCounter(source, tileCounts);

            using (var process = progressManager.StartProcess("QuantEstimateDensity"))
            {
                var group = new ChunkProcessSet(gridCounter, statsMapping);
                group.Process(source.GetBlockEnumerator(process));
            }

            stats = statsMapping.ComputeStatistics(extent.MinZ, extent.RangeZ);
            var density = new PointCloudTileDensity(tileCounts, source.Quantization);

            gridIndexSegments = gridCounter.GetGridIndex(density, maxSegmentLength);

            var result = new PointCloudAnalysisResult(density, stats, source.Quantization, gridIndexSegments);

            return(result);
        }
示例#2
0
        private static PointCloudAnalysisResult QuantEstimateDensity(IPointCloudBinarySource source, int maxSegmentLength, SQuantizedExtentGrid<int> tileCounts, ProgressManager progressManager)
        {
            Statistics stats = null;
            List<PointCloudBinarySourceEnumeratorSparseGridRegion> gridIndexSegments = null;

            var extent = source.Extent;
            var quantizedExtent = source.QuantizedExtent;

            var statsMapping = new ScaledStatisticsMapping(quantizedExtent.MinZ, quantizedExtent.RangeZ, 1024);
            var gridCounter = new GridCounter(source, tileCounts);

            using (var process = progressManager.StartProcess("QuantEstimateDensity"))
            {
                var group = new ChunkProcessSet(gridCounter, statsMapping);
                group.Process(source.GetBlockEnumerator(process));
            }

            stats = statsMapping.ComputeStatistics(extent.MinZ, extent.RangeZ);
            var density = new PointCloudTileDensity(tileCounts, source.Quantization);
            gridIndexSegments = gridCounter.GetGridIndex(density, maxSegmentLength);

            var result = new PointCloudAnalysisResult(density, stats, source.Quantization, gridIndexSegments);

            return result;
        }