diff --git a/io/LasReader.cpp b/io/LasReader.cpp index 406e78892b..02659d652a 100644 --- a/io/LasReader.cpp +++ b/io/LasReader.cpp @@ -159,7 +159,7 @@ void LasReader::initializeLocal(PointTableRef table, MetadataNode& m) { try { - m_extraDims = LasUtils::parse(m_extraDimSpec); + m_extraDims = LasUtils::parse(m_extraDimSpec, false); } catch (const LasUtils::error& err) { diff --git a/io/LasUtils.cpp b/io/LasUtils.cpp index a6515abbae..12d7b8995a 100644 --- a/io/LasUtils.cpp +++ b/io/LasUtils.cpp @@ -212,7 +212,7 @@ std::vector parseIgnoreVLRs(const StringList& ignored) return ignoredVLRs; } -std::vector parse(const StringList& dimString) +std::vector parse(const StringList& dimString, bool allOk) { std::vector extraDims; bool all = false; @@ -221,6 +221,11 @@ std::vector parse(const StringList& dimString) { if (dim == "all") { + // We only accept all for LasWriter. + if (!allOk) + throw error("Invalid extra dimension specified: '" + dim + + "'. Need =. See documentation " + " for details."); all = true; continue; } diff --git a/io/LasUtils.hpp b/io/LasUtils.hpp index b87b546127..0c13b33c1b 100644 --- a/io/LasUtils.hpp +++ b/io/LasUtils.hpp @@ -171,7 +171,7 @@ struct error : public std::runtime_error {} }; -std::vector parse(const StringList& dimString); +std::vector parse(const StringList& dimString, bool allOk); struct IgnoreVLR diff --git a/io/LasWriter.cpp b/io/LasWriter.cpp index 4254634a30..bc287d3165 100644 --- a/io/LasWriter.cpp +++ b/io/LasWriter.cpp @@ -152,7 +152,7 @@ void LasWriter::initialize() #endif try { - m_extraDims = LasUtils::parse(m_extraDimSpec); + m_extraDims = LasUtils::parse(m_extraDimSpec, true); } catch (const LasUtils::error& err) {