| 1 |
<h2>DESCRIPTION</h2> |
| 2 |
|
| 3 |
The <em><a href="r.in.lidar.html">r.in.lidar</a></em> module |
| 4 |
is very similar to the <em>r3.in.lidar</em> module and many parts of |
| 5 |
its documentation apply also for <em>r3.in.lidar</em>. |
| 6 |
|
| 7 |
<p> |
| 8 |
<img src="r3_in_lidar.png"> |
| 9 |
<p> |
| 10 |
<em> |
| 11 |
Figure: Proportional count of points per 3D cell. When 50% of all |
| 12 |
points in a vertical column fall into a given 3D cell, the value |
| 13 |
is 0.5. Here, the green color was assigned to 0.5, red to 1 and |
| 14 |
yellow to 0. The figure shows vertical slices and green color |
| 15 |
indicates high vegetation while red color indicates bare ground. |
| 16 |
</em> |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
<h2>NOTES</h2> |
| 24 |
|
| 25 |
<ul> |
| 26 |
<li> |
| 27 |
This module is new and partially experimental. Please don't rely |
| 28 |
on its interface and be critical towards its outputs. |
| 29 |
Please report issues on the mailing list or in the bug tracker</li>. |
| 30 |
<li> |
| 31 |
No reprojection is performed, you need to reproject ahead or |
| 32 |
use a GRASS project with the coordinate system that matches that of the data.</li> |
| 33 |
<li> |
| 34 |
Some temporary maps are created but not cleaned up. Use of |
| 35 |
<b>--overwrite</b> might be necessary even when not desired.</li> |
| 36 |
<li> |
| 37 |
Expects points to have intensity and causing random (undefined) |
| 38 |
result for related outputs (<b>sum, mean, proportional_sum</b>) |
| 39 |
when the intensity is not present but the outputs were requested.</li> |
| 40 |
</ul> |
| 41 |
|
| 42 |
<h2>EXAMPLES</h2> |
| 43 |
|
| 44 |
<h3>Basic import of the data</h3> |
| 45 |
|
| 46 |
Set the region according to a 2D raster and adding 3D minimum |
| 47 |
(bottom), maximum (top) and vertical (top-bottom) resolution. |
| 48 |
|
| 49 |
<div class="code"><pre> |
| 50 |
g.region rast=secref b=80 t=160 tbres=5 -p3 |
| 51 |
</pre></div> |
| 52 |
|
| 53 |
Now, <em>r3.in.lidar</em> will create the 3D raster of the size |
| 54 |
given by the computation region: |
| 55 |
|
| 56 |
<div class="code"><pre> |
| 57 |
r3.in.lidar input=points.las n=points_n sum=points_sum \ |
| 58 |
mean=points_mean proportional_n=points_n_prop \ |
| 59 |
proportional_sum=points_sum_prop |
| 60 |
</pre></div> |
| 61 |
|
| 62 |
<h3>Point density vertical structure reduced to the terrain</h3> |
| 63 |
|
| 64 |
Create ground raster: |
| 65 |
|
| 66 |
<div class="code"><pre> |
| 67 |
r.in.lidar input=points.las output=ground method=mean class_filter=2 |
| 68 |
</pre></div> |
| 69 |
|
| 70 |
Set vertical extent of computational region to (relative) coordinates |
| 71 |
above ground: |
| 72 |
|
| 73 |
<div class="code"><pre> |
| 74 |
g.region rast=secref b=0 t=47 -p3 |
| 75 |
</pre></div> |
| 76 |
|
| 77 |
Compute point density: |
| 78 |
|
| 79 |
<div class="code"><pre> |
| 80 |
r3.in.lidar input=points.las n=points_n sum=points_sum \ |
| 81 |
mean=points_mean proportional_n=points_n_prop \ |
| 82 |
proportional_sum=points_sum_prop \ |
| 83 |
base_raster=ground |
| 84 |
</pre></div> |
| 85 |
|
| 86 |
<h3>Complete workflow for vertical structure analysis</h3> |
| 87 |
|
| 88 |
Compute the point density of points in 2D while setting the output |
| 89 |
extent to be based on the data (<b>-e</b>) and the resolution set to |
| 90 |
a relatively high number (here 10 map units, i.e. meters for |
| 91 |
metric projections). |
| 92 |
|
| 93 |
<div class="code"><pre> |
| 94 |
r.in.lidar input=points.las output=points_n method=n -e resolution=10 |
| 95 |
</pre></div> |
| 96 |
|
| 97 |
This step can be repeated with using different resolutions (and the |
| 98 |
<b>--overwrite</b> flag) to determine the resolution for the further |
| 99 |
analysis. |
| 100 |
|
| 101 |
<p> |
| 102 |
The <b>class_filter</b> option should be also provided if only part of |
| 103 |
the points is analyzed, for example <code>class_filter=3,4,5</code> would be |
| 104 |
used for low, medium, and high vegetation if the LAS file follows the |
| 105 |
usedstandard ASPRS class numbers. |
| 106 |
|
| 107 |
<p> |
| 108 |
The resolution should be suitable for computing digital elevation model |
| 109 |
which will be computed in the next steps. |
| 110 |
Once you decided on the resolution, you can use the 2D raster to set the |
| 111 |
computational region extent and resolution: |
| 112 |
|
| 113 |
<div class="code"><pre> |
| 114 |
g.region raster=points_n -p3 |
| 115 |
</pre></div> |
| 116 |
|
| 117 |
<code>class_filter=2</code> is used to limit |
| 118 |
|
| 119 |
<div class="code"><pre> |
| 120 |
r.in.lidar input=points.las output=ground_mean method=mean class_filter=2 |
| 121 |
</pre></div> |
| 122 |
|
| 123 |
The following steps are not necessary if the point density is high |
| 124 |
enough to fill the raster continuously. |
| 125 |
|
| 126 |
<p> |
| 127 |
Convert the raster to vector point resulting in a decimated point cloud: |
| 128 |
|
| 129 |
<div class="code"><pre> |
| 130 |
v.to.rast input=ground_mean type=point output=ground_decimated use=z |
| 131 |
</pre></div> |
| 132 |
|
| 133 |
Interpolate the ground surface from the decimated ground points: |
| 134 |
|
| 135 |
<div class="code"><pre> |
| 136 |
v.surf.rst input=ground_decimated elevation=ground |
| 137 |
</pre></div> |
| 138 |
|
| 139 |
Now we need to determine upper vertical limit for the 3D raster |
| 140 |
(the top value from <code>g.region -p3</code>). This can be potentially |
| 141 |
done with lower resolution. The <b>-d</b> flag ensures that the ground |
| 142 |
raster will be used in its actual resolution regardless of the |
| 143 |
resolution of the output. |
| 144 |
|
| 145 |
<div class="code"><pre> |
| 146 |
r.in.lidar input=points.las method=max output=veg_max class_filter=3,4,5 base_raster=ground -d |
| 147 |
</pre></div> |
| 148 |
|
| 149 |
With that, we can finally set up the 3D extent and resolution: |
| 150 |
|
| 151 |
<div class="code"><pre> |
| 152 |
g.region rast=secref b=0 t=40 res=1 res3=1 -p3 |
| 153 |
</pre></div> |
| 154 |
|
| 155 |
Note that the 2D and 3D resolutions are separate so that user can |
| 156 |
perform the 2D calculations on a finer resolution than the 3D |
| 157 |
calculations. The vertical resolution can be and often is set to a |
| 158 |
different value as well. Here we use the same value for all resolutions |
| 159 |
for simplicity. |
| 160 |
|
| 161 |
<p> |
| 162 |
Finally, we perform the 3D binning where we count number of points per |
| 163 |
cell (voxel): |
| 164 |
|
| 165 |
<div class="code"><pre> |
| 166 |
r3.in.lidar input=points.las n=n class_filter=3,4,5 base_raster=ground -d |
| 167 |
</pre></div> |
| 168 |
|
| 169 |
<h2>REFERENCES</h2> |
| 170 |
|
| 171 |
<ul> |
| 172 |
<li> |
| 173 |
V. Petras, A. Petrasova, J. Jeziorska, H. Mitasova (2016): |
| 174 |
<em>Processing UAV and lidar point clouds in GRASS GIS</em>. |
| 175 |
XXIII ISPRS Congress 2016 |
| 176 |
[<a href="https://doi.org/10.5194/isprs-archives-XLI-B7-945-2016">ISPRS Archives</a>, |
| 177 |
<a href="https://www.researchgate.net/publication/304340172_Processing_UAV_and_lidar_point_clouds_in_GRASS_GIS">ResearchGate</a>]</li> |
| 178 |
<li> |
| 179 |
<a href="https://www.asprs.org/committee-general/laser-las-file-format-exchange-activities.html"> |
| 180 |
ASPRS LAS format</a></li> |
| 181 |
<li> |
| 182 |
<a href="https://liblas.org/">LAS library</a></li> |
| 183 |
<li> |
| 184 |
<a href="https://liblas.org/doxygen/liblas_8h.html">LAS library C API</a> documentation</li> |
| 185 |
</ul> |
| 186 |
|
| 187 |
<h2>SEE ALSO</h2> |
| 188 |
|
| 189 |
<em> |
| 190 |
<a href="r3.in.xyz.html">r3.in.xyz</a>, |
| 191 |
<a href="r.in.lidar.html">r.in.lidar</a>, |
| 192 |
<a href="v.in.lidar.html">v.in.lidar</a>, |
| 193 |
<a href="r.to.rast3.html">r.to.rast3</a>, |
| 194 |
<a href="r3.to.rast.html">r3.to.rast</a>, |
| 195 |
<a href="r3.mapcalc.html">r3.mapcalc</a>, |
| 196 |
<a href="g.region.html">g.region</a> |
| 197 |
</em> |
| 198 |
|
| 199 |
<h2>AUTHOR</h2> |
| 200 |
|
| 201 |
Vaclav Petras, <a href="https://geospatial.ncsu.edu/geoforall/">NCSU GeoForAll Lab</a> |