Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PDAL/PDAL
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Sep 29, 2017
2 parents 43d3c54 + 4215e7b commit c5058f9
Show file tree
Hide file tree
Showing 331 changed files with 62,715 additions and 15,659 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ test/data/local
#
.DS_Store

_build
build
/_build*
/build*
/*local*.bat
/*local*.sh
Makefile
doc/build
bin/
Expand Down
23 changes: 6 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
# .travis.yml
# Configure Travis CI service for http://github.com/PDAL
language: cpp

sudo: required

sudo:
required
services: docker

services:
docker

compiler:
- gcc

env:
- PDAL_OPTIONAL_COMPONENTS=all
- PDAL_OPTIONAL_COMPONENTS=none


before_install: ./scripts/ci/before_install.sh
before_install:
- docker pull alpine:edge

script:
docker run -v $TRAVIS_BUILD_DIR:/pdal -e CXX="$CXX" -e CC="$CC" -e PDAL_OPTIONAL_COMPONENTS="$PDAL_OPTIONAL_COMPONENTS" -t pdal/dependencies:latest /bin/sh -c "/pdal/scripts/ci/script.sh"
- docker run -v $TRAVIS_BUILD_DIR:/pdal -t alpine:edge /bin/sh -c "/pdal/scripts/ci/script.sh"

after_success:
- echo "secure travis:" "$TRAVIS_SECURE_ENV_VARS"
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "1.5-maintenance" -a "$PDAL_OPTIONAL_COMPONENTS" = "all"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/add_deploy_key.sh; ./scripts/ci/deploy_website.sh $TRAVIS_BUILD_DIR/doc/build /tmp; fi'
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "1.5-maintenance"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/add_deploy_key.sh; ./scripts/ci/deploy_website.sh $TRAVIS_BUILD_DIR/doc/build /tmp; fi'

notifications:
on_success: always
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if (NOT PDAL_HAVE_JSONCPP)
add_subdirectory(vendor/jsoncpp/dist)
endif()
add_subdirectory(pdal/util)
#add_subdirectory(tools)
add_subdirectory(tools)
add_subdirectory(apps)

#
Expand Down
2 changes: 1 addition & 1 deletion doc/stages/filters.cpd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Examples
"fixed.las",
"moving.las",
{
"type": "filters.rigid",
"type": "filters.cpd",
"method": "rigid"
},
"output.las"
Expand Down
2 changes: 1 addition & 1 deletion doc/stages/readers.text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Example Pipeline
{
"pipeline":[
{
"type":"readers.qfit",
"type":"readers.text",
"filename":"inputfile.txt"
},
{
Expand Down
4 changes: 2 additions & 2 deletions filters/AssignFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ void AssignRange::parse(const std::string& r)
char *end;

pos = subParse(r);
count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;

if (r[pos] != '=')
throw error("Missing '=' assignment separator.");
pos++;

count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;

// Extract value
Expand Down
8 changes: 4 additions & 4 deletions filters/ColorizationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ColorizationFilter::BandInfo parseDim(const std::string& dim,

pos = 0;
// Skip leading whitespace.
count = Utils::extract(dim, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(dim, pos);
pos += count;

count = Dimension::extractName(dim, pos);
Expand All @@ -79,7 +79,7 @@ ColorizationFilter::BandInfo parseDim(const std::string& dim,
name = dim.substr(pos, count);
pos += count;

count = Utils::extract(dim, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(dim, pos);
pos += count;

if (pos < dim.size() && dim[pos] == ':')
Expand All @@ -91,7 +91,7 @@ ColorizationFilter::BandInfo parseDim(const std::string& dim,
band = defaultBand;
pos += (end - start);

count = Utils::extract(dim, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(dim, pos);
pos += count;

if (pos < dim.size() && dim[pos] == ':')
Expand All @@ -105,7 +105,7 @@ ColorizationFilter::BandInfo parseDim(const std::string& dim,
}
}

count = Utils::extract(dim, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(dim, pos);
pos += count;

if (pos != dim.size())
Expand Down
8 changes: 4 additions & 4 deletions filters/private/DimRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ std::string::size_type DimRange::subParse(const std::string& r)
negate = false;
pos = 0;
// Skip leading whitespace.
count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;

count = Dimension::extractName(r, pos);
Expand Down Expand Up @@ -85,7 +85,7 @@ std::string::size_type DimRange::subParse(const std::string& r)
lb = std::numeric_limits<double>::lowest();
pos += (end - start);

count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;

if (r[pos] != ':')
Expand All @@ -98,7 +98,7 @@ std::string::size_type DimRange::subParse(const std::string& r)
ub = std::numeric_limits<double>::max();
pos += (end - start);

count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;

if (r[pos] == ')')
Expand All @@ -107,7 +107,7 @@ std::string::size_type DimRange::subParse(const std::string& r)
throw error("Missing ')' or ']'.");
pos++;

count = Utils::extract(r, pos, (int(*)(int))std::isspace);
count = Utils::extractSpaces(r, pos);
pos += count;
return pos;
}
Expand Down
20 changes: 10 additions & 10 deletions io/LasReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,11 @@ void LasReader::loadPointV10(PointRef& point, laszip_point& p)
double y = p.Y * h.scaleY() + h.offsetY();
double z = p.Z * h.scaleZ() + h.offsetZ();

if (p.return_number == 0 || p.return_number > 5)
m_error.returnNumWarning(p.return_number);

if (p.number_of_returns == 0 || p.number_of_returns > 5)
m_error.numReturnsWarning(p.number_of_returns);
// if (p.return_number == 0 || p.return_number > 5)
// m_error.returnNumWarning(p.return_number);
//
// if (p.number_of_returns == 0 || p.number_of_returns > 5)
// m_error.numReturnsWarning(p.number_of_returns);

point.setField(Dimension::Id::X, x);
point.setField(Dimension::Id::Y, y);
Expand Down Expand Up @@ -753,11 +753,11 @@ void LasReader::loadPointV10(PointRef& point, char *buf, size_t bufsize)
uint8_t scanDirFlag = (flags >> 6) & 0x01;
uint8_t flight = (flags >> 7) & 0x01;

if (returnNum == 0 || returnNum > 5)
m_error.returnNumWarning(returnNum);

if (numReturns == 0 || numReturns > 5)
m_error.numReturnsWarning(numReturns);
// if (returnNum == 0 || returnNum > 5)
// m_error.returnNumWarning(returnNum);
//
// if (numReturns == 0 || numReturns > 5)
// m_error.numReturnsWarning(numReturns);

point.setField(Dimension::Id::X, x);
point.setField(Dimension::Id::Y, y);
Expand Down
24 changes: 12 additions & 12 deletions io/LasWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,13 +805,13 @@ bool LasWriter::writeLasZipBuf(PointRef& point)
if (point.hasDim(Id::ReturnNumber))
{
returnNumber = point.getFieldAs<uint8_t>(Id::ReturnNumber);
if (returnNumber < 1 || returnNumber > maxReturnCount)
m_error.returnNumWarning(returnNumber);
// if (returnNumber < 1 || returnNumber > maxReturnCount)
// m_error.returnNumWarning(returnNumber);
}
if (point.hasDim(Id::NumberOfReturns))
numberOfReturns = point.getFieldAs<uint8_t>(Id::NumberOfReturns);
if (numberOfReturns == 0)
m_error.numReturnsWarning(0);
// if (numberOfReturns == 0)
// m_error.numReturnsWarning(0);
if (numberOfReturns > maxReturnCount)
{
if (m_discardHighReturnNumbers)
Expand All @@ -821,8 +821,8 @@ bool LasWriter::writeLasZipBuf(PointRef& point)
return false;
numberOfReturns = maxReturnCount;
}
else
m_error.numReturnsWarning(numberOfReturns);
// else
// m_error.numReturnsWarning(numberOfReturns);
}

auto converter = [this](double d, Dimension::Id dim) -> int32_t
Expand Down Expand Up @@ -942,13 +942,13 @@ bool LasWriter::fillPointBuf(PointRef& point, LeInserter& ostream)
if (point.hasDim(Id::ReturnNumber))
{
returnNumber = point.getFieldAs<uint8_t>(Id::ReturnNumber);
if (returnNumber < 1 || returnNumber > maxReturnCount)
m_error.returnNumWarning(returnNumber);
// if (returnNumber < 1 || returnNumber > maxReturnCount)
// m_error.returnNumWarning(returnNumber);
}
if (point.hasDim(Id::NumberOfReturns))
numberOfReturns = point.getFieldAs<uint8_t>(Id::NumberOfReturns);
if (numberOfReturns == 0)
m_error.numReturnsWarning(0);
// if (numberOfReturns == 0)
// m_error.numReturnsWarning(0);
if (numberOfReturns > maxReturnCount)
{
if (m_discardHighReturnNumbers)
Expand All @@ -958,8 +958,8 @@ bool LasWriter::fillPointBuf(PointRef& point, LeInserter& ostream)
return false;
numberOfReturns = maxReturnCount;
}
else
m_error.numReturnsWarning(numberOfReturns);
// else
// m_error.numReturnsWarning(numberOfReturns);
}

auto converter = [this](double d, Dimension::Id dim) -> int32_t
Expand Down
3 changes: 1 addition & 2 deletions io/PlyReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ void PlyReader::pushLine()
std::string PlyReader::nextWord()
{
std::string s;
std::string::size_type cnt =
Utils::extract(m_line, m_linePos, (int(*)(int))std::isspace);
std::string::size_type cnt = Utils::extractSpaces(m_line, m_linePos);
m_linePos += cnt;
if (m_linePos == m_line.size())
return s;
Expand Down
16 changes: 2 additions & 14 deletions kernels/SortKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include "SortKernel.hpp"

#include <io/BufferReader.hpp>
#include <pdal/StageFactory.hpp>
#include <pdal/pdal_macros.hpp>

Expand Down Expand Up @@ -71,19 +70,7 @@ void SortKernel::addSwitches(ProgramArgs& args)
int SortKernel::execute()
{
Stage& readerStage = makeReader(m_inputFile, m_driverOverride);

PointTable table;
readerStage.prepare(table);
PointViewSet viewSetIn = readerStage.execute(table);

// the input PointViewSet will be used to populate a BufferReader that is
// consumed by the processing pipeline
PointViewPtr inView = *viewSetIn.begin();

BufferReader bufferReader;
bufferReader.addView(inView);

Stage& sortStage = makeFilter("filters.mortonorder", bufferReader);
Stage& sortStage = makeFilter("filters.mortonorder", readerStage);

Options writerOptions;
if (m_bCompress)
Expand All @@ -92,6 +79,7 @@ int SortKernel::execute()
writerOptions.add("forward_metadata", true);
Stage& writer = makeWriter(m_outputFile, sortStage, "", writerOptions);

PointTable table;
writer.prepare(table);
writer.execute(table);

Expand Down
2 changes: 0 additions & 2 deletions pdal/Kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

#include <pdal/pdal_config.hpp>

#include <io/BufferReader.hpp>

#include <memory>
#include <vector>

Expand Down
10 changes: 7 additions & 3 deletions pdal/Metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ class PDAL_DLL MetadataNodeImpl
}

template <typename T>
inline void setValue(const T& t);
inline void setValue(const T& t)
{
m_type = "unknown";
m_value = Utils::toString(t);
}

template <std::size_t N>
inline void setValue(const char(& c)[N]);
Expand Down Expand Up @@ -454,7 +458,7 @@ class PDAL_DLL MetadataNode
template<typename T>
T value() const
{
T t;
T t{};

if (m_impl->m_type == "base64Binary")
{
Expand All @@ -465,7 +469,7 @@ class PDAL_DLL MetadataNode
}
else
{
if (!Utils::fromString<T>(m_impl->m_value, t))
if (!Utils::fromString(m_impl->m_value, t))
{
// Static to get default initialization.
static T t2;
Expand Down
2 changes: 1 addition & 1 deletion pdal/PDALUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <pdal/util/Extractor.hpp>

#ifndef WIN32
#include <sys/fcntl.h>
#include <fcntl.h>
#include <unistd.h>
#endif

Expand Down
1 change: 0 additions & 1 deletion pdal/StageFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
#include <io/Ilvis2Reader.hpp>
#include <io/LasReader.hpp>
#include <io/OptechReader.hpp>
#include <io/BufferReader.hpp>
#include <io/PlyReader.hpp>
#include <io/PtsReader.hpp>
#include <io/QfitReader.hpp>
Expand Down
6 changes: 3 additions & 3 deletions pdal/util/ProgramArgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,8 @@ class ProgramArgs

/**
Parse a command line as specified by its argument vector. No validation
occurs and no exceptions are raised, but assignments are made
to bound variables where possible.
occurs and only argument value exceptions are raised,
but assignments are made to bound variables where possible.
\param s List of strings that constitute the argument list.
*/
Expand Down Expand Up @@ -1131,7 +1131,7 @@ class ProgramArgs
\param s List of strings that constitute the argument list.
*/
void parse(std::vector<std::string>& s)
void parse(const std::vector<std::string>& s)
{
validate();
ArgValList vals(s);
Expand Down
Loading

0 comments on commit c5058f9

Please sign in to comment.