Closed wonder-sk closed 3 years ago
I agree - there's a strong need for this.
I'd suggest we make a small class/struct for QgsPointCloudAttributeStatistics containing the min/max/mean/stdev/other stats possibly contained in the entwine metadata (initialized to std::nan). Then we add a attributeStatistics method to the point cloud data provider class. That would handle my needs for clouds which already have statistics present.
For the second situation (calculating missing stats) I think we make a QgsPointCloudAttributeStatisticsContext class and add this as an argument to the attributeStatistics call. Then we can add useful things like the map extent and scale in the context.
But at some stage we'll need to start thinking about thread safety and the possibility to calculate these stats in a thread. Has there been any discussion yet on this regard?
For each dimension we can load from ept.json: min, max, mean, standard deviation, count.
For some dimensions (e.g. Classification) we also get counts of different values.
Warning: these stats are optional, so still we may want to have an option to calculate stats of a dimension from the current view? (which would take into account all active nodes)
@nyalldawson may have some more thoughts on this