Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Jan 19, 2012
2 parents b213a1b + f9de48b commit 9f38969
Show file tree
Hide file tree
Showing 64 changed files with 1,553 additions and 3,954 deletions.
24 changes: 3 additions & 21 deletions CMakeLists.txt
Expand Up @@ -55,11 +55,6 @@ set(WITH_TESTS TRUE CACHE BOOL "Choose if PDAL unit tests should be built")
set(WITH_PKGCONFIG FALSE CACHE BOOL
"Choose whether a pkgconfig file (PDAL.pc) should be installed")

set(WITH_ENDIANAWARE FALSE CACHE BOOL "Choose whether or not PDAL should do runtime endianness switching. Note that this can slow things down considerably if enabled by default")
if (WITH_ENDIANAWARE)
set(PDAL_ENDIAN_AWARE 1)
endif()


#------------------------------------------------------------------------------
# test harness settings
Expand Down Expand Up @@ -350,27 +345,14 @@ if(WITH_LASZIP)
endif()
endif()

# LIBLAS support - optional, default=OFF
set(WITH_LIBLAS FALSE CACHE BOOL "Choose if libLAS support should be built")
set(WITH_STATIC_LIBLAS FALSE CACHE BOOL "Choose if libLAS should be statically linked")
mark_as_advanced(WITH_STATIC_LIBLAS)

if(WITH_LIBLAS)
find_package(LibLAS 1.6.0)
if(LIBLAS_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${LIBLAS_LIBRARY})
include_directories(${LIBLAS_INCLUDE_DIR})
mark_as_advanced(CLEAR LIBLAS_INCLUDE_DIR)
mark_as_advanced(CLEAR LIBLAS_LIBRARY)
mark_as_advanced(CLEAR LIBLAS_VERSION)
set(PDAL_HAVE_LIBLAS 1)
endif()
endif()

# MrSID/LiDAR support - optiona, default=OFF
set(WITH_MRSID FALSE CACHE BOOL "Choose if MrSID/LiDAR support should be built")

if(WITH_MRSID)

set(MRSID_ROOT "/Users/hobu/installs/mrsid/Lidar_DSDK" CACHE STRING "Root directory of MrSID install")

find_package(MrSID)
if(MRSID_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${MRSID_LIBRARY})
Expand Down
10 changes: 0 additions & 10 deletions apps/AppSupport.cpp
Expand Up @@ -110,11 +110,6 @@ pdal::Stage* AppSupport::makeReader(pdal::Options& options)
throw app_runtime_error("Cannot determine file type of " + inputFile);
}

if (options.getValueOrDefault<bool>("liblas", false) && driver == "drivers.las.reader")
{
driver = "drivers.liblas.reader";
}

pdal::StageFactory factory;
pdal::Stage* stage = factory.createReader(driver, options);
if (!stage)
Expand All @@ -135,11 +130,6 @@ pdal::Writer* AppSupport::makeWriter(pdal::Options& options, pdal::Stage& stage)
{
throw app_runtime_error("Cannot determine file type of " + outputFile);
}

if (options.getValueOrDefault<bool>("liblas", false) && driver == "drivers.las.writer")
{
driver = "drivers.liblas.writer";
}

pdal::StageFactory factory;
pdal::Writer* writer = factory.createWriter(driver, stage, options);
Expand Down
9 changes: 0 additions & 9 deletions apps/pc2pc.cpp
Expand Up @@ -36,10 +36,6 @@

#include <pdal/drivers/las/Reader.hpp>
#include <pdal/drivers/las/Writer.hpp>
#ifdef PDAL_HAVE_LIBLAS
#include <pdal/drivers/liblas/Writer.hpp>
#include <pdal/drivers/liblas/Reader.hpp>
#endif
#ifdef PDAL_HAVE_ORACLE
#include <pdal/drivers/oci/Writer.hpp>
#include <pdal/drivers/oci/Reader.hpp>
Expand Down Expand Up @@ -71,7 +67,6 @@ class Pc2Pc : public Application

std::string m_inputFile;
std::string m_outputFile;
bool m_useLiblas;
std::string m_srs;
bool m_bCompress;
boost::uint32_t m_chunkSize;
Expand All @@ -82,7 +77,6 @@ Pc2Pc::Pc2Pc(int argc, char* argv[])
: Application(argc, argv, "pc2pc")
, m_inputFile("")
, m_outputFile("")
, m_useLiblas(false)
, m_srs("")
, m_bCompress(false)
, m_chunkSize(0)
Expand Down Expand Up @@ -116,7 +110,6 @@ void Pc2Pc::addSwitches()
file_options->add_options()
("input,i", po::value<std::string>(&m_inputFile)->default_value(""), "input file name")
("output,o", po::value<std::string>(&m_outputFile)->default_value(""), "output file name")
("liblas", po::value<bool>(&m_useLiblas)->zero_tokens()->implicit_value(true), "use libLAS driver (not PDAL native driver)")
("a_srs", po::value<std::string>(&m_srs)->default_value(""), "Assign output coordinate system (if supported by output format)")
("compress,z", po::value<bool>(&m_bCompress)->zero_tokens()->implicit_value(true), "Compress output data (if supported by output format)")
("chunk_size", po::value<boost::uint32_t>(&m_chunkSize), "Size of buffer, for blocked/chunked/tiled transfers")
Expand All @@ -133,7 +126,6 @@ int Pc2Pc::execute()
readerOptions.add<std::string>("filename", m_inputFile);
readerOptions.add<bool>("debug", isDebug());
readerOptions.add<boost::uint32_t>("verbose", getVerboseLevel());
readerOptions.add<bool>("liblas", m_useLiblas);
}

Options writerOptions;
Expand All @@ -151,7 +143,6 @@ int Pc2Pc::execute()
{
writerOptions.add<bool>("compression", true);
}
writerOptions.add<bool>("liblas", m_useLiblas);

if (m_chunkSize != 0)
{
Expand Down
194 changes: 0 additions & 194 deletions apps/pcinfo.cpp
Expand Up @@ -68,7 +68,6 @@ class PcInfo : public Application

std::string m_inputFile;
std::string m_outputFile;
bool m_useLiblas;
bool m_showStats;
bool m_showSchema;
bool m_showStage;
Expand All @@ -81,7 +80,6 @@ PcInfo::PcInfo(int argc, char* argv[])
: Application(argc, argv, "pcinfo")
, m_inputFile("")
, m_outputFile("")
, m_useLiblas(false)
, m_showStats(false)
, m_showSchema(false)
, m_showStage(false)
Expand Down Expand Up @@ -112,7 +110,6 @@ void PcInfo::addSwitches()
file_options->add_options()
("input,i", po::value<std::string>(&m_inputFile)->default_value(""), "input file name")
("output,o", po::value<std::string>(&m_outputFile)->default_value(""), "output file name")
("liblas", po::value<bool>(&m_useLiblas)->zero_tokens()->implicit_value(true), "use libLAS driver (not PDAL native driver)")
;

addSwitchSet(file_options);
Expand Down Expand Up @@ -229,7 +226,6 @@ int PcInfo::execute()
readerOptions.add<std::string>("filename", m_inputFile);
readerOptions.add<bool>("debug", isDebug());
readerOptions.add<boost::uint32_t>("verbose", getVerboseLevel());
readerOptions.add<bool>("liblas", m_useLiblas);
}

Stage* reader = AppSupport::makeReader(readerOptions);
Expand Down Expand Up @@ -276,193 +272,3 @@ int main(int argc, char* argv[])
return app.run();
}


#if 0



liblas::Summary check_points( liblas::Reader& reader,
std::vector<liblas::FilterPtr>& filters,
std::vector<liblas::TransformPtr>& transforms,
bool verbose)
{

liblas::Summary summary;

reader.SetFilters(filters);
reader.SetTransforms(transforms);



if (verbose)
std::cout << "Scanning points:"
<< "\n - : "
<< std::endl;

//
// Translation of points cloud to features set
//
boost::uint32_t i = 0;
boost::uint32_t const size = reader.GetHeader().GetPointRecordsCount();


while (reader.ReadNextPoint())
{
liblas::Point const& p = reader.GetPoint();
summary.AddPoint(p);
if (verbose)
term_progress(std::cout, (i + 1) / static_cast<double>(size));
i++;

}
if (verbose)
std::cout << std::endl;

return summary;

}



void PrintVLRs(std::ostream& os, liblas::Header const& header)
{
if (!header.GetRecordsCount())
return ;

os << "---------------------------------------------------------" << std::endl;
os << " VLR Summary" << std::endl;
os << "---------------------------------------------------------" << std::endl;

typedef std::vector<VariableRecord>::size_type size_type;
for(size_type i = 0; i < header.GetRecordsCount(); i++) {
liblas::VariableRecord const& v = header.GetVLR(i);
os << v;
}

}


int main(int argc, char* argv[])
{

std::string input;

bool verbose = false;
bool check = true;
bool show_vlrs = true;
bool show_schema = true;
bool output_xml = false;
bool output_json = false;
bool show_point = false;
bool use_locale = false;
boost::uint32_t point = 0;



file_options.add_options()
("no-vlrs", po::value<bool>(&show_vlrs)->zero_tokens()->implicit_value(false), "Don't show VLRs")
("no-schema", po::value<bool>(&show_schema)->zero_tokens()->implicit_value(false), "Don't show schema")
("no-check", po::value<bool>(&check)->zero_tokens()->implicit_value(false), "Don't scan points")
("xml", po::value<bool>(&output_xml)->zero_tokens()->implicit_value(true), "Output as XML")
("point,p", po::value<boost::uint32_t>(&point), "Display a point with a given id. --point 44")

("locale", po::value<bool>(&use_locale)->zero_tokens()->implicit_value(true), "Use the environment's locale for output")

// --xml
// --json
// --restructured text output



if (vm.count("point"))
{
show_point = true;
}




if (show_point)
{
try
{
reader.ReadPointAt(point);
liblas::Point const& p = reader.GetPoint();
if (output_xml) {
liblas::property_tree::ptree tree;
tree = p.GetPTree();
liblas::property_tree::write_xml(std::cout, tree);
exit(0);
}
else
{
if (use_locale)
{
std::locale l("");
std::cout.imbue(l);
}
std::cout << p << std::endl;
exit(0);
}

} catch (std::out_of_range const& e)
{
std::cerr << "Unable to read point at index " << point << ": " << e.what() << std::endl;
exit(1);

}

}

liblas::Summary summary;
if (check)
summary = check_points( reader,
filters,
transforms,
verbose
);

liblas::Header const& header = reader.GetHeader();

// Add the header to the summary so we can get more detailed
// info
summary.SetHeader(header);

if (output_xml && output_json) {
std::cerr << "both JSON and XML output cannot be chosen";
return 1;
}
if (output_xml) {
liblas::property_tree::ptree tree;
if (check)
tree = summary.GetPTree();
else
{
tree.add_child("summary.header", header.GetPTree());
}

liblas::property_tree::write_xml(std::cout, tree);
return 0;
}

if (use_locale)
{
std::locale l("");
std::cout.imbue(l);
}

std::cout << header << std::endl;
if (show_vlrs)
PrintVLRs(std::cout, header);

if (show_schema)
std::cout << header.GetSchema();

if (check) {
std::cout << summary << std::endl;

}
}


#endif
File renamed without changes.
2 changes: 1 addition & 1 deletion include/pdal/Schema.hpp
Expand Up @@ -46,7 +46,7 @@
#include <map>

#include <pdal/pdal_internal.hpp>
#include <pdal/dimension/Dimension.hpp>
#include <pdal/Dimension.hpp>

// boost
#include <boost/cstdint.hpp>
Expand Down
3 changes: 2 additions & 1 deletion include/pdal/Utils.hpp
Expand Up @@ -150,7 +150,8 @@ class PDAL_DLL Utils
static std::string trim(const std::string& str);

static boost::uint32_t getStreamPrecision(double scale);


static boost::uint32_t safeconvert64to32(boost::uint64_t x64);

private:
template<typename T>
Expand Down
1 change: 0 additions & 1 deletion include/pdal/XMLSchema.hpp
Expand Up @@ -37,7 +37,6 @@

#include <pdal/pdal_internal.hpp>
#include <pdal/Schema.hpp>
#include <pdal/dimension/Dimension.hpp>

#include <string>
#include <stdarg.h>
Expand Down

0 comments on commit 9f38969

Please sign in to comment.