These are chat archives for PDAL/PDAL

20th
Nov 2017
Andrew Bell
@abellgithub
Nov 20 2017 17:16
@maphew : Here's an example of looping files with powershell:
$indir="Documents\inlas"
$outdir="Documents\outlas"
get-childitem $indir |
foreach-object {
$_.extension
  if ($_.Extension -ne ".las") {
    continue
  }
  $outname = $outdir + "\" + $_.name
  pdal translate $_.fullname $outname
}
I'm sure there are better ways, but it's pretty simple. You need to turn on things so that you can execute PowerShell scripts. There are a few ways to do this. Here's one: https://4sysops.com/archives/set-powershell-execution-policy-with-group-policy/
pandu-rao
@pandu-rao
Nov 20 2017 17:22
is it possible to use a single pdal pipeline to split a las file into two (based on some condition, say)? first part has all points of classification 2, the second is all points of classification not 2. i'm currently using two pipelines to achieve this. since the condition is mutually exclusive, it seems like it should be possible. thanks.
Andrew Bell
@abellgithub
Nov 20 2017 17:40
Theoretically, yes, but I don't know that there is a filter that will do this right now. We've had discussions about modifying filters.groupby to support this. It's pretty simple to write your own filter to do this.
chambbj
@chambbj
Nov 20 2017 18:42

@pandu-rao The sledgehammer approach would be to assign everything but class 2 to some fixed value, and then proceed with groupby, but I suspect this may not be desirable (losing the other classifications). The other thing you could do would be to ferry first, creating a temporary dimension, then assigning and using groupby on the temporary dimension, and then proceeding with the rest of your pipeline.

I’ve not tried this, but it may look something like this (assuming you already have your classifications in the input data):

{
    “pipeline”:[
        {
            “type”:”filters.ferry”,
            “dimensions”:”Classification=TempClass”
        },
        {
            “type”:”filters.assign”,
            “assignment”:”TempClass![2:2]=0”
        },
        {
            “type”:”filters.groupby”,
            “dimension”:”TempClass”
        }
    ]
}
pandu-rao
@pandu-rao
Nov 20 2017 18:44
@chambbj interesting! how would i then write to two different files?
or does groupby do that for me automatically?
chambbj
@chambbj
Nov 20 2017 18:44
Just add a writer with a filename containing a #.
pandu-rao
@pandu-rao
Nov 20 2017 18:44
aah, okay. thanks
chambbj
@chambbj
Nov 20 2017 18:44
E.g., output_#.las
Howard Butler
@hobu
Nov 20 2017 18:44
(only writers.las supports that at the moment, IIRC
pandu-rao
@pandu-rao
Nov 20 2017 18:45
would the # resolve consistently to file-suffixes that match the stages?
chambbj
@chambbj
Nov 20 2017 18:46
they are just numbered sequentially, don’t even remember if it starts with 0 or 1, but don’t be misled into thinking that it’s drawn from the actual classification values
pandu-rao
@pandu-rao
Nov 20 2017 18:46
i'll try it out. thanks, much @chambbj !
chambbj
@chambbj
Nov 20 2017 18:46
np, let us know if it works
pandu-rao
@pandu-rao
Nov 20 2017 18:47
trying right now. am curious
Andrew Bell
@abellgithub
Nov 20 2017 19:27
A bunch of writers support multiple output files: OGR, BPF, GDAL, LAS.
Others could support if it there was demand.
pandu-rao
@pandu-rao
Nov 20 2017 19:45
yes, that works
thanks, @chambbj
pandu-rao
@pandu-rao
Nov 20 2017 20:54
i'm not sure if the output sequence number is consistent
for example, for file 1, output_1 and output_2 are (ground and non_ground) respectively
for file 2, output_2 and output_1 are (ground and non_ground) respectively
chambbj
@chambbj
Nov 20 2017 21:53
@pandu-rao It is initializing the output PointViews in the order points are visited. So I’m guessing that point number one in your first file is a ground point, while point number one in your second file is a non-ground. There is quite a bit that we would like to do to make the automatic output filenames more intelligent — we can now add this to the list.
Howard Butler
@hobu
Nov 20 2017 21:54
We'd also take a patch on the topic if you are so inclined :)
chambbj
@chambbj
Nov 20 2017 22:01
FWIW, ticket created at PDAL/PDAL#1729.
pandu-rao
@pandu-rao
Nov 20 2017 23:26
thank you, @chambbj