wonder-sk / point-cloud-experiments

Just some prototyping for QGIS point clouds implementation
1 stars 0 forks source link

Extract stats for each dimension from EPT metadata #43

Closed wonder-sk closed 3 years ago

wonder-sk commented 3 years ago

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

nyalldawson commented 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?

nyalldawson commented 3 years ago

See https://github.com/qgis/QGIS/pull/40389