Skip to content

Commit

Permalink
fix build for MrSiD SDK #2460 (#2478)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Apr 29, 2019
1 parent 6c0ff27 commit 71c61db
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions plugins/mrsid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (MRSID_FOUND)
${MRSID_LIBRARY}
INCLUDES
${PDAL_IO_DIR}
${NLOHMANN_INCLUDE_DIR}
${MRSID_INCLUDE_DIR}
)
target_compile_definitions(${reader_libname} PRIVATE -DHAVE_MRSID=1)
Expand All @@ -24,6 +25,9 @@ if (MRSID_FOUND)
${reader_libname}
INCLUDES
${PDAL_IO_DIR}
${NLOHMANN_INCLUDE_DIR}
${MRSID_INCLUDE_DIR}

)
endif()
else()
Expand Down
32 changes: 31 additions & 1 deletion plugins/mrsid/io/MrsidReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,16 @@ void MrsidReader::LayoutToPointInfo(const PointLayout &layout, LizardTech::Point
if (Utils::iequals(name, "Classification")) name = CHANNEL_NAME_ClassId;
if (Utils::iequals(name, "ScanAngleRank")) name = CHANNEL_NAME_ScanAngle;
if (Utils::iequals(name, "ScanDirectionFlag")) name = CHANNEL_NAME_ScanDir;
#ifdef CHANNEL_NAME_GPSTime
if (Utils::iequals(name, "GpsTime")) name = CHANNEL_NAME_GPSTime;
#endif
#ifdef CHANNEL_NAME_GPSTime_Week
if (Utils::iequals(name, "GpsTime")) name = CHANNEL_NAME_GPSTime_Week;
#endif
#ifdef CHANNEL_NAME_GPSTime_Adjusted
//FIXME: We should account for header metadata if we have it
if (Utils::iequals(name, "GpsTime")) name = CHANNEL_NAME_GPSTime_Adjusted;
#endif
if (Utils::iequals(name, "PointSourceId")) name = CHANNEL_NAME_SourceId;
if (Utils::iequals(name, "ReturnNumber")) name = CHANNEL_NAME_ReturnNum;
if (Utils::iequals(name, "NumberOfReturns")) name = CHANNEL_NAME_NumReturns;
Expand Down Expand Up @@ -307,13 +316,34 @@ point_count_t MrsidReader::read(PointViewPtr view, point_count_t count)
pointIndex,
getData<int32_t>(points, CHANNEL_NAME_Z, pointIndex));
}
} else if (Utils::iequals(name, "GpsTime") &&
}
#ifdef CHANNEL_NAME_GPSTime
else if (Utils::iequals(name, "GpsTime") &&
m_pointInfo.hasChannel(CHANNEL_NAME_GPSTime))
{
view->setField<double>( d,
pointIndex,
getData<double>(points, CHANNEL_NAME_GPSTime, pointIndex));
}
#endif
#ifdef CHANNEL_NAME_GPSTime_Week
else if (Utils::iequals(name, "GpsTime") &&
m_pointInfo.hasChannel(CHANNEL_NAME_GPSTime_Week))
{
view->setField<double>( d,
pointIndex,
getData<double>(points, CHANNEL_NAME_GPSTime_Week, pointIndex));
}
#endif
#ifdef CHANNEL_NAME_GPSTime_Adjusted
else if (Utils::iequals(name, "GpsTime") &&
m_pointInfo.hasChannel(CHANNEL_NAME_GPSTime_Week))
{
view->setField<double>( d,
pointIndex,
getData<double>(points, CHANNEL_NAME_GPSTime_Adjusted, pointIndex));
}
#endif
else if (Utils::iequals(name, "Intensity") &&
m_pointInfo.hasChannel(CHANNEL_NAME_Intensity))
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/mrsid/io/MrsidReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#pragma once

#include <pdal/Reader.hpp>
#include <pdal/util/Bounds.hpp>
#include <pdal/util/Box.hpp>

#include <lidar/PointSource.h>
#include <lidar/PointData.h>
Expand Down

0 comments on commit 71c61db

Please sign in to comment.