Skip to content

Commit

Permalink
updating readme, formatting on arg name, adding help to build_vpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McCarthy authored and wonder-sk committed Jun 6, 2023
1 parent 269654a commit 51590cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ To create a virtual point cloud:
pdal_wrench build_vpc --output=hello.vpc data1.las data2.las data3.las
```

Or, if the inputs are listed in a text file:
```
data1.las
data2.las
data3.las
```

You can provide that file as input:
```
pdal_wrench build_vpc --output=hello.vpc --input-file-list=inputs.txt
```

Afterwards, other algorithms can be applied to a VPC:
```
pdal_wrench clip --input=hello.vpc --polygon=clip.gpkg --output=hello_clipped.vpc
Expand Down
13 changes: 11 additions & 2 deletions src/vpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace fs = std::filesystem;
#include "nlohmann/json.hpp"



using json = nlohmann::json;

using namespace pdal;
Expand Down Expand Up @@ -403,14 +402,16 @@ void buildVpc(std::vector<std::string> args)
bool overview = false;
int max_threads = -1;
bool verbose = false;
bool help = false;

ProgramArgs programArgs;
programArgs.add("help,h", "Output command help.", help);
programArgs.add("output,o", "Output virtual point cloud file", outputFile);
programArgs.add("files,f", "input files", inputFiles).setPositional();
programArgs.add("input-file-list", "Read input files from a txt file, one file per line.", inputFileList);
programArgs.add("boundary", "Calculate boundary polygons from data", boundaries);
programArgs.add("stats", "Calculate statistics from data", stats);
programArgs.add("overview", "Create overview point cloud from source data", overview);
programArgs.add("input_file_list", "Read input files from a txt file, one file per line.", inputFileList);

pdal::Arg& argThreads = programArgs.add("threads", "Max number of concurrent threads for parallel runs", max_threads);
programArgs.add("verbose", "Print extra debugging output", verbose);
Expand All @@ -425,6 +426,14 @@ void buildVpc(std::vector<std::string> args)
return;
}

if (help)
{

std::cout << "usage: pdal_wrench build_vpc [<args>]" << std::endl;
programArgs.dump(std::cerr, 2, Utils::screenWidth());
return;
}

if (!inputFileList.empty())
{
std::ifstream inputFile(inputFileList);
Expand Down

0 comments on commit 51590cd

Please sign in to comment.