Skip to content

Commit e870d64

Browse files
authored
Pass nosrs to las reader to prevent crashing on some incorrectly set global encoding WKT flag (hobuinc#164)
* Added options passthrough for readers.las.nosrs * Also specify nosrs to the FileProcessor * Make no_srs only applicable to las readers
1 parent 2f29863 commit e870d64

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ Options
6161
- a_srs
6262

6363
Assign an output SRS. Example `--a_srs EPSG:2056`
64-
64+
65+
- no_srs
66+
67+
Don't read the SLR VLRs. This is only applicable to las files. [Default: false]
68+
6569
- dims
6670

6771
List of dimensions to load. X, Y and Z are always loaded. Limiting the dimensions can

epf/Epf.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,14 @@ void Epf::createFileInfos(const StringList& input, std::vector<FileInfo>& fileIn
285285

286286
pdal::Options opts;
287287
opts.add("filename", filename);
288+
if (driver == "readers.las")
289+
opts.add("nosrs", m_b.opts.no_srs);
288290
s->setOptions(opts);
289291

290292
FileInfo fi;
291293
fi.filename = filename;
292294
fi.driver = driver;
295+
fi.no_srs = m_b.opts.no_srs;
293296
if (driver == "readers.las")
294297
{
295298
const std::vector<FileInfo>& infos = processLas(*dynamic_cast<LasReader *>(s), fi);

epf/EpfTypes.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct FileInfo
4848

4949
std::string filename;
5050
std::string driver;
51+
bool no_srs;
5152
DimInfoList dimInfo;
5253
uint64_t numPoints;
5354
uint64_t start;

epf/FileProcessor.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ void FileProcessor::run()
133133
pdal::Options opts;
134134
opts.add("filename", m_fi.filename);
135135
opts.add("count", m_fi.numPoints);
136+
if (m_fi.driver == "readers.las")
137+
opts.add("nosrs", m_fi.no_srs);
136138
#ifdef PDAL_LAS_START
137139
if (m_fi.driver == "readers.las")
138140
opts.add("start", m_fi.start);

untwine/Common.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct Options
4949
StringList dimNames;
5050
bool stats;
5151
std::string a_srs;
52+
bool no_srs;
5253
bool metadata;
5354
bool dummy;
5455
};

untwine/Untwine.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ void addArgs(pdal::ProgramArgs& programArgs, Options& options, pdal::Arg * &temp
4949
options.a_srs, "");
5050
programArgs.add("metadata", "Write PDAL metadata to VLR output",
5151
options.metadata, false);
52+
programArgs.add("no_srs", "PDAL readers.las.nosrs passthrough.",
53+
options.no_srs, false);
5254
}
5355

5456
bool handleOptions(pdal::StringList& arglist, Options& options)

0 commit comments

Comments
 (0)