Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue-1922
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 30, 2018
2 parents 2260cbf + 070b495 commit 00cd616
Show file tree
Hide file tree
Showing 59 changed files with 860 additions and 442 deletions.
25 changes: 25 additions & 0 deletions HOWTORELEASE.txt
Expand Up @@ -143,3 +143,28 @@ Release Process
::

http://upload.osgeo.org/cgi-bin/osgeo4w-promote.sh

12) Update Alpine package

- The PDAL Alpine package lives at
https://github.com/alpinelinux/aports/blob/master/testing/pdal/APKBUILD.
Pull requests can be made against the alpinelinux/aports repository. If the
build configuration alone is changing, with no version increase, simply
increment the build number `pkgrel`. If the `pkgver` is changing, then
reset `pkgrel` to 0.
- Pull requests should have a commit message of the following form
`testing/pdal: <description>`.

13) Update Conda package

- For PDAL releases that bump version number, but do not change dependencies
or build configurations, the `regro-cf-autotick-bot` should automatically
create a pull request at https://github.com/conda-forge/pdal-feedstock.
Once the builds succeed, the PR can be merged and the updated package will
soon be available in the `conda-forge` channel. If the PR does not build
successfully, updates to the PR can be pushed to the bot's branch. Version
bumps should reset the build number to zero.
- Updates that alter the build configuration but do not bump the version
number should be submitted as PRs from a fork of the
https://github.com/conda-forge/pdal-feedstock repository. In these cases,
the build number should be incremented.
8 changes: 4 additions & 4 deletions apps/CMakeLists.txt
Expand Up @@ -76,14 +76,14 @@ if(UNIX OR APPLE)
DESTINATION
"${PDAL_OUTPUT_BIN_DIR}/"
FILE_PERMISSIONS
OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

install(PROGRAMS "${PDAL_OUTPUT_BIN_DIR}/pdal-config"
DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin"
PERMISSIONS
OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

elseif(WIN32)
Expand All @@ -95,14 +95,14 @@ elseif(WIN32)
DESTINATION
"${PDAL_OUTPUT_BIN_DIR}/"
FILE_PERMISSIONS
OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

install(PROGRAMS "${PDAL_OUTPUT_BIN_DIR}/pdal-config.bat"
DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin"
PERMISSIONS
OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

endif()
53 changes: 12 additions & 41 deletions apps/pdal.cpp
Expand Up @@ -73,7 +73,6 @@ class App
void outputOptions();
void outputOptions(const std::string& stageName,std::ostream& strm);
void addArgs(ProgramArgs& args);
std::string findKernel();

std::ostream& m_out;

Expand Down Expand Up @@ -114,7 +113,7 @@ void App::outputHelp(const ProgramArgs& args)
// Load all kernels so that we can report the names.
StageFactory f;
PluginManager<Kernel>::loadAll();
outputCommands(" -");
outputCommands(" - ");
m_out << std::endl;
m_out << "See http://pdal.io/apps/ for more detail" << std::endl;
}
Expand Down Expand Up @@ -160,7 +159,6 @@ void App::outputDrivers()
}
else
{

Json::Value array(Json::arrayValue);
for (auto name : stages)
{
Expand All @@ -172,9 +170,7 @@ void App::outputDrivers()
node["link"] = link;
array.append(node);
}

m_out << array;

}
}

Expand All @@ -183,8 +179,13 @@ void App::outputCommands(const std::string& leader)
{
StageFactory f;
PluginManager<Kernel>::loadAll();
std::string kernelbase("kernels.");
for (auto name : PluginManager<Kernel>::names())
{
if (Utils::startsWith(name, kernelbase))
name = name.substr(kernelbase.size());
m_out << leader << name << std::endl;
}
}


Expand All @@ -200,7 +201,6 @@ void App::outputOptions(std::string const& stageName, std::ostream& strm)
return;
}


ProgramArgs args;
s->addAllArgs(args);

Expand All @@ -226,7 +226,6 @@ void App::outputOptions(std::string const& stageName, std::ostream& strm)
object[stageName] = array;

strm << object;

}
}

Expand All @@ -245,7 +244,8 @@ void App::outputOptions()
outputOptions(n, m_out);
m_out << std::endl;
}
} else
}
else
{
std::ostringstream strm;
Json::Value options (Json::arrayValue);
Expand All @@ -260,7 +260,6 @@ void App::outputOptions()

strm.str("");
}

m_out << options;
}
}
Expand Down Expand Up @@ -303,35 +302,6 @@ int main(int argc, char* argv[])
}


std::string App::findKernel()
{
StringList loadedKernels;

auto kernelSurname = [](const std::string& name)
{
StringList names = Utils::split2(name, '.');
return names.size() == 2 ? names[1] : std::string();
};

StageFactory f(true);
// Discover available kernels without plugins, and test to see if
// the positional option 'command' is a valid kernel
loadedKernels = PluginManager<Kernel>::names();
for (auto& name : loadedKernels)
if (m_command == kernelSurname(name))
return name;

// Force loading of plugins.
StageFactory f2(false);
loadedKernels = PluginManager<Kernel>::names();
for (auto& name : loadedKernels)
if (m_command == kernelSurname(name))
return name;

return std::string();
}


int App::execute(StringList& cmdArgs, LogPtr& log)
{
ProgramArgs args;
Expand Down Expand Up @@ -374,12 +344,13 @@ int App::execute(StringList& cmdArgs, LogPtr& log)
if (!m_command.empty())
{
int ret = 0;
std::string name(findKernel());
if (name.size())
std::string name("kernels." + m_command);

Kernel *kernel = PluginManager<Kernel>::createObject(name);
if (kernel)
{
if (m_help)
cmdArgs.push_back("--help");
Kernel *kernel = PluginManager<Kernel>::createObject(name);
// This shouldn't throw. If it does, it's something awful, so
// not cleaning up seems inconsequential.
log->setLeader("pdal " + m_command);
Expand Down
3 changes: 2 additions & 1 deletion cmake/cpack.cmake
Expand Up @@ -32,12 +32,13 @@ list(APPEND CPACK_SOURCE_IGNORE_FILES "Makefile")
list(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeFiles")
list(APPEND CPACK_SOURCE_IGNORE_FILES "CTestTestfile.cmake")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/test/data/local/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/test/unit/TestConfig.hpp")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/doc/doxygen/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/doc/build/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/doc/presentations/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/doc/_static/logo/dongle/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/cmake/examples/")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/include/pdal/pdal_defines.h")
list(APPEND CPACK_SOURCE_IGNORE_FILES "pdal_features.hpp")
list(APPEND CPACK_SOURCE_IGNORE_FILES ".gz2")
list(APPEND CPACK_SOURCE_IGNORE_FILES ".bz2")

Expand Down
13 changes: 13 additions & 0 deletions cmake/modules/FindGEOS.cmake
Expand Up @@ -162,6 +162,19 @@ IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
SET(GEOS_FOUND TRUE)
ENDIF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)

if (NOT GEOS_INCLUDE_DIR OR NOT GEOS_LIBRARY)
include(SelectLibraryConfigurations)
select_library_configurations(GEOS)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GEOS REQUIRED_VARS GEOS_LIBRARY GEOS_INCLUDE_DIR)
if(GEOS_FOUND)
set(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
if(NOT GEOS_LIBRARIES)
set(GEOS_LIBRARIES ${GEOS_LIBRARY})
endif()
endif()
endif()

IF (GEOS_FOUND)

IF (NOT GEOS_FIND_QUIETLY)
Expand Down
7 changes: 3 additions & 4 deletions dimbuilder/CMakeLists.txt
Expand Up @@ -31,11 +31,10 @@ target_include_directories(dimbuilder PRIVATE
PDAL_TARGET_COMPILE_SETTINGS(dimbuilder)
target_link_libraries(dimbuilder
PRIVATE
${EXECINFO_LIBRARY})
${EXECINFO_LIBRARY}
${CMAKE_DL_LIBS}
)
if (PDAL_HAVE_JSONCPP)
target_link_libraries(dimbuilder ${JSON_CPP_LINK_TYPE}
${PDAL_JSONCPP_LIB_NAME})
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(dimbuilder PRIVATE ${CMAKE_DL_LIBS})
endif()
22 changes: 20 additions & 2 deletions doc/faq.rst
Expand Up @@ -11,7 +11,7 @@ FAQ
The proper spelling of the project name is PDAL, in uppercase. It is
pronounced to rhyme with "GDAL".

.. it is properly pronounced like the dog though :)
.. it is properly pronounced like the dog though :) -- hobu
|
* Why do I get the error "Couldn't create ... stage of type ..."?

Expand Down Expand Up @@ -44,6 +44,8 @@ FAQ
sizes before PDAL can process the data. Furthermore, some operations
(notably :ref:`DEM creation<writers.gdal>`) can use large amounts of
additional memory during processing before the output can be written.
Depending on the operation, PDAL will attempt operate in "stream mode" to
limit memory consumption when possible.
|
* What is PDAL's relationship to PCL?

Expand Down Expand Up @@ -72,7 +74,7 @@ FAQ
|
* Are there any command line tools in PDAL similar to LAStools?

Yes. The ``pdal`` command provides a wide range of features which go
Yes. The :ref:`pdal <apps>` command provides a wide range of features which go
far beyond basic LIDAR data processing. Additionally, PDAL is licensed
under an open source license (this applies to the whole library and
all command line tools).
Expand All @@ -88,3 +90,19 @@ FAQ
focus on usability and readability. You will find that the ``pdal``
command has several well-organized subcommands such as ``info``
or ``translate`` (see :ref:`apps`).

* I get GeoTIFF errors. What can I do about them?

::

(readers.las Error) Geotiff directory contains key 0 with short entry and more than one value.

If :ref:`readers.las` is outputting error messages about GeoTIFF, this means
the keys that were written into your file were incorrect or at least not
readable by `libgeotiff`_. Rewrite the file using PDAL to fix the issue:

::

pdal translate badfile.las goodfile.las --writers.las.forward=all

.. _`libgeotiff`: https://trac.osgeo.org/geotif
Binary file modified doc/images/reproject-merge-pipeline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/stages/filters.delaunay.rst
Expand Up @@ -15,7 +15,7 @@ dimensions of the point cloud.

.. _Geogram: http://alice.loria.fr/software/geogram/doc/html/index.html

.. embed::
.. plugin::

Example
-------
Expand Down
8 changes: 6 additions & 2 deletions filters/FerryFilter.cpp
Expand Up @@ -80,7 +80,7 @@ void FerryFilter::initialize()
throwError("Can't ferry two source dimensions to the same "
"destination dimension.");
toNames.push_back(s[1]);
m_dims.emplace_back( s[0], s[1] );
m_dims.emplace_back(s[0], s[1]);
}
}

Expand All @@ -90,7 +90,11 @@ void FerryFilter::addDimensions(PointLayoutPtr layout)
for (auto& info : m_dims)
{
const Dimension::Id fromId = layout->findDim(info.m_fromName);
const Dimension::Type fromType = layout->dimType(fromId);
// Dimensions being created with the "=>Dim" syntax won't have
// be in the layout, so we have to assign a default type.
Dimension::Type fromType = layout->dimType(fromId);
if (fromType == Dimension::Type::None)
fromType = Dimension::Type::Double;

info.m_toId = layout->registerOrAssignDim(info.m_toName, fromType);
}
Expand Down
1 change: 0 additions & 1 deletion filters/ReprojectionFilter.cpp
Expand Up @@ -62,7 +62,6 @@ ReprojectionFilter::ReprojectionFilter()
, m_in_ref_ptr(NULL)
, m_out_ref_ptr(NULL)
, m_transform_ptr(NULL)
, m_errorHandler(new gdal::ErrorHandler())
{}


Expand Down
6 changes: 0 additions & 6 deletions filters/ReprojectionFilter.hpp
Expand Up @@ -42,11 +42,6 @@
namespace pdal
{

namespace gdal
{
class ErrorHandler;
}

class PDAL_DLL ReprojectionFilter : public Filter, public Streamable
{
public:
Expand Down Expand Up @@ -74,7 +69,6 @@ class PDAL_DLL ReprojectionFilter : public Filter, public Streamable
ReferencePtr m_in_ref_ptr;
ReferencePtr m_out_ref_ptr;
TransformPtr m_transform_ptr;
gdal::ErrorHandler* m_errorHandler;

ReprojectionFilter& operator=(const ReprojectionFilter&); // not implemented
ReprojectionFilter(const ReprojectionFilter&); // not implemented
Expand Down
2 changes: 1 addition & 1 deletion io/BpfCompressor.hpp
Expand Up @@ -37,7 +37,7 @@
#include <stdexcept>
#include <ostream>

#include <pdal/pdal_internal.hpp>
#include <pdal/pdal_features.hpp>
#include <pdal/util/Charbuf.hpp>
#include <pdal/util/OStream.hpp>

Expand Down
7 changes: 5 additions & 2 deletions io/BpfReader.cpp
Expand Up @@ -36,9 +36,12 @@

#include <climits>

#include <zlib.h>

#include <pdal/Options.hpp>
#include <pdal/pdal_features.hpp>

#ifdef PDAL_HAVE_ZLIB
#include <zlib.h>
#endif

namespace pdal
{
Expand Down
4 changes: 4 additions & 0 deletions io/GeotiffSupport.cpp
Expand Up @@ -45,6 +45,7 @@ PDAL_C_START
// aren't exported.
char PDAL_DLL * GTIFGetOGISDefn(GTIF*, GTIFDefn*);
int PDAL_DLL GTIFSetFromOGISDefn(GTIF*, const char*);
void VSIFree(void *data);

PDAL_C_END

Expand Down Expand Up @@ -146,7 +147,10 @@ GeotiffSrs::GeotiffSrs(const std::vector<uint8_t>& directoryRec,
{
char *wkt = GTIFGetOGISDefn(ctx.gtiff, &sGTIFDefn);
if (wkt)
{
m_srs.set(wkt);
VSIFree(wkt);
}
}
}

Expand Down

0 comments on commit 00cd616

Please sign in to comment.