Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass nosrs to las reader to prevent crashing on some incorrectly set global encoding WKT flag #164

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ Options
- a_srs

Assign an output SRS. Example `--a_srs EPSG:2056`


- no_srs

Don't read the SLR VLRs. This is only applicable to las files. [Default: false]

- dims

List of dimensions to load. X, Y and Z are always loaded. Limiting the dimensions can
Expand Down
3 changes: 3 additions & 0 deletions epf/Epf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,14 @@ void Epf::createFileInfos(const StringList& input, std::vector<FileInfo>& fileIn

pdal::Options opts;
opts.add("filename", filename);
if (driver == "readers.las")
opts.add("nosrs", m_b.opts.no_srs);
s->setOptions(opts);

FileInfo fi;
fi.filename = filename;
fi.driver = driver;
fi.no_srs = m_b.opts.no_srs;
if (driver == "readers.las")
{
const std::vector<FileInfo>& infos = processLas(*dynamic_cast<LasReader *>(s), fi);
Expand Down
1 change: 1 addition & 0 deletions epf/EpfTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct FileInfo

std::string filename;
std::string driver;
bool no_srs;
DimInfoList dimInfo;
uint64_t numPoints;
uint64_t start;
Expand Down
2 changes: 2 additions & 0 deletions epf/FileProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ void FileProcessor::run()
pdal::Options opts;
opts.add("filename", m_fi.filename);
opts.add("count", m_fi.numPoints);
if (m_fi.driver == "readers.las")
opts.add("nosrs", m_fi.no_srs);
#ifdef PDAL_LAS_START
if (m_fi.driver == "readers.las")
opts.add("start", m_fi.start);
Expand Down
1 change: 1 addition & 0 deletions untwine/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct Options
StringList dimNames;
bool stats;
std::string a_srs;
bool no_srs;
bool metadata;
bool dummy;
};
Expand Down
2 changes: 2 additions & 0 deletions untwine/Untwine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ void addArgs(pdal::ProgramArgs& programArgs, Options& options, pdal::Arg * &temp
options.a_srs, "");
programArgs.add("metadata", "Write PDAL metadata to VLR output",
options.metadata, false);
programArgs.add("no_srs", "PDAL readers.las.nosrs passthrough.",
options.no_srs, false);
}

bool handleOptions(pdal::StringList& arglist, Options& options)
Expand Down
Loading