[GRASS-dev] r.in.lidar tuning
Markus Neteler
neteler at osgeo.org
Fri May 16 15:02:56 PDT 2014
(back to an older topic)
On Tue, Oct 8, 2013 at 8:37 PM, Markus Neteler wrote:
> On Tue, Oct 8, 2013 at 4:31 PM, Markus Metz wrote:
>> Markus Neteler wrote:
[ wish for r.in.lidar: ]
...
>>> filter Only import points of selected return type
>>> If not specified, all points are imported
>>> options: first,last,mid
>>>
>>> which would be great for r.in.lidar as well to avoid that I need to
>>> split the file with las2las beforehand.
>>
>> Why would you want to do filtering? The r.in.lidar methods min, max,
>> mean, median, percentile are not sufficient?
For some LAS files not.
> I omitted to mention the sometimes existing classification of returns
> and had in mind to be able to restrict the import to e.g. ground
> points only, or the like. Then apply the methods min, max, etc only to
> the selected subset of LiDAR points.
I have implemented that now in
http://trac.osgeo.org/grass/changeset/60247/grass/trunk/raster/r.in.lidar
(hope I got it right over from v.in.lidar)
Concerning Doug's intensity wish which also became mine yesterday:
Attached a patch to import intensity values rather than z values (flag -i).
Using -i all statistics are applied to intensity.
The code is a bit simple ("ugly") since the variable names further on
in the code remain related to "z" rather than e.g. become a generic
"value". Not sure if all related variables should be renamed, hence I
didn't commit that to SVN.
Please try from svn + attached patch.
markusN
-------------- next part --------------
Index: raster/r.in.lidar/main.c
===================================================================
--- raster/r.in.lidar/main.c (revision 60271)
+++ raster/r.in.lidar/main.c (working copy)
@@ -146,7 +146,7 @@
struct Option *input_opt, *output_opt, *percent_opt, *type_opt, *filter_opt;
struct Option *method_opt, *zrange_opt, *zscale_opt;
struct Option *trim_opt, *pth_opt, *res_opt;
- struct Flag *print_flag, *scan_flag, *shell_style, *over_flag, *extents_flag;
+ struct Flag *print_flag, *scan_flag, *shell_style, *over_flag, *extents_flag, *intens_flag;
/* LAS */
LASReaderH LAS_reader;
@@ -277,6 +277,11 @@
shell_style->description =
_("In scan mode, print using shell script style");
+ intens_flag = G_define_flag();
+ intens_flag->key = 'i';
+ intens_flag->description =
+ _("Import intensity values rather than z values");
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -761,7 +766,11 @@
x = LASPoint_GetX(LAS_point);
y = LASPoint_GetY(LAS_point);
- z = LASPoint_GetZ(LAS_point);
+ if (intens_flag->answer)
+ /* use z variable here to allow for scaling of intensity below */
+ z = LASPoint_GetIntensity(LAS_point);
+ else
+ z = LASPoint_GetZ(LAS_point);
if (return_filter != LAS_ALL) {
int return_no = LASPoint_GetReturnNumber(LAS_point);
More information about the grass-dev
mailing list