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

Method initialize

filters/FerryFilter.cpp:61–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61void FerryFilter::initialize()
62{
63 std::vector<std::string> toNames;
64 for (auto& dim : m_dimSpec)
65 {
66 StringList s = Utils::split(dim, '=');
67 if (s.size() != 2)
68 throwError("Invalid dimension specified '" + dim + "'. Need "
69 "<from dimension>=><to dimension>. See documentation for "
70 "details.");
71 // Allow new '=>' syntax
72 if (s[1][0] == '>')
73 s[1].erase(s[1].begin());
74
75 Utils::trim(s[0]);
76 Utils::trim(s[1]);
77 if (s[0] == s[1])
78 throwError("Can't ferry dimension '" + s[0] + "' to itself.");
79 if (Utils::contains(toNames, s[1]))
80 throwError("Can't ferry two source dimensions to the same "
81 "destination dimension.");
82 toNames.push_back(s[1]);
83 m_dims.emplace_back(s[0], s[1]);
84 }
85}
86
87
88void FerryFilter::addDimensions(PointLayoutPtr layout)

Callers

nothing calls this directly

Calls 6

splitFunction · 0.85
trimFunction · 0.85
containsFunction · 0.50
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected