Skip to content

Commit

Permalink
another attempt and organizing GDAL debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Oct 23, 2012
1 parent f68a46f commit a80e529
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion include/pdal/filters/InPlaceReprojection.hpp
Expand Up @@ -68,6 +68,7 @@ class PDAL_DLL InPlaceReprojection : public Filter
const SpatialReference& inSRS,
const SpatialReference& outSRS);

~InPlaceReprojection();
virtual void initialize();
virtual const Options getDefaultOptions() const;

Expand Down Expand Up @@ -133,7 +134,7 @@ class PDAL_DLL InPlaceReprojection : public Filter
dimension::id m_old_y_id;
dimension::id m_old_z_id;

boost::shared_ptr<pdal::gdal::Debug> m_gdal_debug;
pdal::gdal::Debug* m_gdal_debug;

InPlaceReprojection& operator=(const InPlaceReprojection&); // not implemented
InPlaceReprojection(const InPlaceReprojection&); // not implemented
Expand Down
6 changes: 4 additions & 2 deletions src/filters/Colorization.cpp
Expand Up @@ -76,7 +76,7 @@ Colorization::~Colorization()
{
#ifdef PDAL_HAVE_GDAL

if (m_gdal_debug)
if (m_gdal_debug != 0)
delete m_gdal_debug;

if (m_ds != 0)
Expand All @@ -99,7 +99,9 @@ void Colorization::initialize()
#ifdef PDAL_HAVE_GDAL

pdal::GlobalEnvironment::get().getGDALEnvironment();
m_gdal_debug = new pdal::gdal::Debug(isDebug(), log());

if (m_gdal_debug == 0)
m_gdal_debug = new pdal::gdal::Debug(isDebug(), log());
m_forward_transform.assign(0.0);
m_inverse_transform.assign(0.0);

Expand Down
15 changes: 11 additions & 4 deletions src/filters/InPlaceReprojection.cpp
Expand Up @@ -82,7 +82,8 @@ InPlaceReprojection::InPlaceReprojection(Stage& prevStage, const Options& option
, m_new_z_id(boost::uuids::nil_uuid())
, m_old_x_id(boost::uuids::nil_uuid())
, m_old_y_id(boost::uuids::nil_uuid())
, m_old_z_id(boost::uuids::nil_uuid())
, m_old_z_id(boost::uuids::nil_uuid())
, m_gdal_debug(0)
{
if (options.hasOption("in_srs"))
{
Expand All @@ -97,7 +98,12 @@ InPlaceReprojection::InPlaceReprojection(Stage& prevStage, const Options& option
return;
}


InPlaceReprojection::~InPlaceReprojection()
{
if (m_gdal_debug != 0)
delete m_gdal_debug;

}
void InPlaceReprojection::initialize()
{
Filter::initialize();
Expand All @@ -108,8 +114,9 @@ void InPlaceReprojection::initialize()
}

#ifdef PDAL_HAVE_GDAL

m_gdal_debug = boost::shared_ptr<pdal::gdal::Debug>(new pdal::gdal::Debug(isDebug(), log()));

if (m_gdal_debug == 0)
m_gdal_debug = new pdal::gdal::Debug(isDebug(), log());

m_in_ref_ptr = ReferencePtr(OSRNewSpatialReference(0), OGRSpatialReferenceDeleter());
m_out_ref_ptr = ReferencePtr(OSRNewSpatialReference(0), OGRSpatialReferenceDeleter());
Expand Down

0 comments on commit a80e529

Please sign in to comment.