Skip to content

Commit

Permalink
we're going hipster -- JSON output only. Remove XML from kernel outpu…
Browse files Browse the repository at this point in the history
…t except for the soon-to-be-hidden pipeline-serialization stuff
  • Loading branch information
hobu committed Mar 11, 2015
1 parent e2bf2e4 commit 468bb98
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
16 changes: 1 addition & 15 deletions kernels/delta/DeltaKernel.cpp
Expand Up @@ -56,7 +56,6 @@ DeltaKernel::DeltaKernel()
, m_outputStream(0)
, m_3d(true)
, m_OutputDetail(false)
, m_useXML(false)
, m_useJSON(false)
{}

Expand All @@ -82,8 +81,6 @@ void DeltaKernel::addSwitches()
"Output deltas per-point")
("output", po::value<std::string>(&m_outputFileName),
"output file name")
("xml", po::value<bool>(&m_useXML)->zero_tokens()->implicit_value(true),
"dump XML")
("json",
po::value<bool>(&m_useJSON)->zero_tokens()->implicit_value(true),
"dump JSON");
Expand Down Expand Up @@ -196,10 +193,7 @@ void DeltaKernel::outputDetail(PointBuffer& source_data, PointBuffer& candidate_

}

if (m_useXML)
{
boost::property_tree::write_xml(ostr, output);
} else if (m_useJSON)
if (m_useJSON)
{
boost::property_tree::write_json(ostr, output);

Expand Down Expand Up @@ -271,12 +265,6 @@ void DeltaKernel::outputJSON(boost::property_tree::ptree const& tree) const

}

void DeltaKernel::outputXML(boost::property_tree::ptree const& tree) const
{
boost::property_tree::write_xml(std::cout, tree);

}

int DeltaKernel::execute()
{
PointContext sourceCtx;
Expand Down Expand Up @@ -370,8 +358,6 @@ int DeltaKernel::execute()

if (m_useJSON)
outputJSON(output);
else if (m_useXML)
outputXML(output);
else
outputRST(output);
return 0;
Expand Down
3 changes: 0 additions & 3 deletions kernels/delta/DeltaKernel.hpp
Expand Up @@ -41,7 +41,6 @@
#include <pdal/Stage.hpp>
#include <pdal/util/FileUtils.hpp>

#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
Expand Down Expand Up @@ -125,13 +124,11 @@ class PDAL_DLL DeltaKernel : public Kernel

bool m_3d;
bool m_OutputDetail;
bool m_useXML;
bool m_useJSON;
std::unique_ptr<KDIndex> m_index;


void outputRST(boost::property_tree::ptree const&) const;
void outputXML(boost::property_tree::ptree const&) const;
void outputJSON(boost::property_tree::ptree const&) const;
void outputDetail(PointBuffer& source_data, PointBuffer& candidate_data,
std::map<Point, Point> *points) const;
Expand Down
5 changes: 0 additions & 5 deletions kernels/diff/DiffKernel.cpp
Expand Up @@ -40,7 +40,6 @@

#include <boost/program_options.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>

using boost::property_tree::ptree;

Expand All @@ -60,7 +59,6 @@ DiffKernel::DiffKernel()
: Kernel()
, m_sourceFile("")
, m_candidateFile("")
, m_useXML(false)
, m_useJSON(false)

{}
Expand All @@ -86,9 +84,6 @@ void DiffKernel::addSwitches()
("source", po::value<std::string>(&m_sourceFile), "source file name")
("candidate",
po::value<std::string>(&m_candidateFile), "candidate file name")
("xml",
po::value<bool>(&m_useXML)->zero_tokens()->implicit_value(true),
"dump XML")
("json",
po::value<bool>(&m_useJSON)->zero_tokens()->implicit_value(true),
"dump JSON")
Expand Down
1 change: 0 additions & 1 deletion kernels/diff/DiffKernel.hpp
Expand Up @@ -68,7 +68,6 @@ class PDAL_DLL DiffKernel : public Kernel
boost::property_tree::ptree& errors);
std::string m_sourceFile;
std::string m_candidateFile;
bool m_useXML;
bool m_useJSON;
};

Expand Down

0 comments on commit 468bb98

Please sign in to comment.