Skip to content

Commit dbba641

Browse files
committed
Remove GDAL 2.1 cruft. (PDAL#2672)
Don't include GDALUtils in headers.
1 parent 0c9c246 commit dbba641

26 files changed

+52
-264
lines changed

filters/ColorinterpFilter.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,10 @@
3434

3535
#include "ColorinterpFilter.hpp"
3636

37-
#include <pdal/PointView.hpp>
3837
#include <pdal/GDALUtils.hpp>
38+
#include <pdal/PointView.hpp>
3939
#include <pdal/util/ProgramArgs.hpp>
4040

41-
#include <gdal.h>
42-
#include <cpl_vsi.h>
43-
#include <ogr_spatialref.h>
44-
4541
#include <array>
4642
#include <algorithm>
4743
#include <cmath>
@@ -77,7 +73,7 @@ std::string ColorinterpFilter::getName() const { return s_info.name; }
7773
#define GETRAMP(name) \
7874
if (pdal::Utils::iequals(#name, rampFilename)) \
7975
{ \
80-
GByte* location(0); \
76+
unsigned char* location(name); \
8177
int size (0); \
8278
location = name; \
8379
size = sizeof(name); \

filters/ColorinterpFilter.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@
3838
#include <pdal/Streamable.hpp>
3939
#include <filters/StatsFilter.hpp>
4040

41-
#include <gdal.h>
42-
#include <ogr_spatialref.h>
43-
#include <pdal/GDALUtils.hpp>
44-
4541
#include <map>
4642

4743
namespace pdal
4844
{
4945

46+
namespace gdal { class Raster; }
47+
5048
// Interpolates color ramp into Red, Green, and Blue dimensions
5149
// for a given dimension
5250
// specified dimensions. It also supports scaling the data by a multiplier
@@ -84,7 +82,7 @@ class PDAL_DLL ColorinterpFilter : public Filter, public Streamable
8482
double m_min;
8583
double m_max;
8684
std::string m_colorramp;
87-
std::shared_ptr<pdal::gdal::Raster> m_raster;
85+
std::shared_ptr<gdal::Raster> m_raster;
8886
std::string m_rampFilename;
8987
std::vector<uint8_t> m_redBand;
9088
std::vector<uint8_t> m_greenBand;

filters/ColorizationFilter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@
3434

3535
#include "ColorizationFilter.hpp"
3636

37+
#include <pdal/GDALUtils.hpp>
3738
#include <pdal/PointView.hpp>
3839
#include <pdal/util/ProgramArgs.hpp>
3940

40-
#include <gdal.h>
41-
#include <ogr_spatialref.h>
42-
4341
#include <array>
4442

4543
namespace pdal

filters/ColorizationFilter.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@
3737
#include <pdal/Filter.hpp>
3838
#include <pdal/Streamable.hpp>
3939

40-
#include <gdal.h>
41-
#include <ogr_spatialref.h>
42-
#include <pdal/GDALUtils.hpp>
43-
4440
#include <map>
4541

4642
namespace pdal
4743
{
4844

45+
namespace gdal { class Raster; }
46+
4947
// Provides GDAL-based raster overlay that places output data in
5048
// specified dimensions. It also supports scaling the data by a multiplier
5149
// on a per-dimension basis.

filters/CropFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434

3535
#include "CropFilter.hpp"
3636

37-
#include <pdal/GDALUtils.hpp>
3837
#include <pdal/PointView.hpp>
3938
#include <pdal/StageFactory.hpp>
4039
#include <pdal/Polygon.hpp>
4140
#include <pdal/util/Bounds.hpp>
4241
#include <pdal/util/ProgramArgs.hpp>
42+
#include <pdal/GDALUtils.hpp>
4343

4444
#include "private/Point.hpp"
4545
#include "private/pnp/GridPnp.hpp"

filters/DEMFilter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434

3535
#include "DEMFilter.hpp"
3636

37-
#include "private/DimRange.hpp"
3837
#include <string>
3938
#include <vector>
4039

40+
#include <pdal/GDALUtils.hpp>
41+
#include "private/DimRange.hpp"
42+
4143
namespace pdal
4244
{
4345

filters/DEMFilter.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
#pragma once
3636

3737
#include <pdal/Filter.hpp>
38-
#include <pdal/GDALUtils.hpp>
3938
#include <pdal/Streamable.hpp>
4039

41-
4240
#include <cstdint>
4341
#include <memory>
4442
#include <string>
@@ -48,6 +46,7 @@ namespace pdal
4846

4947
struct DEMArgs;
5048

49+
namespace gdal { class Raster; }
5150
class Options;
5251
class PointLayout;
5352
class PointView;

filters/OverlayFilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
#include <vector>
3838

39-
#include <pdal/GDALUtils.hpp>
4039
#include <pdal/QuadIndex.hpp>
40+
#include <pdal/GDALUtils.hpp>
4141
#include <pdal/util/ProgramArgs.hpp>
4242

4343
namespace pdal

io/GDALReader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,11 @@ bool GDALReader::processOne(PointRef& point)
226226
return true;
227227
}
228228

229+
230+
void GDALReader::done(PointTableRef table)
231+
{
232+
m_raster->close();
233+
}
234+
229235
} // namespace pdal
230236

io/GDALReader.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@
4040
#include <pdal/Dimension.hpp>
4141
#include <pdal/Reader.hpp>
4242
#include <pdal/StageFactory.hpp>
43-
#include <pdal/GDALUtils.hpp>
4443
#include <pdal/Streamable.hpp>
4544

4645
namespace pdal
4746
{
4847

48+
namespace gdal { class Raster; }
49+
4950
typedef std::map<std::string, Dimension::Id> DimensionMap;
5051

5152
class PDAL_DLL GDALReader : public Reader , public Streamable
@@ -61,8 +62,7 @@ class PDAL_DLL GDALReader : public Reader , public Streamable
6162
virtual void addDimensions(PointLayoutPtr layout);
6263
virtual void ready(PointTableRef table);
6364
virtual point_count_t read(PointViewPtr view, point_count_t num);
64-
virtual void done(PointTableRef table)
65-
{ m_raster->close(); }
65+
virtual void done(PointTableRef table);
6666
virtual bool processOne(PointRef& point);
6767
virtual QuickInfo inspect();
6868
virtual void addArgs(ProgramArgs& args);

0 commit comments

Comments
 (0)