These are chat archives for PDAL/PDAL

20th
Mar 2017
Michael Rosen
@mrosen
Mar 20 2017 18:13
Given a LAS file in projection system 26917, how should I be able to to use the tindex command to create a boundary vector file in that same projection system? Here are two that didn't work.
msr@msr-laptop ~/data/PDALPresentation $ rm -fr temp
msr@msr-laptop ~/data/PDALPresentation $ pdal tindex --tindex temp --filespec C18075.las --fast_boundary --t_srs EPSG:26917
Warning 6: Field modified create as date field, though DateTime requested.
Warning 6: Field created create as date field, though DateTime requested.
PDAL: Unable to transform geometry from source to target SRS for /home/msr/data/PDALPresentation/C18075.las'. Message is 'Unable to transform geometry.'

msr@msr-laptop ~/data/PDALPresentation $ rm -fr temp
msr@msr-laptop ~/data/PDALPresentation $ pdal tindex --tindex temp --filespec C18075.las --fast_boundary --t_srs 26917
Warning 6: Field modified create as date field, though DateTime requested.
Warning 6: Field created create as date field, though DateTime requested.
(Error) GDAL failure (6) No translation for an empty SRS to PROJ.4 format is known.
PDAL: Unable to transform geometry from source to target SRS for /home/msr/data/PDALPresentation/C18075.las'. Message is 'Unable to transform geometry.'

msr@msr-laptop ~/data/PDALPresentation $
Michael Rosen
@mrosen
Mar 20 2017 18:33
What is the best way to use PDAL to get an overview of existing classifications in a LAS file? Related, perhaps, is there a way to get a concise (not JSON-wrapped) dump of the information similar to what "PDAL info" provides?
Howard Butler
@hobu
Mar 20 2017 19:17
There's a filters.stats option called enumerate where you can give a dimension name and it will provide you a summary table
I'll try to replicate your tindex issue with C18075.las tomorrow
Michael Rosen
@mrosen
Mar 20 2017 19:25

Am I doing it wrong?

msr@msr-laptop ~/data/PDALPresentation $ echo '
{
  "pipeline":[
     "C18075.las",
     {
       "type":"filters.stats",
       "enumerate":"Classification"
     }
   ]
}' | pdal pipeline -s -v 5

no output

Howard Butler
@hobu
Mar 20 2017 19:28
heh, you can't "pdal info" a pipeline -- a running argument with the PDAL devs for a while.
pdal info --filters.stats.enumerate="Classification" test/data/las/1.2-with-color.las
Ask on the list why you can't "pdal info" a pipeline, and why it seems like a natural thing to do ;)
Michael Rosen
@mrosen
Mar 20 2017 19:31
Thx. My more immediate question would be ... how would I possibly know to do something like that? Needs to be more discoverable. Something in "pdal info --help" I'll put something on the list about this.
We are available for consulting, you know :P
(we don't make things purposely opaque, obviously)
Michael Rosen
@mrosen
Mar 20 2017 19:33
we're just getting started ... but yeah, we'll be in touch.
Howard Butler
@hobu
Mar 20 2017 19:34
habitualize the idea that you can override options as command line arguments in pdal info and pdal translate invocations. We need to highlight that in docs more, as that's where most of the power lies
(or make all your own pipelines, and pass them into pdal info and they do nothing. But I'm not bitter)
Andrew Bell
@abellgithub
Mar 20 2017 20:16
This message was deleted
I don't understand the question above? The output from pdal info isn't what's wanted?
Andrew Bell
@abellgithub
Mar 20 2017 20:22
If you want to dump the metadata that's generated, you can just add "--metadata=<output file>" to the command line you had above. "--metadata=stdout" would have given pretty much the same output as pdal info.
Michael Rosen
@mrosen
Mar 20 2017 20:25

What's desired is a concise answer to "what sort of classification is there in this LAS file?" A good answer would be a concise summary like the one provided by LASinfo:

  Point Classifications
---------------------------------------------------------
    1702236 Unclassified (1) 
    1470148 Ground (2) 
    11336 Low Point (noise) (7)

Howards suggestion gives some of this but it's hard to read and takes a long time to calculate:

      {
        "average": 1.483134195,
        "count": 3183720,
        "kurtosis": 7.538851989e+14,
        "maximum": 7,
        "minimum": 1,
        "name": "Classification",
        "position": 8,
        "skewness": 2.177305049e+14,
        "stddev": 0.5971066706,
        "values":
        [
          1,
          2,
          7
        ],
Andrew Bell
@abellgithub
Mar 20 2017 21:29

@mrosen Lastools is faster than PDAL for handling LAS because it doesn't support multiple formats and each command is specialized for a particular task. If you've built PDAL yourself, make sure that it's built for release mode -- the difference is huge.

As far as the output style goes, lastools is geared for use by humans to read while PDAL is geared for automated processing. And again, supporting only a single format allows lastools to know more about what might be expected as reasonable output where PDAL needs to work more generically.

PDAL can give you the counts of classifications (or any other dimension) with something like: bin/pdal info --filters.stats.dimensions=Classification --filters.stats.count="Classification" <filename>

Michael Rosen
@mrosen
Mar 20 2017 21:33
Thanks for this @abellgithub .
Howard Butler
@hobu
Mar 20 2017 22:40
@mrosen check out the jq command for ripping through PDAL output to extract the keys and summaries you want https://stedolan.github.io/jq/