This file is indexed.

/usr/share/doc/pdal/html/pipeline.html is in pdal-doc 1.6.0-1build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Pipeline &mdash; pdal.io</title>
  

  
  
    <link rel="shortcut icon" href="_static/favicon.ico"/>
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  
    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
  

  
        <link rel="author" title="About these documents"
              href="about.html"/>
        <link rel="index" title="Index"
              href="genindex.html"/>
        <link rel="search" title="Search" href="search.html"/>
    <link rel="top" title="pdal.io" href="index.html"/>
        <link rel="next" title="Readers" href="stages/readers.html"/>
        <link rel="prev" title="Community" href="community.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> PDAL
          

          
          </a>

          
            
            
              <div class="version">
                1.6.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
                <ul>
<li class="toctree-l1"><a class="reference internal" href="about.html">About</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="download.html">Download</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="apps/index.html">Applications</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="community.html">Community</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Pipeline</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#simple-example">Simple Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="#reprojection-example">Reprojection Example</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#pipeline-objects">Pipeline Objects</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#pipeline-array">Pipeline Array</a></li>
<li class="toctree-l3"><a class="reference internal" href="#stage-objects">Stage Objects</a></li>
<li class="toctree-l3"><a class="reference internal" href="#filename-globbing">Filename Globbing</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#extended-examples">Extended Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#bpf-to-las">BPF to LAS</a></li>
<li class="toctree-l3"><a class="reference internal" href="#python-hag">Python HAG</a></li>
<li class="toctree-l3"><a class="reference internal" href="#dtm">DTM</a></li>
<li class="toctree-l3"><a class="reference internal" href="#decimate-colorize">Decimate &amp; Colorize</a></li>
<li class="toctree-l3"><a class="reference internal" href="#merge-reproject">Merge &amp; Reproject</a></li>
<li class="toctree-l3"><a class="reference internal" href="#globbed-inputs">Globbed Inputs</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#api-considerations">API Considerations</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#usage">Usage</a></li>
<li class="toctree-l3"><a class="reference internal" href="#stage-types">Stage Types</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="stages/readers.html">Readers</a></li>
<li class="toctree-l1"><a class="reference internal" href="stages/writers.html">Writers</a></li>
<li class="toctree-l1"><a class="reference internal" href="stages/filters.html">Filters</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="dimensions.html">Dimensions</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorials</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="workshop/index.html">Workshop</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="development/index.html">Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="api/index.html">API</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="copyright.html">License</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="references.html">References</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="index.html">PDAL</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          





<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="index.html">Home</a> &raquo;</li>
      
    <li>Pipeline</li>
    <li class="wy-breadcrumbs-aside">
      
        
      
    </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="pipeline">
<span id="id1"></span><h1>Pipeline<a class="headerlink" href="#pipeline" title="Permalink to this headline"></a></h1>
<p>Pipelines are the operative construct in PDAL, and it is how data are modeled
from reading, processing, and writing. PDAL internally constructs a pipeline to
perform data translation operations using <a class="reference internal" href="apps/translate.html#translate-command"><span class="std std-ref">translate</span></a>, for
example. While specific <a class="reference internal" href="apps/index.html#apps"><span class="std std-ref">applications</span></a> are useful in many contexts,
a pipeline provides useful advantages for more complex things:</p>
<ol class="arabic simple">
<li>You have a record of the operation(s) applied to the data</li>
<li>You can construct a skeleton of an operation and substitute specific
options (filenames, for example)</li>
<li>You can construct complex operations using the <a class="reference external" href="http://www.json.org/">JSON</a> manipulation
facilities of whatever language you want.</li>
</ol>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference internal" href="apps/pipeline.html#pipeline-command"><span class="std std-ref">pipeline</span></a> is used to invoke pipeline operations
via the command line.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">As of PDAL 1.2, <a class="reference external" href="http://www.json.org/">JSON</a> is the preferred specification language
for PDAL pipelines. XML was dropped at the 1.6 release.</p>
</div>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>A JSON object represents a PDAL processing pipeline.  The structure is always a
JSON object, with the primary object called <code class="docutils literal"><span class="pre">pipeline</span></code> being an array of
inferred or explicit PDAL <a class="reference internal" href="#stage-object"><span class="std std-ref">Stage Objects</span></a> representations.</p>
<div class="section" id="simple-example">
<h3>Simple Example<a class="headerlink" href="#simple-example" title="Permalink to this headline"></a></h3>
<p>A simple PDAL pipeline, inferring the appropriate drivers for the reader and
writer from filenames, and able to be specified as a set of sequential steps:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="s2">&quot;input.las&quot;</span><span class="p">,</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;crop&quot;</span><span class="p">,</span>
            <span class="nt">&quot;bounds&quot;</span><span class="p">:</span><span class="s2">&quot;([0,100],[0,100])&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;output.bpf&quot;</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="figure" id="id3">
<img alt="_images/las-crop-bpf-pipeline.png" src="_images/las-crop-bpf-pipeline.png" />
<p class="caption"><span class="caption-text">A simple pipeline to convert <a class="reference internal" href="stages/readers.las.html#readers-las"><span class="std std-ref">LAS</span></a> to <a class="reference internal" href="stages/readers.bpf.html#readers-bpf"><span class="std std-ref">BPF</span></a>
while only keeping points inside the box <span class="math">\([0 \leq x \leq 100, 0 \leq y \leq 100]\)</span>.</span></p>
</div>
</div>
<div class="section" id="reprojection-example">
<h3>Reprojection Example<a class="headerlink" href="#reprojection-example" title="Permalink to this headline"></a></h3>
<p>A more complex PDAL pipeline reprojects the stage tagged <code class="docutils literal"><span class="pre">A1</span></code>, merges
the result with <code class="docutils literal"><span class="pre">B</span></code>, and writes the merged output to a GeoTIFF file
with the <a class="reference internal" href="stages/writers.gdal.html#writers-gdal"><span class="std std-ref">writers.gdal</span></a> writer:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;A.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;spatialreference&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:26916&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;filters.reprojection&quot;</span><span class="p">,</span>
            <span class="nt">&quot;in_srs&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:26916&quot;</span><span class="p">,</span>
            <span class="nt">&quot;out_srs&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:4326&quot;</span><span class="p">,</span>
            <span class="nt">&quot;tag&quot;</span><span class="p">:</span><span class="s2">&quot;A2&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;B.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;tag&quot;</span><span class="p">:</span><span class="s2">&quot;B&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;filters.merge&quot;</span><span class="p">,</span>
            <span class="nt">&quot;tag&quot;</span><span class="p">:</span><span class="s2">&quot;merged&quot;</span><span class="p">,</span>
            <span class="nt">&quot;inputs&quot;</span><span class="p">:[</span>
                <span class="s2">&quot;A2&quot;</span><span class="p">,</span>
                <span class="s2">&quot;B&quot;</span>
            <span class="p">]</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;writers.gdal&quot;</span><span class="p">,</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;output.tif&quot;</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="figure" id="id4">
<img alt="_images/reproject-merge-pipeline.png" src="_images/reproject-merge-pipeline.png" />
<p class="caption"><span class="caption-text">A more complex pipeline that merges two inputs together but uses
<a class="reference internal" href="stages/filters.reprojection.html#filters-reprojection"><span class="std std-ref">filters.reprojection</span></a> to transform the coordinate system of
file <code class="docutils literal"><span class="pre">B.las</span></code> from <a class="reference external" href="http://spatialreference.org/ref/epsg/nad83-utm-zone-16n/">UTM</a> to <a class="reference external" href="http://spatialreference.org/ref/epsg/4326/">Geographic</a>.</span></p>
</div>
</div>
</div>
<div class="section" id="pipeline-objects">
<h2>Pipeline Objects<a class="headerlink" href="#pipeline-objects" title="Permalink to this headline"></a></h2>
<p>PDAL JSON pipelines always consist of a single object. This object (referred to
as the PDAL JSON object below) represents a processing pipeline.</p>
<ul class="simple">
<li>The PDAL JSON object may have any number of members (name/value pairs).</li>
<li>The PDAL JSON object must have a <a class="reference internal" href="#pipeline-array"><span class="std std-ref">Pipeline Array</span></a>.</li>
</ul>
<div class="section" id="pipeline-array">
<span id="id2"></span><h3>Pipeline Array<a class="headerlink" href="#pipeline-array" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>The pipeline array may have any number of string or <a class="reference internal" href="#stage-object"><span class="std std-ref">Stage Objects</span></a>
elements.</li>
<li>String elements shall be interpreted as filenames. PDAL will attempt to infer
the proper driver from the file extension and position in the array. A writer
stage will only be created if the string is the final element in the array.</li>
</ul>
</div>
<div class="section" id="stage-objects">
<span id="stage-object"></span><h3>Stage Objects<a class="headerlink" href="#stage-objects" title="Permalink to this headline"></a></h3>
<p>For more on PDAL stages and their options, check the PDAL documentation on
<a class="reference internal" href="stages/readers.html#readers"><span class="std std-ref">Readers</span></a>, <a class="reference internal" href="stages/writers.html#writers"><span class="std std-ref">Writers</span></a>, and <a class="reference internal" href="stages/filters.html#filters"><span class="std std-ref">Filters</span></a>.</p>
<ul class="simple">
<li>A stage object may have a member with the name <code class="docutils literal"><span class="pre">tag</span></code> whose value is a
string. The purpose of the tag is to cross-reference this stage within other
stages. Each <code class="docutils literal"><span class="pre">tag</span></code> must be unique.</li>
<li>A stage object may have a member with the name <code class="docutils literal"><span class="pre">inputs</span></code> whose value is an
array of strings. Each element in the array is the tag of another stage to be
set as input to the current stage.</li>
<li>Reader stages will disregard the <code class="docutils literal"><span class="pre">inputs</span></code> member.</li>
<li>If <code class="docutils literal"><span class="pre">inputs</span></code> is not specified for the first non-reader stage, all reader
stages leading up to the current stage will be used as inputs.</li>
<li>If <code class="docutils literal"><span class="pre">inputs</span></code> is not specified for any subsequent non-reader stages, the
previous stage in the array will be used as input.</li>
<li>A <code class="docutils literal"><span class="pre">tag</span></code> mentioned in another stage’s <code class="docutils literal"><span class="pre">inputs</span></code>  must have been previously
defined in the <code class="docutils literal"><span class="pre">pipeline</span></code> array.</li>
<li>A reader or writer stage object may have a member with the name <code class="docutils literal"><span class="pre">type</span></code> whose
value is a string. The <code class="docutils literal"><span class="pre">type</span></code> must specify a valid PDAL reader or writer
name.</li>
<li>A filter stage object must have a member with the name <code class="docutils literal"><span class="pre">type</span></code> whose value is
a string. The <code class="docutils literal"><span class="pre">type</span></code> must specify a valid PDAL filter name.</li>
<li>A stage object may have additional members with names corresponding to
stage-specific option names and their respective values. Values provided as
JSON objects or arrays will be stringified and parsed within the stage.</li>
<li>Applications can place a <code class="docutils literal"><span class="pre">user_data</span></code> node on any stage object and it will be
carried through to any serialized pipeline output.</li>
</ul>
</div>
<div class="section" id="filename-globbing">
<h3>Filename Globbing<a class="headerlink" href="#filename-globbing" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>A filename may contain the wildcard character <code class="docutils literal"><span class="pre">*</span></code> to match any string of
characters. This can be useful if working with multiple input files in a
directory (e.g., merging all files).</li>
</ul>
</div>
</div>
<div class="section" id="extended-examples">
<h2>Extended Examples<a class="headerlink" href="#extended-examples" title="Permalink to this headline"></a></h2>
<div class="section" id="bpf-to-las">
<h3>BPF to LAS<a class="headerlink" href="#bpf-to-las" title="Permalink to this headline"></a></h3>
<p>The following pipeline converts the input file from <a class="reference internal" href="stages/readers.bpf.html#readers-bpf"><span class="std std-ref">BPF</span></a> to
<a class="reference internal" href="stages/writers.las.html#writers-las"><span class="std std-ref">LAS</span></a>, inferring both the reader and writer type, and
setting a number of options on the writer stage.</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="s2">&quot;utm15.bpf&quot;</span><span class="p">,</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;out2.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;scale_x&quot;</span><span class="p">:</span><span class="mf">0.01</span><span class="p">,</span>
            <span class="nt">&quot;offset_x&quot;</span><span class="p">:</span><span class="mf">311898.23</span><span class="p">,</span>
            <span class="nt">&quot;scale_y&quot;</span><span class="p">:</span><span class="mf">0.01</span><span class="p">,</span>
            <span class="nt">&quot;offset_y&quot;</span><span class="p">:</span><span class="mf">4703909.84</span><span class="p">,</span>
            <span class="nt">&quot;scale_z&quot;</span><span class="p">:</span><span class="mf">0.01</span><span class="p">,</span>
            <span class="nt">&quot;offset_z&quot;</span><span class="p">:</span><span class="mf">7.385474</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="python-hag">
<h3>Python HAG<a class="headerlink" href="#python-hag" title="Permalink to this headline"></a></h3>
<p>In our next example, the reader and writer types are once again inferred. After
reading the input file, the ferry filter is used to copy the Z dimension into a
new height above ground (HAG) dimension. Next, the <a class="reference internal" href="stages/filters.python.html#filters-python"><span class="std std-ref">filters.python</span></a>
is used with a Python script to compute height above ground values by comparing
the Z values to a surface model. These height above ground values are then
written back into the Z dimension for further analysis. See the Python
code at <a class="reference external" href="https://raw.githubusercontent.com/PDAL/PDAL/master/test/data/autzen/hag.py.in">hag.py</a>.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="stages/filters.hag.html#filters-hag"><span class="std std-ref">filters.hag</span></a> describes using a specific filter to do
this job in more detail.</p>
</div>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="s2">&quot;autzen.las&quot;</span><span class="p">,</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;ferry&quot;</span><span class="p">,</span>
            <span class="nt">&quot;dimensions&quot;</span><span class="p">:</span><span class="s2">&quot;Z=HAG&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;filters.python&quot;</span><span class="p">,</span>
            <span class="nt">&quot;script&quot;</span><span class="p">:</span><span class="s2">&quot;hag.py&quot;</span><span class="p">,</span>
            <span class="nt">&quot;function&quot;</span><span class="p">:</span><span class="s2">&quot;filter&quot;</span><span class="p">,</span>
            <span class="nt">&quot;module&quot;</span><span class="p">:</span><span class="s2">&quot;anything&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;autzen-hag.las&quot;</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="dtm">
<h3>DTM<a class="headerlink" href="#dtm" title="Permalink to this headline"></a></h3>
<p>A common task is to create a digital terrain model (DTM) from the input point
cloud. This pipeline infers the reader type, applies an approximate ground
segmentation filter using <a class="reference internal" href="stages/filters.pmf.html#filters-pmf"><span class="std std-ref">filters.pmf</span></a>, filters out all points but the
ground returns (classification value of 2) using the <a class="reference internal" href="stages/filters.range.html#filters-range"><span class="std std-ref">filters.range</span></a>, and
then creates the DTM using the <a class="reference internal" href="stages/writers.gdal.html#writers-gdal"><span class="std std-ref">writers.gdal</span></a>.</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="s2">&quot;autzen-full.las&quot;</span><span class="p">,</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;ground&quot;</span><span class="p">,</span>
            <span class="nt">&quot;approximate&quot;</span><span class="p">:</span><span class="kc">true</span><span class="p">,</span>
            <span class="nt">&quot;max_window_size&quot;</span><span class="p">:</span><span class="mi">33</span><span class="p">,</span>
            <span class="nt">&quot;slope&quot;</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span>
            <span class="nt">&quot;max_distance&quot;</span><span class="p">:</span><span class="mf">2.5</span><span class="p">,</span>
            <span class="nt">&quot;initial_distance&quot;</span><span class="p">:</span><span class="mf">0.15</span><span class="p">,</span>
            <span class="nt">&quot;cell_size&quot;</span><span class="p">:</span><span class="mf">1.0</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;range&quot;</span><span class="p">,</span>
            <span class="nt">&quot;limits&quot;</span><span class="p">:</span><span class="s2">&quot;Classification[2:2]&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;writers.gdal&quot;</span><span class="p">,</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;autzen-surface.tif&quot;</span><span class="p">,</span>
            <span class="nt">&quot;output_type&quot;</span><span class="p">:</span><span class="s2">&quot;min&quot;</span><span class="p">,</span>
            <span class="nt">&quot;output_format&quot;</span><span class="p">:</span><span class="s2">&quot;tif&quot;</span><span class="p">,</span>
            <span class="nt">&quot;grid_dist_x&quot;</span><span class="p">:</span><span class="mf">1.0</span><span class="p">,</span>
            <span class="nt">&quot;grid_dist_y&quot;</span><span class="p">:</span><span class="mf">1.0</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="decimate-colorize">
<h3>Decimate &amp; Colorize<a class="headerlink" href="#decimate-colorize" title="Permalink to this headline"></a></h3>
<p>This example still infers the reader and writer types while applying options on
both. The pipeline decimates the input LAS file by keeping every other point,
and then colorizes the points using the provided raster image. The output is
written as ASCII text.</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;1.2-with-color.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;spatialreference&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:2993&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;decimation&quot;</span><span class="p">,</span>
            <span class="nt">&quot;step&quot;</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span>
            <span class="nt">&quot;offset&quot;</span><span class="p">:</span><span class="mi">1</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;colorization&quot;</span><span class="p">,</span>
            <span class="nt">&quot;raster&quot;</span><span class="p">:</span><span class="s2">&quot;autzen.tif&quot;</span><span class="p">,</span>
            <span class="nt">&quot;dimensions&quot;</span><span class="p">:</span><span class="s2">&quot;Red:1:1, Green:2:1, Blue:3:1&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;junk.txt&quot;</span><span class="p">,</span>
            <span class="nt">&quot;delimiter&quot;</span><span class="p">:</span><span class="s2">&quot;,&quot;</span><span class="p">,</span>
            <span class="nt">&quot;write_header&quot;</span><span class="p">:</span><span class="kc">false</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="merge-reproject">
<h3>Merge &amp; Reproject<a class="headerlink" href="#merge-reproject" title="Permalink to this headline"></a></h3>
<p>Our first example with multiple readers, this pipeline infers the reader types,
and assigns spatial reference information to each. Next, the
<a class="reference internal" href="stages/filters.merge.html#filters-merge"><span class="std std-ref">filters.merge</span></a> merges points from all previous readers, and the
<a class="reference internal" href="stages/filters.reprojection.html#filters-reprojection"><span class="std std-ref">filters.reprojection</span></a> filter reprojects data to the specified output
spatial reference system.</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;1.2-with-color.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;spatialreference&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:2027&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;filename&quot;</span><span class="p">:</span><span class="s2">&quot;1.2-with-color.las&quot;</span><span class="p">,</span>
            <span class="nt">&quot;spatialreference&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:2027&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;filters.merge&quot;</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="nt">&quot;type&quot;</span><span class="p">:</span><span class="s2">&quot;reprojection&quot;</span><span class="p">,</span>
            <span class="nt">&quot;out_srs&quot;</span><span class="p">:</span><span class="s2">&quot;EPSG:2028&quot;</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="globbed-inputs">
<h3>Globbed Inputs<a class="headerlink" href="#globbed-inputs" title="Permalink to this headline"></a></h3>
<p>Finally, we capture another merge pipeline demonstrating the ability to glob
multiple input LAS files from a given directory.</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
        <span class="s2">&quot;/path/to/data/\*.las&quot;</span><span class="p">,</span>
        <span class="s2">&quot;output.las&quot;</span>
    <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">The PDAL source tree contains a number of example pipelines that
are used for testing. You might find these inspiring. Go to
<a class="reference external" href="https://github.com/PDAL/PDAL/tree/master/test/data/pipeline">https://github.com/PDAL/PDAL/tree/master/test/data/pipeline</a> to find
more.</p>
</div>
</div>
</div>
<div class="section" id="api-considerations">
<h2>API Considerations<a class="headerlink" href="#api-considerations" title="Permalink to this headline"></a></h2>
<p>A <cite>Pipeline</cite> is composed as an array of <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Stage</span></code> , with the
first stage at the beginning and the last at the end.  There are two primary
building blocks in PDAL, <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Stage</span></code> and
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::PointView</span></code>. <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Reader</span></code>,
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Writer</span></code>, and <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Filter</span></code> are all subclasses of
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Stage</span></code>.</p>
<p><code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::PointView</span></code> is the substrate that flows between stages in a
pipeline and transfers the actual data as it moves through the pipeline. A
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::PointView</span></code> contains a <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::PointTablePtr</span></code>, which
itself contains a list of <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Dimension</span></code> objects that define the
actual channels that are stored in the <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::PointView</span></code>.</p>
<p>PDAL provides four types of stages – <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Reader</span></code>,
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Writer</span></code>, <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Filter</span></code>, and
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::MultiFilter</span></code> – with the latter being hardly used (just
<a class="reference internal" href="stages/filters.merge.html#filters-merge"><span class="std std-ref">filters.merge</span></a>) at this point. A Reader is a producer of data, a Writer
is a consumer of data, and a Filter is an actor on data.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As a C++ API consumer, you are generally not supposed to worry about the underlying
storage of the PointView, but there might be times when you simply just
“want the data.” In those situations, you can use the
<code class="xref cpp cpp-func docutils literal"><span class="pre">pdal::PointView::getBytes()</span></code> method to stream out the raw storage.</p>
</div>
<div class="section" id="usage">
<h3>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h3>
<p>While pipeline objects are manipulable through C++ objects, the other, more
convenient way is through an JSON syntax. The JSON syntax mirrors the
arrangement of the Pipeline, with options and auxiliary metadata added on a
per-stage basis.</p>
<p>We have two use cases specifically in mind:</p>
<ul class="simple">
<li>a <a class="reference internal" href="apps/pipeline.html#pipeline-command"><span class="std std-ref">command-line</span></a> application that reads an JSON
file to allow a user to easily construct arbitrary writer pipelines, as
opposed to having to build applications custom to individual needs with
arbitrary options, filters, etc.</li>
<li>a user can provide JSON for a reader pipeline, construct it via a simple call
to the PipelineManager API, and then use the <code class="xref cpp cpp-func docutils literal"><span class="pre">pdal::Stage::read()</span></code>
function to perform the read and then do any processing of the points.  This
style of operation is very appropriate for using PDAL from within
environments like Python where the focus is on just getting the points, as
opposed to complex pipeline construction.</li>
</ul>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="nt">&quot;pipeline&quot;</span><span class="p">:[</span>
    <span class="s2">&quot;/path/to/my/file/input.las&quot;</span><span class="p">,</span>
    <span class="s2">&quot;output.las&quot;</span>
  <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference external" href="https://github.com/PDAL/PDAL/blob/master/test/data/pipeline/">https://github.com/PDAL/PDAL/blob/master/test/data/pipeline/</a> contains
test suite pipeline files that provide an excellent example of the
currently possible operations.</p>
</div>
</div>
<div class="section" id="stage-types">
<h3>Stage Types<a class="headerlink" href="#stage-types" title="Permalink to this headline"></a></h3>
<p><code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Reader</span></code>, <code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Writer</span></code>, and
<code class="xref cpp cpp-class docutils literal"><span class="pre">pdal::Filter</span></code> are the C++ classes that define the stage types in
PDAL. Readers follow the pattern of <a class="reference internal" href="stages/readers.las.html#readers-las"><span class="std std-ref">readers.las</span></a> or
<a class="reference internal" href="stages/readers.oci.html#readers-oci"><span class="std std-ref">readers.oci</span></a>, Writers follow the pattern of <a class="reference internal" href="stages/writers.las.html#writers-las"><span class="std std-ref">writers.las</span></a> or
<a class="reference internal" href="stages/readers.oci.html#readers-oci"><span class="std std-ref">readers.oci</span></a>, with Filters using <a class="reference internal" href="stages/filters.reprojection.html#filters-reprojection"><span class="std std-ref">filters.reprojection</span></a> or
<a class="reference internal" href="stages/filters.crop.html#filters-crop"><span class="std std-ref">filters.crop</span></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference internal" href="stages/index.html#stage-index"><span class="std std-ref">Readers, Writers, and Filters</span></a> contains a full listing of possible stages and
descriptions of their options.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Issuing the command <code class="docutils literal"><span class="pre">pdal</span> <span class="pre">info</span> <span class="pre">--options</span></code> will list all available
stages and their options. See <a class="reference internal" href="apps/info.html#info-command"><span class="std std-ref">info</span></a> for more.</p>
</div>
</div>
</div>
</div>


           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="stages/readers.html" class="btn btn-neutral float-right" title="Readers" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="community.html" class="btn btn-neutral" title="Community" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
                    &copy;  2017
                        <a href="http://github.com/hobu">Howard Butler</a>,
                        <a href="http://github.com/mpgerlek">Michael Gerlek</a>,
                        and
                        <a href="https://github.com/PDAL/PDAL/graphs/contributors">others</a>.
      Last updated on Dec 17, 2017.

    </p>
  </div> 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'1.6.0',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="_static/mathjax/MathJax.js?config=tex-ams-mml_htmlormml"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
  
    <div class="footer">
        <div class="container">
                    &copy;  2017
                        <a href="http://github.com/hobu">Howard Butler</a>,
                        <a href="http://github.com/mpgerlek">Michael Gerlek</a>,
                        and
                        <a href="https://github.com/PDAL/PDAL/graphs/contributors">others</a>,
                Last updated
                    on Dec 17, 2017.
        </div>
    </div>

</body>
</html>