Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Aug 4, 2016
2 parents b318f94 + b2c65fc commit 4750fc0
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 20 deletions.
12 changes: 6 additions & 6 deletions cmake/examples/hobu-config.sh
Expand Up @@ -2,7 +2,7 @@ USR_LOCAL="/usr/local"
USR="/usr"
TIFF_HOME=$USR_LOCAL
LASZIP_HOME=$USR_LOCAL
LIBXML2_HOME=/usr/local/Cellar/libxml2/2.9.2/
LIBXML2_HOME=/usr/local/Cellar/libxml2/2.9.4/
WEBSOCKETPP_HOME=/Users/hobu/dev/git/websocketpp
GEOTIFF_HOME=$USR_LOCAL
P2G_HOME=$USR_LOCAL
Expand All @@ -16,7 +16,7 @@ ORACLE_HOME=$HOME/oracle
LAZPERF_HOME=$USR_LOCAL
export ORACLE_HOME
CONFIG="Unix Makefiles"
#CONFIG="Ninja"
#CONFIG="Ninja" /usr/local/Cellar/hdf5/1.8.16_1/

if ! [ -z "$1" ]; then
CONFIG="$1"
Expand All @@ -34,11 +34,11 @@ CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DBUILD_PLUGIN_NITF=ON \
-DBUILD_PLUGIN_P2G=ON \
-DBUILD_PLUGIN_PYTHON=ON \
-DBUILD_PLUGIN_MRSID=ON \
-DBUILD_PLUGIN_MRSID=OFF \
-DBUILD_PLUGIN_CPD=ON \
-DBUILD_PLUGIN_ICEBRIDGE=ON \
-DBUILD_PLUGIN_PCL=ON \
-DBUILD_PLUGIN_GREYHOUND=OFF \
-DBUILD_PLUGIN_GREYHOUND=ON \
-DWITH_LAZPERF=ON \
-DMRSID_INCLUDE_DIR=/Users/hobu/dev/release/mrsid/Lidar_DSDK/include \
-DMRSID_LIBRARY=/Users/hobu/dev/release/mrsid/Lidar_DSDK/lib/liblti_lidar_dsdk.dylib \
Expand All @@ -56,8 +56,8 @@ CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DSQLITE3_INCLUDE_DIR=${SQLITE_HOME}/include \
-DSQLITE3_LIBRARY=${SQLITE_HOME}/lib/libsqlite3.${SO_EXT} \
-DPYTHON_EXECUTABLE=/usr/local/bin/python3 \
-DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m/ \
-DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/include/python3.5m/ \
-DOCI_CONNECTION="grid/grid@localhost/vm" \
-DPGPOINTCLOUD_TEST_DB_HOST="localhost"

Expand Down
1 change: 1 addition & 0 deletions include/pdal/Kernel.hpp
Expand Up @@ -101,6 +101,7 @@ class PDAL_DLL Kernel
bool m_usestdin;
Log m_log;
PipelineManager m_manager;
std::string m_driverOverride;

private:
int innerRun(ProgramArgs& args);
Expand Down
2 changes: 1 addition & 1 deletion kernels/delta/DeltaKernel.cpp
Expand Up @@ -72,7 +72,7 @@ void DeltaKernel::addSwitches(ProgramArgs& args)
PointViewPtr DeltaKernel::loadSet(const std::string& filename,
PointTable& table)
{
Stage& reader = makeReader(filename, "");
Stage& reader = makeReader(filename, m_driverOverride);
reader.prepare(table);
PointViewSet viewSet = reader.execute(table);
assert(viewSet.size() == 1);
Expand Down
4 changes: 2 additions & 2 deletions kernels/diff/DiffKernel.cpp
Expand Up @@ -107,15 +107,15 @@ int DiffKernel::execute()
{
PointTable sourceTable;

Stage& source = makeReader(m_sourceFile, "");
Stage& source = makeReader(m_sourceFile, m_driverOverride);
source.prepare(sourceTable);
PointViewSet sourceSet = source.execute(sourceTable);

MetadataNode errors;

PointTable candidateTable;

Stage& candidate = makeReader(m_candidateFile, "");
Stage& candidate = makeReader(m_candidateFile, m_driverOverride);
candidate.prepare(candidateTable);
PointViewSet candidateSet = candidate.execute(candidateTable);

Expand Down
2 changes: 1 addition & 1 deletion kernels/info/InfoKernel.cpp
Expand Up @@ -272,7 +272,7 @@ void InfoKernel::makePipeline(const std::string& filename, bool noPoints)
}
else
{
Stage& reader = m_manager.makeReader(filename, "");
Stage& reader = m_manager.makeReader(filename, m_driverOverride);
if (noPoints)
{
Options ops({"count", 0});
Expand Down
2 changes: 1 addition & 1 deletion kernels/merge/MergeKernel.cpp
Expand Up @@ -77,7 +77,7 @@ int MergeKernel::execute()

for (size_t i = 0; i < m_files.size(); ++i)
{
Stage& reader = makeReader(m_files[i], "");
Stage& reader = makeReader(m_files[i], m_driverOverride);
filter.setInput(reader);
}

Expand Down
2 changes: 1 addition & 1 deletion kernels/sort/SortKernel.cpp
Expand Up @@ -72,7 +72,7 @@ void SortKernel::addSwitches(ProgramArgs& args)

int SortKernel::execute()
{
Stage& readerStage = makeReader(m_inputFile, "");
Stage& readerStage = makeReader(m_inputFile, m_driverOverride);

// go ahead and prepare/execute on reader stage only to grab input
// PointViewSet, this makes the input PointView available to both the
Expand Down
2 changes: 1 addition & 1 deletion kernels/split/SplitKernel.cpp
Expand Up @@ -102,7 +102,7 @@ int SplitKernel::execute()
{
PointTable table;

Stage& reader = makeReader(m_inputFile, "");
Stage& reader = makeReader(m_inputFile, m_driverOverride);

Options filterOpts;
std::string driver = (m_length ? "filters.splitter" : "filters.chipper");
Expand Down
2 changes: 1 addition & 1 deletion kernels/tindex/TIndexKernel.cpp
Expand Up @@ -365,7 +365,7 @@ void TIndexKernel::mergeFile()
Stage& merge = makeFilter("filters.merge");
for (auto f : files)
{
Stage& reader = makeReader(f.m_filename, "");
Stage& reader = makeReader(f.m_filename, m_driverOverride);
Stage *premerge = &reader;

if (m_tgtSrsString != f.m_srs)
Expand Down
2 changes: 2 additions & 0 deletions src/Kernel.cpp
Expand Up @@ -130,6 +130,7 @@ Kernel::Kernel()
, m_hardCoreDebug(false)
, m_reportDebug(false)
, m_visualize(false)
, m_driverOverride("")
{}


Expand Down Expand Up @@ -471,6 +472,7 @@ void Kernel::addBasicSwitches(ProgramArgs& args)

args.add("visualize", "Visualize result", m_visualize);
args.add("stdin,s", "Read pipeline JSON from stdin", m_usestdin);
args.add("driver", "Override reader driver", m_driverOverride, "");
args.add("scale",
"A comma-separated or quoted, space-separated list of scales to "
"set on the output file: \n--scale 0.1,0.1,0.00001\n--scale \""
Expand Down
22 changes: 16 additions & 6 deletions src/SpatialReference.cpp
Expand Up @@ -206,9 +206,13 @@ std::string SpatialReference::getVerticalUnits() const
if (node)
{
char* units(0);

// The returned value remains internal to the OGRSpatialReference and should not
// be freed, or modified. It may be invalidated on the next
// OGRSpatialReference call.

double u = poSRS->GetLinearUnits(&units);
tmp = units;
CPLFree(units);

Utils::trim(tmp);

Expand Down Expand Up @@ -246,15 +250,21 @@ std::string SpatialReference::getHorizontalUnits() const

std::string wkt = getWKT(eHorizontalOnly);
const char* poWKT = wkt.c_str();
OGRSpatialReference srs(NULL);
if (OGRERR_NONE == srs.importFromWkt(const_cast<char **>(&poWKT)))
OGRSpatialReference* poSRS =
(OGRSpatialReference*)OSRNewSpatialReference(m_wkt.c_str());
if (poSRS)
{
char* units(0);
double u = srs.GetLinearUnits(&units);

// The returned value remains internal to the OGRSpatialReference and should not
// be freed, or modified. It may be invalidated on the next
// OGRSpatialReference call.

double u = poSRS->GetLinearUnits(&units);
tmp = units;
CPLFree(units);

Utils::trim(tmp);

}

return tmp;
Expand Down Expand Up @@ -464,7 +474,7 @@ MetadataNode SpatialReference::toMetadata() const

MetadataNode units = root.add("units");
units.add("vertical", getVerticalUnits());
units.add("horizontal", getVerticalUnits());
units.add("horizontal", getHorizontalUnits());

return root;
}
Expand Down

0 comments on commit 4750fc0

Please sign in to comment.