Last active
November 20, 2017 20:53
-
-
Save chambbj/5ae996a69095212165191358768b2af3 to your computer and use it in GitHub Desktop.
Revisions
-
chambbj revised this gist
Nov 20, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,11 +34,11 @@ We've [briefly discussed](https://github.com/PDAL/PDAL/pull/1693) a new filter t }, { "type":"filters.assign", "assignment":"TempClass![2:2]=0" }, { "type":"filters.groupby", "dimension":"TempClass" }, { "type":"writers.las", -
chambbj revised this gist
Nov 20, 2017 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,14 +4,14 @@ Now a brute force solution immediately came to mind. What if we reassigned every ```json { "pipeline":[ { "type":"filters.assign", "assignment":"Classification![2:2]=0" }, { "type":"filters.groupby", "dimension":"Classification" }, { "type":"writers.las", @@ -27,18 +27,18 @@ We've [briefly discussed](https://github.com/PDAL/PDAL/pull/1693) a new filter t ```json { "pipeline":[ { "type":"filters.ferry", "dimensions":"Classification=TempClass" }, { "type":"filters.assign", “assignment":"TempClass![2:2]=0" }, { "type":"filters.groupby", “dimension":"TempClass" }, { "type":"writers.las", -
chambbj created this gist
Nov 20, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ We recently had a user inquire about how to split their LAS file by classification, resulting in one file with all ground returns (classification = 2) and another with everything else. While we have the `filters.groupby` filter that can do something very close to this, you'd actually end up with individual files for **every** classification present. Now a brute force solution immediately came to mind. What if we reassigned everything but ground to a common value with `filters.assign` and then used `filters.groupby`? ```json { “pipeline”:[ { “type”:”filters.assign”, “assignment”:”Classification![2:2]=0” }, { “type”:”filters.groupby”, “dimension”:”Classification” }, { "type":"writers.las", "filename":"output_#.las" } ] } ``` The obvious drawback to this approach is that while you have succesfully split your point cloud based on the ground/non-ground criteria, you've now lost all classification information for your non-ground points. No good. We've [briefly discussed](https://github.com/PDAL/PDAL/pull/1693) a new filter that would enable splitting on any number of specified DimRanges, which would've been perfect for this situation, but in the meantime, the following pipeline that creates a temporary dimension first using `filters.ferry` is all we need. ```json { “pipeline”:[ { “type”:”filters.ferry”, “dimensions”:”Classification=TempClass” }, { “type”:”filters.assign”, “assignment”:”TempClass![2:2]=0” }, { “type”:”filters.groupby”, “dimension”:”TempClass” }, { "type":"writers.las", "filename":"output_#.las" } ] } ``` This is of course nearly identical to the first pipeline, except that we have first copied the classification values to a new, temporary dimension called `TempClass`. All assignment and groupby operations are applied to the temporary dimension, leaving the original classifications in tact!