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

Function fromString

io/LasReader.cpp:85–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84template<>
85StatusWithReason fromString(const std::string& from,
86 SrsOrderSpec& srsOrder)
87{
88 using namespace las;
89
90 static const std::map<std::string, SrsType> typemap =
91 { { "wkt2", SrsType::Wkt2 },
92 { "wkt1", SrsType::Wkt1 },
93 { "projjson", SrsType::Proj },
94 { "geotiff", SrsType::Geotiff } };
95
96 StringList srsTypes = Utils::split2(from, ',');
97 std::transform(srsTypes.cbegin(), srsTypes.cend(), srsTypes.begin(),
98 [](std::string s){ Utils::trim(s); return Utils::tolower(s); });
99
100 for (std::string& stype : srsTypes)
101 {
102 auto it = typemap.find(stype);
103 if (it == typemap.end())
104 return { -1, "Invalid SRS type '" + stype + "'. Must be one of 'wkt1', "
105 "'geotiff', 'wkt' or 'projjson'." };
106 SrsType type = it->second;
107 if (Utils::contains(srsOrder.types, type))
108 return { -1,
109 "Duplicate SRS type '" + stype + "' in 'vlr_srs_order'" };
110 srsOrder.types.push_back(type);
111 }
112 return true;
113}
114
115template<>
116std::string toString(const SrsOrderSpec& srsOrder)

Callers 15

readV3Method · 0.70
readFaceMethod · 0.70
initializeMethod · 0.70
readMethod · 0.70
initializeMethod · 0.70
convertFunction · 0.70
BpfWriter.cppFile · 0.70
processOneMethod · 0.70
processOneMethod · 0.70
readHeaderMethod · 0.70
readMethod · 0.70
TESTFunction · 0.50

Calls 7

transformFunction · 0.85
trimFunction · 0.85
tolowerFunction · 0.85
containsFunction · 0.50
beginMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by 6

TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40