Skip to content

Commit

Permalink
Set the VLR offsets to 0 if there are no offsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Feb 9, 2021
1 parent e72c662 commit 60428ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io/LasWriter.cpp
Expand Up @@ -343,7 +343,7 @@ void LasWriter::prepOutput(std::ostream *outStream, const SpatialReference& srs)
OLeStream out(m_ostream);
out << m_lasHeader;

m_lasHeader.setVlrOffset((uint32_t)m_ostream->tellp());
m_lasHeader.setVlrOffset(m_vlrs.size() ? (uint32_t)m_ostream->tellp() : 0);

for (auto vi = m_vlrs.begin(); vi != m_vlrs.end(); ++vi)
{
Expand Down Expand Up @@ -1169,7 +1169,7 @@ void LasWriter::finishOutput()
OLeStream out(m_ostream);

// addVlr prevents any eVlrs from being added before version 1.4.
m_lasHeader.setEVlrOffset((uint32_t)m_ostream->tellp());
m_lasHeader.setEVlrOffset(m_eVlrs.size() ? (uint32_t)m_ostream->tellp() : 0);
for (auto vi = m_eVlrs.begin(); vi != m_eVlrs.end(); ++vi)
{
ExtLasVLR evlr = *vi;
Expand Down

0 comments on commit 60428ad

Please sign in to comment.