| 402 | } |
| 403 | |
| 404 | GeospatialColumnStatisticsImpl::GeospatialColumnStatisticsImpl( |
| 405 | const proto::ColumnStatistics& pb) { |
| 406 | reset(); |
| 407 | if (!pb.has_geospatial_statistics()) { |
| 408 | bounder_.invalidate(); |
| 409 | } else { |
| 410 | const proto::GeospatialStatistics& stats = pb.geospatial_statistics(); |
| 411 | geospatial::BoundingBox::XYZM min; |
| 412 | geospatial::BoundingBox::XYZM max; |
| 413 | for (int i = 0; i < geospatial::MAX_DIMENSIONS; i++) { |
| 414 | min[i] = max[i] = std::numeric_limits<double>::quiet_NaN(); |
| 415 | } |
| 416 | if (stats.has_bbox()) { |
| 417 | const auto& protoBBox = stats.bbox(); |
| 418 | min[0] = protoBBox.xmin(); |
| 419 | min[1] = protoBBox.ymin(); |
| 420 | max[0] = protoBBox.xmax(); |
| 421 | max[1] = protoBBox.ymax(); |
| 422 | if (protoBBox.has_zmin() && protoBBox.has_zmax()) { |
| 423 | min[2] = protoBBox.zmin(); |
| 424 | max[2] = protoBBox.zmax(); |
| 425 | } |
| 426 | if (protoBBox.has_mmin() && protoBBox.has_mmax()) { |
| 427 | min[3] = protoBBox.mmin(); |
| 428 | max[3] = protoBBox.mmax(); |
| 429 | } |
| 430 | } |
| 431 | bounder_.mergeBox(geospatial::BoundingBox(min, max)); |
| 432 | std::vector<int32_t> types = {stats.geospatial_types().begin(), |
| 433 | stats.geospatial_types().end()}; |
| 434 | bounder_.mergeGeometryTypes(types); |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | std::unique_ptr<MutableColumnStatistics> createColumnStatistics(const Type& type) { |
| 439 | switch (static_cast<int64_t>(type.getKind())) { |
nothing calls this directly
no test coverage detected