Skip to content

Commit

Permalink
Fix warnings in pdal wrench
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 9, 2023
1 parent e98e655 commit 3342172
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion external/pdal_wrench/alg.cpp
Expand Up @@ -86,7 +86,7 @@ bool Alg::parseArgs(std::vector<std::string> args)
argInput = &programArgs.add("input,i", "Input point cloud file", inputFile);
}

pdal::Arg& argFilter = programArgs.add("filter,f", "Filter expression for input data", filterExpression);
(void)programArgs.add("filter,f", "Filter expression for input data", filterExpression);

addArgs(); // impl in derived

Expand Down
3 changes: 2 additions & 1 deletion external/pdal_wrench/alg.hpp
Expand Up @@ -50,6 +50,7 @@ struct Alg
pdal::ProgramArgs programArgs;

Alg() = default;
virtual ~Alg() = default;

// no copying
Alg(const Alg &other) = delete;
Expand All @@ -75,7 +76,7 @@ struct Alg
/**
* Runs and post-processing code when pipelines are done executing.
*/
virtual void finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines) {};
virtual void finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines) { ( void )pipelines; };
};

bool runAlg(std::vector<std::string> args, Alg &alg);
Expand Down
4 changes: 2 additions & 2 deletions external/pdal_wrench/boundary.cpp
Expand Up @@ -84,11 +84,11 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, double r
hexbin_opts.add(pdal::Option("where", tile->filterExpression));
}

Stage& w = manager->makeFilter( "filters.hexbin", r, hexbin_opts );
(void)manager->makeFilter( "filters.hexbin", r, hexbin_opts );
return manager;
}

void Boundary::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Boundary::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &)
{
if (ends_with(inputFile, ".vpc"))
{
Expand Down
4 changes: 2 additions & 2 deletions external/pdal_wrench/clip.cpp
Expand Up @@ -137,7 +137,7 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, const pd
}


void Clip::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Clip::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &totalPoints)
{
pdal::Options crop_opts;
BOX2D bbox;
Expand Down Expand Up @@ -197,7 +197,7 @@ void Clip::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipel
}
}

void Clip::finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines)
void Clip::finalize(std::vector<std::unique_ptr<PipelineManager>>&)
{
if (tileOutputFiles.empty())
return;
Expand Down
2 changes: 1 addition & 1 deletion external/pdal_wrench/density.cpp
Expand Up @@ -117,7 +117,7 @@ std::unique_ptr<PipelineManager> Density::pipeline(ParallelJobInfo *tile) const
// TODO: "writers.gdal: Requested driver 'COG' does not support file creation.""
// writer_opts.add(pdal::Option("gdaldriver", "COG"));

pdal::StageCreationOptions opts{ tile->outputFilename, "", nullptr, writer_opts };
pdal::StageCreationOptions opts{ tile->outputFilename, "", nullptr, writer_opts, nullptr };
Stage& w = manager->makeWriter( opts );
for (Stage *stage : readers)
{
Expand Down
4 changes: 2 additions & 2 deletions external/pdal_wrench/info.cpp
Expand Up @@ -101,7 +101,7 @@ static void formatCrsInfo(const std::string &crsWkt, std::string &crs, std::stri
}


void Info::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Info::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>&, const BOX3D &, point_count_t &)
{
if (ends_with(inputFile, ".vpc"))
{
Expand Down Expand Up @@ -180,6 +180,6 @@ void Info::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipel
}
}

void Info::finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines)
void Info::finalize(std::vector<std::unique_ptr<PipelineManager>>&)
{
}
2 changes: 1 addition & 1 deletion external/pdal_wrench/merge.cpp
Expand Up @@ -73,7 +73,7 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile)
return manager;
}

void Merge::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Merge::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &totalPoints)
{
ParallelJobInfo tile(ParallelJobInfo::Single, BOX2D(), filterExpression);
tile.inputFilenames = inputFiles;
Expand Down
4 changes: 2 additions & 2 deletions external/pdal_wrench/thin.cpp
Expand Up @@ -131,7 +131,7 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, std::str
}


void Thin::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Thin::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &)
{
if (ends_with(inputFile, ".vpc"))
{
Expand Down Expand Up @@ -175,7 +175,7 @@ void Thin::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipel
}
}

void Thin::finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines)
void Thin::finalize(std::vector<std::unique_ptr<PipelineManager>>&)
{
if (tileOutputFiles.empty())
return;
Expand Down
1 change: 1 addition & 0 deletions external/pdal_wrench/tile/TileGrid.cpp
Expand Up @@ -37,6 +37,7 @@ void TileGrid::expand(const BOX3D& bounds, size_t points)

TileKey TileGrid::key(double x, double y, double z) const
{
(void)z;
int xi = (int)std::floor((x - m_bounds.minx) / m_tileLength);
int yi = (int)std::floor((y - m_bounds.miny) / m_tileLength);
xi = (std::min)((std::max)(0, xi), m_gridSizeX - 1);
Expand Down
7 changes: 5 additions & 2 deletions external/pdal_wrench/tile/tile.cpp
Expand Up @@ -622,6 +622,9 @@ static void tilingPass1(BaseInfo &m_b, TileGrid &m_grid, FileInfo &m_srsFileInfo

static void tilingPass2(BaseInfo &m_b, TileGrid &m_grid, FileInfo &m_srsFileInfo)
{
(void)m_grid;
(void)m_srsFileInfo;

//---------
// pass 2: write the final LAS/LAZ tiles

Expand Down Expand Up @@ -661,7 +664,7 @@ static void tilingPass2(BaseInfo &m_b, TileGrid &m_grid, FileInfo &m_srsFileInfo

PointViewPtr view(new pdal::PointView(table));

int ptCnt = 0;
std::size_t ptCnt = 0;
std::ifstream fileReader(binFile,std::ios::binary|std::ios::ate);
if (!fileReader)
{
Expand All @@ -681,7 +684,7 @@ static void tilingPass2(BaseInfo &m_b, TileGrid &m_grid, FileInfo &m_srsFileInfo
{
size_t nPointsToRead = std::min(readChunkSize, ptCnt-i);
fileReader.read(contentPtr, nPointsToRead*m_b.pointSize);
for (int a = 0; a < nPointsToRead; ++a)
for (size_t a = 0; a < nPointsToRead; ++a)
{
char *base = contentPtr + a * m_b.pointSize;
for (const untwine::FileDimInfo& fdi : dims)
Expand Down
2 changes: 1 addition & 1 deletion external/pdal_wrench/to_raster.cpp
Expand Up @@ -128,7 +128,7 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, double r
// TODO: "writers.gdal: Requested driver 'COG' does not support file creation.""
// writer_opts.add(pdal::Option("gdaldriver", "COG"));

pdal::StageCreationOptions opts{ tile->outputFilename, "", nullptr, writer_opts };
pdal::StageCreationOptions opts{ tile->outputFilename, "", nullptr, writer_opts, nullptr };
Stage& w = manager->makeWriter( opts );
for (Stage *stage : readers)
{
Expand Down
2 changes: 1 addition & 1 deletion external/pdal_wrench/to_raster_tin.cpp
Expand Up @@ -126,7 +126,7 @@ std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, double resoluti
writer_opts.add(pdal::Option("data_type", "float32")); // default was float64 which seems like too much
writer_opts.add(pdal::Option("gdalopts", "TILED=YES"));
writer_opts.add(pdal::Option("gdalopts", "COMPRESS=DEFLATE"));
Stage &w = manager->makeWriter(tile->outputFilename, "writers.raster", faceRaster);
(void)manager->makeWriter(tile->outputFilename, "writers.raster", faceRaster);

return manager;
}
Expand Down
6 changes: 3 additions & 3 deletions external/pdal_wrench/to_vector.cpp
Expand Up @@ -65,13 +65,13 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, const st
writer_opts.add(pdal::Option("where", tile->filterExpression));
}

Stage& w = manager->makeWriter( tile->outputFilename, "writers.ogr", r, writer_opts);
(void)manager->makeWriter( tile->outputFilename, "writers.ogr", r, writer_opts);

return manager;
}


void ToVector::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void ToVector::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &)
{
if (ends_with(inputFile, ".vpc"))
{
Expand Down Expand Up @@ -109,7 +109,7 @@ void ToVector::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& p
}
}

void ToVector::finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines)
void ToVector::finalize(std::vector<std::unique_ptr<PipelineManager>>&)
{
if (tileOutputFiles.empty())
return;
Expand Down
4 changes: 2 additions & 2 deletions external/pdal_wrench/translate.cpp
Expand Up @@ -131,7 +131,7 @@ static std::unique_ptr<PipelineManager> pipeline(ParallelJobInfo *tile, std::str
}


void Translate::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &bounds, point_count_t &totalPoints)
void Translate::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>& pipelines, const BOX3D &, point_count_t &)
{
if (ends_with(inputFile, ".vpc"))
{
Expand Down Expand Up @@ -175,7 +175,7 @@ void Translate::preparePipelines(std::vector<std::unique_ptr<PipelineManager>>&
}
}

void Translate::finalize(std::vector<std::unique_ptr<PipelineManager>>& pipelines)
void Translate::finalize(std::vector<std::unique_ptr<PipelineManager>>&)
{
if (tileOutputFiles.empty())
return;
Expand Down
2 changes: 1 addition & 1 deletion external/pdal_wrench/utils.hpp
Expand Up @@ -155,7 +155,7 @@ struct CRS
// The returned value remains internal to the OGRSpatialReference
// and should not be freed, or modified. It may be invalidated on
// the next OGRSpatialReference call.
double u = ptr->GetLinearUnits(&units);
(void)ptr->GetLinearUnits(&units);
std::string tmp(units);
Utils::trim(tmp);
return tmp;
Expand Down

0 comments on commit 3342172

Please sign in to comment.