| 384 | |
| 385 | |
| 386 | void ArrowReader::addDimensions(PointLayoutPtr layout) |
| 387 | { |
| 388 | using namespace Dimension; |
| 389 | Dimension::IdList ids; |
| 390 | |
| 391 | // We take the schema of the first batch. If the rest of the |
| 392 | // batches don't match the schema, we're f'd |
| 393 | |
| 394 | std::shared_ptr<arrow::Schema> schema = m_currentBatch->schema(); |
| 395 | int fieldPosition(0); |
| 396 | for(auto& f: schema->fields()) |
| 397 | { |
| 398 | std::string name = f->name(); |
| 399 | auto& dt = f->type(); |
| 400 | arrow::Type::type t = dt->id(); |
| 401 | |
| 402 | if ((t == arrow::Type::FIXED_SIZE_LIST) || (t == arrow::Type::BINARY)) |
| 403 | { |
| 404 | if (Utils::iequals(name, m_geoArrowDimName)) |
| 405 | { |
| 406 | layout->registerDim(pdal::Dimension::Id::X); |
| 407 | layout->registerDim(pdal::Dimension::Id::Y); |
| 408 | layout->registerDim(pdal::Dimension::Id::Z); |
| 409 | } |
| 410 | |
| 411 | } |
| 412 | |
| 413 | pdal::Dimension::Type pt = pdalType(t); |
| 414 | |
| 415 | // If we're not a known Type, we're not adding the dimension to the |
| 416 | // layout |
| 417 | if (pt != pdal::Dimension::Type::None) |
| 418 | { |
| 419 | pdal::Dimension::Id id = layout->registerOrAssignDim(name, pt); |
| 420 | m_arrayIds.insert({fieldPosition, id}); |
| 421 | } |
| 422 | fieldPosition++; |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | |
| 427 | point_count_t ArrowReader::read(PointViewPtr view, point_count_t num) |
nothing calls this directly
no test coverage detected