adding and visualizing own attributes

317 views
Skip to first unread message

Ruben Ulbrich

unread,
Jul 6, 2020, 3:05:20 PM7/6/20
to LAStools - efficient tools for LiDAR processing

Hi rapidlasso team,

We are working with an older Sick LD MRS 400001 scanner on an UAV. I am able to convert our collected data (x, y, z, time, return number, scan angle) to a las dataset with the help of your toolbox (txt2las). Now I am trying to add am additional attribute, the echo width.

 

txt2las -i data.txt ^

                -set_version 1.4 ^

                -parse xyztr0a ^

                -add_attribute 5 “echo width” “wave length [ns]” 0.01 ^

                -o sample.las

 

Checking the resulting “sample.las” file with lasinfo, it tells me that the attribute is there and found but if I try to visualize the attribute in lasview, I am not able to see a way to do this. Am I missing something or overlooking it?

 

Additionally, if I am able to add my own attribute, is there a way to filter the las dataset via lasfilter (or with a different tool)?

 

Here is the lasinfo output

 

reporting all LAS header entries:

  file signature:             'LASF'

  file source ID:             0

  global_encoding:            0

  project ID GUID data 1-4:   00000000-0000-0000-0000-000000000000

  version major.minor:        1.4

  system identifier:          'LAStools (c) by rapidlasso GmbH'

  generating software:        'las2las (version 200304)'

  file creation day/year:     176/2020

  header size:                227

  offset to point data:       567

  number var. length records: 2

  point data format:          1

  point data record length:   32

  number of point records:    2059967

  number of points by return: 1796636 251059 12272 0 0

  scale factor x y z:         0.01 0.01 0.01

  offset x y z:               600000 4600000 0

  min x y z:                  633783.61 4696033.95 203.92

  max x y z:                  633891.42 4696112.69 243.67

variable length header record 1 of 2:

  reserved             0

  user ID              'LASF_Spec'

  record ID            4

  length after header  192

  description          'by LAStools of rapidlasso GmbH'

    Extra Byte Descriptions

      data type: 5 (unsigned long), name "echo width", description: "wave length [ns] 0.01 -o D:\proj", scale: 1 (not set), offset: 0 (not set)

variable length header record 2 of 2:

  reserved             0

  user ID              'LASF_Projection'

  record ID            34735

  length after header  40

  description          'by LAStools of rapidlasso GmbH'

    GeoKeyDirectoryTag version 1.1.0 number of keys 4

      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected

      key 3072 tiff_tag_location 0 count 1 value_offset 32616 - ProjectedCSTypeGeoKey: WGS 84 / UTM 16N

      key 3076 tiff_tag_location 0 count 1 value_offset 9001 - ProjLinearUnitsGeoKey: Linear_Meter

      key 4099 tiff_tag_location 0 count 1 value_offset 9001 - VerticalUnitsGeoKey: Linear_Meter

reporting minimum and maximum for all LAS point record entries ...

  X             3378361    3389142

  Y             9603395    9611269

  Z               20392      24367

  intensity           0          0

  return_number       1          3

  number_of_returns   1          1

  edge_of_flight_line 0          0

  scan_direction_flag 0          0

  classification      0          0

  scan_angle_rank   -26         26

  user_data           0          0

  point_source_ID     0          0

  gps_time 1592344517.028000 1592344937.964000

WARNING: range violates GPS week time specified by global encoding bit 0

  attribute0          0          5  ('echo width')

number of first returns:        1796636

number of intermediate returns: 0

number of last returns:         2059967

number of single returns:       2059967

covered area in square meters/kilometers: 8220/0.01

point density: all returns 250.60 last only 250.60 (per square meter)

      spacing: all returns 0.06 last only 0.06 (in meters)

overview over number of returns of given pulse: 2059967 0 0 0 0 0 0

histogram of classification of points:

         2059967  never classified (0)

 

Any advice or assistance is highly appreciated.

Kind regards,

Ruben Ulbrich

Martin Isenburg

unread,
Jul 8, 2020, 12:12:24 AM7/8/20
to LAStools - efficient command line tools for LIDAR processing
Hello Ruben,

the easiest way to visualize this would be to map the attribute into the user data field. Run

lasview -h
[...]
Modify the user data.
  -set_user_data 0
  -scale_user_data 1.5
  -change_user_data_from_to 23 26
  -change_user_data_from_to 23 26
  -map_user_data map_file.txt
  -copy_scanner_channel_into_user_data
  -copy_attribute_into_user_data 1
  -add_scaled_attribute_to_user_data 0 10.0
[...]

so for you - given the user data field is zero - you can just run

lasview -i sample.las ^
             -add_scaled_attribute_to_user_data 0 51.0 ^
             -color_by_user_data

The scale factor of 51.0 I chose is supposed to map your 0 ... 5 attribute range to a 0 ... 255 range in the user data field that will use the full color range. You may want ot adjust this based on the histogram of the echo width distribution.


Martin

--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/975ec19f-5c35-415e-ab69-3b34a5cc345co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages