Skip to content

Commit

Permalink
Allow the names of LAS extra dims to be fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jan 5, 2021
1 parent d59be9b commit 366cbd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions io/LasReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void LasReader::addArgs(ProgramArgs& args)
args.add("use_eb_vlr", "Use extra bytes VLR for 1.0 - 1.3 files",
m_useEbVlr);
args.add("ignore_vlr", "VLR userid/recordid to ignore", m_ignoreVLROption);
args.add("fix_dims", "Make invalid dimension names valid by changing "
"invalid characters to '_'", m_fixNames, true);
}


Expand Down Expand Up @@ -584,6 +586,8 @@ void LasReader::addDimensions(PointLayoutPtr layout)
continue;
if (dim.m_dimType.m_xform.nonstandard())
type = Dimension::Type::Double;
if (m_fixNames)
dim.m_name = Dimension::fixName(dim.m_name);
dim.m_dimType.m_id = layout->registerOrAssignDim(dim.m_name, type);
}
}
Expand Down
1 change: 1 addition & 0 deletions io/LasReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class PDAL_DLL LasReader : public Reader, public Streamable
std::string m_compression;
StringList m_ignoreVLROption;
bool m_useEbVlr;
bool m_fixNames;

virtual void addArgs(ProgramArgs& args);
virtual void initialize(PointTableRef table)
Expand Down

0 comments on commit 366cbd1

Please sign in to comment.