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

Method prepared

plugins/arrow/io/ArrowWriter.cpp:334–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334void ArrowWriter::prepared(PointTableRef table)
335{
336 using namespace Dimension;
337
338 // Eliminate worries about copying arrow classes.
339 m_dimHandlers.reserve(table.layout()->dims().size());
340
341 //Always do XYZ.
342 std::string pipelineMetadata;
343 if (m_writePipelineMetadata)
344 pipelineMetadata = Utils::toJSON(table.metadata());
345 m_dimHandlers.push_back(std::make_unique<XyzHandler>(m_pool, m_geoArrowDimensionName,
346 pipelineMetadata));
347 if (m_formatType == arrowsupport::Parquet)
348 m_dimHandlers.push_back(std::make_unique<WkbHandler>(m_pool));
349 for (Id id : table.layout()->dims())
350 {
351 // Aready taken care of.
352 if (id == Id::X || id == Id::Y || id == Id::Z)
353 continue;
354 std::string name = table.layout()->dimName(id);
355 switch (table.layout()->dimType(id))
356 {
357 case Type::Unsigned8:
358 m_dimHandlers.push_back(std::make_unique<DimHandler<uint8_t>>(m_pool, id, name));
359 break;
360 case Type::Unsigned16:
361 m_dimHandlers.push_back(std::make_unique<DimHandler<uint16_t>>(m_pool, id, name));
362 break;
363 case Type::Unsigned32:
364 m_dimHandlers.push_back(std::make_unique<DimHandler<uint32_t>>(m_pool, id, name));
365 break;
366 case Type::Unsigned64:
367 m_dimHandlers.push_back(std::make_unique<DimHandler<uint64_t>>(m_pool, id, name));
368 break;
369 case Type::Signed8:
370 m_dimHandlers.push_back(std::make_unique<DimHandler<int8_t>>(m_pool, id, name));
371 break;
372 case Type::Signed16:
373 m_dimHandlers.push_back(std::make_unique<DimHandler<int16_t>>(m_pool, id, name));
374 break;
375 case Type::Signed32:
376 m_dimHandlers.push_back(std::make_unique<DimHandler<int32_t>>(m_pool, id, name));
377 break;
378 case Type::Signed64:
379 m_dimHandlers.push_back(std::make_unique<DimHandler<int64_t>>(m_pool, id, name));
380 break;
381 case Type::Float:
382 m_dimHandlers.push_back(std::make_unique<DimHandler<float>>(m_pool, id, name));
383 break;
384 case Type::Double:
385 m_dimHandlers.push_back(std::make_unique<DimHandler<double>>(m_pool, id, name));
386 break;
387 default:
388 throwError("Invalid type found for dimension '" + name + "'.");
389 }
390 }
391}

Callers

nothing calls this directly

Calls 4

toJSONFunction · 0.85
dimNameMethod · 0.80
sizeMethod · 0.45
dimTypeMethod · 0.45

Tested by

no test coverage detected