MCPcopy Create free account
hub / github.com/PDAL/PDAL / addDimensions

Method addDimensions

plugins/arrow/io/ArrowReader.cpp:386–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384
385
386void 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
427point_count_t ArrowReader::read(PointViewPtr view, point_count_t num)

Callers

nothing calls this directly

Calls 8

iequalsFunction · 0.85
pdalTypeFunction · 0.85
registerDimMethod · 0.80
registerOrAssignDimMethod · 0.80
nameMethod · 0.45
typeMethod · 0.45
idMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected