LAS Files with 4-Band RGB-IR Values - Is it Possible

1,098 views
Skip to first unread message

Mark Prenter

unread,
Feb 14, 2017, 6:08:22 PM2/14/17
to LAStools - efficient tools for LiDAR processing
Hi, we have had a few people ask us for 4-Band color-encoded LAS files.  Meaning instead of having only RGB values, they have a 4th band, Infra-red, also encoded in the LAS file.  Is something like this even possible?  I was under the impression that the LAS specification only supported 3 bands of color for colorization.

Thanks,
Mark Prenter

Martin Isenburg

unread,
Feb 14, 2017, 6:20:38 PM2/14/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

the point type 8 that was introduced with the latest 1.4 version of the LAS specification supports a NIR channel:


Regards,

Martin @rapidlasso 

Mark Prenter

unread,
Feb 19, 2017, 9:39:54 PM2/19/17
to LAStools - efficient tools for LiDAR processing
Thanks!

To your knowledge does any software support this for viewing yet?  We've had several clients ask about this but I'm not sure what software they are expecting to view this with.

Mark

Martin Isenburg

unread,
Feb 22, 2017, 1:30:09 AM2/22/17
to LAStools - efficient command line tools for LIDAR processing
Hello Mark,

you can already use the NIR band in LAStools to filter based on an on-the-fly computed NDVI value:


in the next release of LAStools I will also add a new LAStransform so that you can look at the NIR band simply via the intensity coloring:

lasview -i las14_with_NIR.las -copy_NIR_into_intensity

Regards,

Martin @rapidlasso

Mark Prenter

unread,
Mar 8, 2017, 2:48:12 AM3/8/17
to LAStools - efficient tools for LiDAR processing
Hello again, Martin.  

Will LASColor encode the NIR data from a 4-band source ortho (RGB-IR)?   Is there a method that would allow RGB-IR encoding using LASColor?

Thanks,
Mark Prenter

Martin Isenburg

unread,
Mar 8, 2017, 9:50:56 AM3/8/17
to LAStools - efficient command line tools for LIDAR processing
Hello Mark,

This is currently not directly possible but would be 'fairly trivial' to add.

Currently this is only possible via a bit of a "hack". I think you could run lascolor twice with two different TIFF images. The first (called 'nir.tif' below) either has only a NIR channel or the NIR channel in either the first (R), second (G), or third (B) band. Depending on the latter choose the correct transform '-copy_R_into_NIR', '-copy_G_into_NIR' or '-copy_B_into_NIR'. The second (called 'rgb.tif' below) has the usual three RGB channels in its first three bands. Try running this pipeline:

lascolor -i in.las ^
             -image nir.tif ^
             -o temp.las

lascolor -i temp.las ^
             -copy_R_into_NIR ^
             -image nir.tif ^
             -o out.las

or in piped operation (not tested) without creating a 'temp.las' file on disk:

lascolor -i in.las ^
             -image nir.tif ^
             -stdout |
lascolor -stdin ^
             -copy_R_into_NIR ^
             -image nir.tif ^
             -o out.las 

The above assumes that 'in.las' already uses point type 8  (if not use las2las to change point types). Otherwise add

las2las -i orig.las ^
            -set_version 1.4 ^
            -set_point_type 8 ^
            -o in.las

lascolor -i in.las ^
             -image nir.tif ^
             -o temp.las

lascolor -i temp.las ^
             -copy_R_into_NIR ^
             -image nir.tif ^
             -o out.las

or in piped operation (not tested) without creating a 'temp.las' or 'in.las' file on disk:

las2las -i orig.las ^
            -set_version 1.4 ^
            -set_point_type 8 ^
            -stdout ^
lascolor -stdin ^
             -image nir.tif ^
             -stdout |
lascolor -stdin ^
             -copy_R_into_NIR ^
             -image nir.tif ^
             -o out.las 

Not really sure if this works. Especially the piped variation. Especially in case your LAS files use EVLRs then it should not work at the moment (folks ... don't use EVLRs unless you really really have to). I would be happy to hear back from you if and how well this works for you (especially the piped version).

Regards,

Martin @rapidlasso 

Martin Isenburg

unread,
Mar 9, 2017, 12:25:12 PM3/9/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

in the meantime Mark has provided me with a sample pack of data and I was able (after fixing some typos in the piped version) run this process I had described earlier. Either run this with temp files on disk:

las2las -i 50_19.laz ^
            -rescale 0.01 0.01 0.01 ^
            -set_version 1.4 ^
            -set_point_type 8 ^
            -o 50_19_prdf8.las

lascolor -i 50_19_prdf8.las ^
             -image 50_19_IR.tif ^
             -o 50_19_prdf8_nir.las

lascolor -i 50_19_prdf8_nir.las ^
             -copy_R_into_NIR ^
             -image 50_19_RGB.tif ^
             -o 50_19_prdf8_nir_rgb.las

Or this avoiding all temp files using piping:

las2las -i 50_19.laz ^
            -rescale 0.01 0.01 0.01 ^
            -set_version 1.4 ^
            -set_point_type 8 ^
            -olas -stdout | ^
lascolor -stdin ^
             -image 50_19_IR.tif ^
            -olas -stdout | ^
lascolor -stdin ^
             -copy_R_into_NIR ^
             -image 50_19_RGB.tif ^
             -o 50_19_prdf8_pipe.las

=======
BEFORE
=======

lasinfo -i 50_19.laz
lasinfo (170203) report for 50_19.laz
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.2
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'lasclip (161114) commercial'
  file creation day/year:     39/2017
  header size:                227
  offset to point data:       563
  number var. length records: 3
  point data format:          2
  point data record length:   26
  number of point records:    36012001
  number of points by return: 36012001 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               660000 5550000 0
  min x y z:                  660000.000 5550000.000 1730.461
  max x y z:                  663000.000 5553000.000 2739.116
variable length header record 1 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  104
  description          'Georeferencing Information'
    GeoKeyDirectoryTag version 1.1.0 number of keys 12
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1026 tiff_tag_location 34737 count 24 value_offset 0 - GTCitationGeoKey: GCS_North_American_1983
      key 2048 tiff_tag_location 0 count 1 value_offset 4269 - GeographicTypeGeoKey: GCS_NAD83
      key 2054 tiff_tag_location 0 count 1 value_offset 9102 - GeogAngularUnitsGeoKey: Angular_Degree
      key 2056 tiff_tag_location 0 count 1 value_offset 7019 - GeogEllipsoidGeoKey: Ellipse_GRS_1980
      key 2057 tiff_tag_location 34736 count 1 value_offset 0 - GeogSemiMajorAxisGeoKey: 6378137
      key 2058 tiff_tag_location 34736 count 1 value_offset 1 - GeogSemiMinorAxisGeoKey: 6356752.314
      key 2059 tiff_tag_location 34736 count 1 value_offset 2 - GeogInvFlatteningGeoKey: 298.2572221
      key 3072 tiff_tag_location 0 count 1 value_offset 26911 - ProjectedCSTypeGeoKey: NAD83 / UTM 11N
      key 3073 tiff_tag_location 34737 count 22 value_offset 24 - PCSCitationGeoKey: NAD_1983_UTM_Zone_11N
      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
variable length header record 2 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34736
  length after header  24
  description          'Double Param Array'
    GeoDoubleParamsTag (number of doubles 3)
      6.37814e+006 6.35675e+006 298.257
variable length header record 3 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34737
  length after header  46
  description          'GeoAsciiParamsTag'
    GeoAsciiParamsTag (number of characters 46)
      GCS_North_American_1983|NAD_1983_UTM_Zone_11N|
LASzip compression (version 2.4r1 c2 50000): POINT10 2 RGB12 2
reporting minimum and maximum for all LAS point record entries ...
  X                   0    3000000
  Y                   0    3000000
  Z             1730461    2739116
  intensity           0          0
  return_number       1          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      0          0
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
  Color R 0 0
        G 0 0
        B 0 0
WARNING: there is coordinate resolution fluff (x10) in XY
WARNING: there is serious coordinate resolution fluff (x100) in XY
number of first returns:        36012001
number of intermediate returns: 0
number of last returns:         36012001
number of single returns:       36012001
WARNING: there are 36012001 points with a number of returns of given pulse of 0
histogram of classification of points:
        36012001  never classified (0)

------------------

gdalinfo 50_19_IR.tif
Driver: GTiff/GeoTIFF
Files: 50_19_IR.tif
       50_19_IR.tfw
Size is 6001, 6001
Coordinate System is:
PROJCS["NAD83 / UTM zone 11N",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26911"]]
Origin = (660000.000000000000000,5553000.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  660000.000, 5553000.000)
Lower Left  (  660000.000, 5549999.500)
Upper Right (  663000.500, 5553000.000)
Lower Right (  663000.500, 5549999.500)
Center      (  661500.250, 5551499.750)
Band 1 Block=6001x1 Type=Byte, ColorInterp=Gray
  Overviews: 3000x3000, 1500x1500, 750x750, 375x375, 187x187, 93x93, 46x46, 23x23

gdalinfo.exe 50_19_RGB.tif
Driver: GTiff/GeoTIFF
Files: 50_19_RGB.tif
       50_19_RGB.tfw
Size is 6001, 6001
Coordinate System is:
PROJCS["NAD83 / UTM zone 11N",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26911"]]
Origin = (660000.000000000000000,5553000.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  660000.000, 5553000.000)
Lower Left  (  660000.000, 5549999.500)
Upper Right (  663000.500, 5553000.000)
Lower Right (  663000.500, 5549999.500)
Center      (  661500.250, 5551499.750)
Band 1 Block=6001x1 Type=Byte, ColorInterp=Red
Band 2 Block=6001x1 Type=Byte, ColorInterp=Green
Band 3 Block=6001x1 Type=Byte, ColorInterp=Blue

=======
*AFTER* (with temp files)
=======

lasinfo -i 50_19_prdf8_nir_rgb.las ^
           -histo I 32
lasinfo (170203) report for 50_19_prdf8_nir_rgb.las
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:        'lascolor (170203) commercial'
  file creation day/year:     39/2017
  header size:                375
  offset to point data:       711
  number var. length records: 3
  point data format:          8
  point data record length:   38
  number of point records:    0
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               660000 5550000 0
  min x y z:                  660000.00 5550000.00 1730.46
  max x y z:                  663000.00 5553000.00 2739.12
  start of waveform data packet record: 0
  start of first extended variable length record: 0
  number of extended_variable length records: 0
  extended number of point records: 36012001
  extended number of points by return: 36012001 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  104
  description          'Georeferencing Information'
    GeoKeyDirectoryTag version 1.1.0 number of keys 12
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1026 tiff_tag_location 34737 count 24 value_offset 0 - GTCitationGeoKey: GCS_North_American_1983
      key 2048 tiff_tag_location 0 count 1 value_offset 4269 - GeographicTypeGeoKey: GCS_NAD83
      key 2054 tiff_tag_location 0 count 1 value_offset 9102 - GeogAngularUnitsGeoKey: Angular_Degree
      key 2056 tiff_tag_location 0 count 1 value_offset 7019 - GeogEllipsoidGeoKey: Ellipse_GRS_1980
      key 2057 tiff_tag_location 34736 count 1 value_offset 0 - GeogSemiMajorAxisGeoKey: 6378137
      key 2058 tiff_tag_location 34736 count 1 value_offset 1 - GeogSemiMinorAxisGeoKey: 6356752.314
      key 2059 tiff_tag_location 34736 count 1 value_offset 2 - GeogInvFlatteningGeoKey: 298.2572221
      key 3072 tiff_tag_location 0 count 1 value_offset 26911 - ProjectedCSTypeGeoKey: NAD83 / UTM 11N
      key 3073 tiff_tag_location 34737 count 22 value_offset 24 - PCSCitationGeoKey: NAD_1983_UTM_Zone_11N
      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
variable length header record 2 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34736
  length after header  24
  description          'Double Param Array'
    GeoDoubleParamsTag (number of doubles 3)
      6.37814e+006 6.35675e+006 298.257
variable length header record 3 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34737
  length after header  46
  description          'GeoAsciiParamsTag'
    GeoAsciiParamsTag (number of characters 46)
      GCS_North_American_1983|NAD_1983_UTM_Zone_11N|
reporting minimum and maximum for all LAS point record entries ...
  X                   0     300000
  Y                   0     300000
  Z              173046     273912
  intensity           0          0
  return_number       1          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      0          0
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
  gps_time 0.000000 0.000000
  Color R 7936 65280
        G 8960 64512
        B 6912 64768
      NIR 16128 65280
  extended_return_number          1      1
  extended_number_of_returns      0      0
  extended_classification         0      0
  extended_scan_angle             0      0
  extended_scanner_channel        0      0
WARNING: there is coordinate resolution fluff (x10) in XY
number of first returns:        36012001
number of intermediate returns: 0
number of last returns:         36012001
number of single returns:       36012001
WARNING: there are 36012001 points with a number of returns of given pulse of 0
histogram of classification of points:
        36012001  never classified (0)
color I channel histogram with bin size 32
  bin [16128,16160) has 1
  bin [16384,16416) has 1
  bin [16896,16928) has 1
  bin [17152,17184) has 9
  bin [17408,17440) has 95
  bin [17664,17696) has 605
  bin [17920,17952) has 2179
  bin [18176,18208) has 2875
  bin [18432,18464) has 3185
  bin [18688,18720) has 4239
  bin [18944,18976) has 7595
  bin [19200,19232) has 10513
  bin [19456,19488) has 13635
  bin [19712,19744) has 19435
  bin [19968,20000) has 30268
  bin [20224,20256) has 39604
  bin [20480,20512) has 55702
  bin [20736,20768) has 65726
  bin [20992,21024) has 82801
  bin [21248,21280) has 99128
  bin [21504,21536) has 117115
  bin [21760,21792) has 123506
  bin [22016,22048) has 137448
  bin [22272,22304) has 137413
  bin [22528,22560) has 130088
  bin [22784,22816) has 138167
  bin [23040,23072) has 145467
  bin [23296,23328) has 151823
  bin [23552,23584) has 159522
  bin [23808,23840) has 168547
  bin [24064,24096) has 177328
  bin [24320,24352) has 184577
  bin [24576,24608) has 191568
  bin [24832,24864) has 200074
  bin [25088,25120) has 206311
  bin [25344,25376) has 214033
  bin [25600,25632) has 222296
  bin [25856,25888) has 228261
  bin [26112,26144) has 231164
  bin [26368,26400) has 235186
  bin [26624,26656) has 239129
  bin [26880,26912) has 242817
  bin [27136,27168) has 245551
  bin [27392,27424) has 245075
  bin [27648,27680) has 243789
  bin [27904,27936) has 244668
  bin [28160,28192) has 242286
  bin [28416,28448) has 241394
  bin [28672,28704) has 241508
  bin [28928,28960) has 242210
  bin [29184,29216) has 241533
  bin [29440,29472) has 240262
  bin [29696,29728) has 239819
  bin [29952,29984) has 238189
  bin [30208,30240) has 236348
  bin [30464,30496) has 233643
  bin [30720,30752) has 232650
  bin [30976,31008) has 231371
  bin [31232,31264) has 230455
  bin [31488,31520) has 229736
  bin [31744,31776) has 227820
  bin [32000,32032) has 227800
  bin [32256,32288) has 226288
  bin [32512,32544) has 225769
  bin [32768,32800) has 225079
  bin [33024,33056) has 225606
  bin [33280,33312) has 226368
  bin [33536,33568) has 226223
  bin [33792,33824) has 225837
  bin [34048,34080) has 226969
  bin [34304,34336) has 226681
  bin [34560,34592) has 226703
  bin [34816,34848) has 227406
  bin [35072,35104) has 229125
  bin [35328,35360) has 229859
  bin [35584,35616) has 231069
  bin [35840,35872) has 232366
  bin [36096,36128) has 233053
  bin [36352,36384) has 234785
  bin [36608,36640) has 236450
  bin [36864,36896) has 236965
  bin [37120,37152) has 238278
  bin [37376,37408) has 240557
  bin [37632,37664) has 242848
  bin [37888,37920) has 243262
  bin [38144,38176) has 244028
  bin [38400,38432) has 245076
  bin [38656,38688) has 244791
  bin [38912,38944) has 246058
  bin [39168,39200) has 247305
  bin [39424,39456) has 248114
  bin [39680,39712) has 247296
  bin [39936,39968) has 248038
  bin [40192,40224) has 247758
  bin [40448,40480) has 248811
  bin [40704,40736) has 249693
  bin [40960,40992) has 249925
  bin [41216,41248) has 250143
  bin [41472,41504) has 250790
  bin [41728,41760) has 251210
  bin [41984,42016) has 253361
  bin [42240,42272) has 252443
  bin [42496,42528) has 254692
  bin [42752,42784) has 255382
  bin [43008,43040) has 257183
  bin [43264,43296) has 257615
  bin [43520,43552) has 259491
  bin [43776,43808) has 260411
  bin [44032,44064) has 263255
  bin [44288,44320) has 264178
  bin [44544,44576) has 266221
  bin [44800,44832) has 268266
  bin [45056,45088) has 272002
  bin [45312,45344) has 273537
  bin [45568,45600) has 276739
  bin [45824,45856) has 278776
  bin [46080,46112) has 282084
  bin [46336,46368) has 285328
  bin [46592,46624) has 288213
  bin [46848,46880) has 292512
  bin [47104,47136) has 296075
  bin [47360,47392) has 299171
  bin [47616,47648) has 301285
  bin [47872,47904) has 303640
  bin [48128,48160) has 309479
  bin [48384,48416) has 311215
  bin [48640,48672) has 314782
  bin [48896,48928) has 317908
  bin [49152,49184) has 321281
  bin [49408,49440) has 323313
  bin [49664,49696) has 325227
  bin [49920,49952) has 327694
  bin [50176,50208) has 328786
  bin [50432,50464) has 329338
  bin [50688,50720) has 329354
  bin [50944,50976) has 328510
  bin [51200,51232) has 328150
  bin [51456,51488) has 326684
  bin [51712,51744) has 325800
  bin [51968,52000) has 323929
  bin [52224,52256) has 320772
  bin [52480,52512) has 317687
  bin [52736,52768) has 314777
  bin [52992,53024) has 308780
  bin [53248,53280) has 304548
  bin [53504,53536) has 296769
  bin [53760,53792) has 290962
  bin [54016,54048) has 279030
  bin [54272,54304) has 270578
  bin [54528,54560) has 259978
  bin [54784,54816) has 248133
  bin [55040,55072) has 236227
  bin [55296,55328) has 224853
  bin [55552,55584) has 213131
  bin [55808,55840) has 200118
  bin [56064,56096) has 188122
  bin [56320,56352) has 175238
  bin [56576,56608) has 163825
  bin [56832,56864) has 151821
  bin [57088,57120) has 139914
  bin [57344,57376) has 128502
  bin [57600,57632) has 117524
  bin [57856,57888) has 107338
  bin [58112,58144) has 97488
  bin [58368,58400) has 88500
  bin [58624,58656) has 80196
  bin [58880,58912) has 72197
  bin [59136,59168) has 64935
  bin [59392,59424) has 58081
  bin [59648,59680) has 51183
  bin [59904,59936) has 45589
  bin [60160,60192) has 39897
  bin [60416,60448) has 34923
  bin [60672,60704) has 30767
  bin [60928,60960) has 26645
  bin [61184,61216) has 23050
  bin [61440,61472) has 19662
  bin [61696,61728) has 16559
  bin [61952,61984) has 13838
  bin [62208,62240) has 11500
  bin [62464,62496) has 9017
  bin [62720,62752) has 7012
  bin [62976,63008) has 5214
  bin [63232,63264) has 3656
  bin [63488,63520) has 2571
  bin [63744,63776) has 1815
  bin [64000,64032) has 1219
  bin [64256,64288) has 862
  bin [64512,64544) has 589
  bin [64768,64800) has 353
  bin [65024,65056) has 282
  bin [65280,65312) has 338
  average color I channel 40869.6 for 36012001 element(s)

=======
*AFTER* (with piping)
=======

lasinfo -i 50_19_prdf8_pipe.las ^
           -histo I 32
lasinfo (170203) report for 50_19_prdf8_pipe.las
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:        'lascolor (170203) commercial'
  file creation day/year:     39/2017
  header size:                375
  offset to point data:       711
  number var. length records: 3
  point data format:          8
  point data record length:   38
  number of point records:    36012001
  number of points by return: 36012001 0 0 0 0
  scale factor x y z:         0.01 0.01 0.01
  offset x y z:               660000 5550000 0
  min x y z:                  660000.00 5550000.00 1730.46
  max x y z:                  663000.00 5553000.00 2739.12
  start of waveform data packet record: 0
  start of first extended variable length record: 0
  number of extended_variable length records: 0
  extended number of point records: 36012001
  extended number of points by return: 36012001 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  104
  description          'Georeferencing Information'
    GeoKeyDirectoryTag version 1.1.0 number of keys 12
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1026 tiff_tag_location 34737 count 24 value_offset 0 - GTCitationGeoKey: GCS_North_American_1983
      key 2048 tiff_tag_location 0 count 1 value_offset 4269 - GeographicTypeGeoKey: GCS_NAD83
      key 2054 tiff_tag_location 0 count 1 value_offset 9102 - GeogAngularUnitsGeoKey: Angular_Degree
      key 2056 tiff_tag_location 0 count 1 value_offset 7019 - GeogEllipsoidGeoKey: Ellipse_GRS_1980
      key 2057 tiff_tag_location 34736 count 1 value_offset 0 - GeogSemiMajorAxisGeoKey: 6378137
      key 2058 tiff_tag_location 34736 count 1 value_offset 1 - GeogSemiMinorAxisGeoKey: 6356752.314
      key 2059 tiff_tag_location 34736 count 1 value_offset 2 - GeogInvFlatteningGeoKey: 298.2572221
      key 3072 tiff_tag_location 0 count 1 value_offset 26911 - ProjectedCSTypeGeoKey: NAD83 / UTM 11N
      key 3073 tiff_tag_location 34737 count 22 value_offset 24 - PCSCitationGeoKey: NAD_1983_UTM_Zone_11N
      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
variable length header record 2 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34736
  length after header  24
  description          'Double Param Array'
    GeoDoubleParamsTag (number of doubles 3)
      6.37814e+006 6.35675e+006 298.257
variable length header record 3 of 3:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34737
  length after header  46
  description          'GeoAsciiParamsTag'
    GeoAsciiParamsTag (number of characters 46)
      GCS_North_American_1983|NAD_1983_UTM_Zone_11N|
reporting minimum and maximum for all LAS point record entries ...
  X                   0     300000
  Y                   0     300000
  Z              173046     273912
  intensity           0          0
  return_number       1          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      0          0
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
  gps_time 0.000000 0.000000
  Color R 7936 65280
        G 8960 64512
        B 6912 64768
      NIR 16128 65280
  extended_return_number          1      1
  extended_number_of_returns      0      0
  extended_classification         0      0
  extended_scan_angle             0      0
  extended_scanner_channel        0      0
WARNING: there is coordinate resolution fluff (x10) in XY
number of first returns:        36012001
number of intermediate returns: 0
number of last returns:         36012001
number of single returns:       36012001
WARNING: point type is 8 but (legacy) number of point records in header is 36012001 instead zero.
WARNING: point type is 8 but (legacy) number of points by return [1] in header is 36012001 instead zero.
WARNING: there are 36012001 points with a number of returns of given pulse of 0
histogram of classification of points:
        36012001  never classified (0)
color I channel histogram with bin size 32
  bin [16128,16160) has 1
  bin [16384,16416) has 1
  bin [16896,16928) has 1
  bin [17152,17184) has 9
  bin [17408,17440) has 95
  bin [17664,17696) has 605
  bin [17920,17952) has 2179
  bin [18176,18208) has 2875
  bin [18432,18464) has 3185
  bin [18688,18720) has 4239
  bin [18944,18976) has 7595
  bin [19200,19232) has 10513
  bin [19456,19488) has 13635
  bin [19712,19744) has 19435
  bin [19968,20000) has 30268
  bin [20224,20256) has 39604
  bin [20480,20512) has 55702
  bin [20736,20768) has 65726
  bin [20992,21024) has 82801
  bin [21248,21280) has 99128
  bin [21504,21536) has 117115
  bin [21760,21792) has 123506
  bin [22016,22048) has 137448
  bin [22272,22304) has 137413
  bin [22528,22560) has 130088
  bin [22784,22816) has 138167
  bin [23040,23072) has 145467
  bin [23296,23328) has 151823
  bin [23552,23584) has 159522
  bin [23808,23840) has 168547
  bin [24064,24096) has 177328
  bin [24320,24352) has 184577
  bin [24576,24608) has 191568
  bin [24832,24864) has 200074
  bin [25088,25120) has 206311
  bin [25344,25376) has 214033
  bin [25600,25632) has 222296
  bin [25856,25888) has 228261
  bin [26112,26144) has 231164
  bin [26368,26400) has 235186
  bin [26624,26656) has 239129
  bin [26880,26912) has 242817
  bin [27136,27168) has 245551
  bin [27392,27424) has 245075
  bin [27648,27680) has 243789
  bin [27904,27936) has 244668
  bin [28160,28192) has 242286
  bin [28416,28448) has 241394
  bin [28672,28704) has 241508
  bin [28928,28960) has 242210
  bin [29184,29216) has 241533
  bin [29440,29472) has 240262
  bin [29696,29728) has 239819
  bin [29952,29984) has 238189
  bin [30208,30240) has 236348
  bin [30464,30496) has 233643
  bin [30720,30752) has 232650
  bin [30976,31008) has 231371
  bin [31232,31264) has 230455
  bin [31488,31520) has 229736
  bin [31744,31776) has 227820
  bin [32000,32032) has 227800
  bin [32256,32288) has 226288
  bin [32512,32544) has 225769
  bin [32768,32800) has 225079
  bin [33024,33056) has 225606
  bin [33280,33312) has 226368
  bin [33536,33568) has 226223
  bin [33792,33824) has 225837
  bin [34048,34080) has 226969
  bin [34304,34336) has 226681
  bin [34560,34592) has 226703
  bin [34816,34848) has 227406
  bin [35072,35104) has 229125
  bin [35328,35360) has 229859
  bin [35584,35616) has 231069
  bin [35840,35872) has 232366
  bin [36096,36128) has 233053
  bin [36352,36384) has 234785
  bin [36608,36640) has 236450
  bin [36864,36896) has 236965
  bin [37120,37152) has 238278
  bin [37376,37408) has 240557
  bin [37632,37664) has 242848
  bin [37888,37920) has 243262
  bin [38144,38176) has 244028
  bin [38400,38432) has 245076
  bin [38656,38688) has 244791
  bin [38912,38944) has 246058
  bin [39168,39200) has 247305
  bin [39424,39456) has 248114
  bin [39680,39712) has 247296
  bin [39936,39968) has 248038
  bin [40192,40224) has 247758
  bin [40448,40480) has 248811
  bin [40704,40736) has 249693
  bin [40960,40992) has 249925
  bin [41216,41248) has 250143
  bin [41472,41504) has 250790
  bin [41728,41760) has 251210
  bin [41984,42016) has 253361
  bin [42240,42272) has 252443
  bin [42496,42528) has 254692
  bin [42752,42784) has 255382
  bin [43008,43040) has 257183
  bin [43264,43296) has 257615
  bin [43520,43552) has 259491
  bin [43776,43808) has 260411
  bin [44032,44064) has 263255
  bin [44288,44320) has 264178
  bin [44544,44576) has 266221
  bin [44800,44832) has 268266
  bin [45056,45088) has 272002
  bin [45312,45344) has 273537
  bin [45568,45600) has 276739
  bin [45824,45856) has 278776
  bin [46080,46112) has 282084
  bin [46336,46368) has 285328
  bin [46592,46624) has 288213
  bin [46848,46880) has 292512
  bin [47104,47136) has 296075
  bin [47360,47392) has 299171
  bin [47616,47648) has 301285
  bin [47872,47904) has 303640
  bin [48128,48160) has 309479
  bin [48384,48416) has 311215
  bin [48640,48672) has 314782
  bin [48896,48928) has 317908
  bin [49152,49184) has 321281
  bin [49408,49440) has 323313
  bin [49664,49696) has 325227
  bin [49920,49952) has 327694
  bin [50176,50208) has 328786
  bin [50432,50464) has 329338
  bin [50688,50720) has 329354
  bin [50944,50976) has 328510
  bin [51200,51232) has 328150
  bin [51456,51488) has 326684
  bin [51712,51744) has 325800
  bin [51968,52000) has 323929
  bin [52224,52256) has 320772
  bin [52480,52512) has 317687
  bin [52736,52768) has 314777
  bin [52992,53024) has 308780
  bin [53248,53280) has 304548
  bin [53504,53536) has 296769
  bin [53760,53792) has 290962
  bin [54016,54048) has 279030
  bin [54272,54304) has 270578
  bin [54528,54560) has 259978
  bin [54784,54816) has 248133
  bin [55040,55072) has 236227
  bin [55296,55328) has 224853
  bin [55552,55584) has 213131
  bin [55808,55840) has 200118
  bin [56064,56096) has 188122
  bin [56320,56352) has 175238
  bin [56576,56608) has 163825
  bin [56832,56864) has 151821
  bin [57088,57120) has 139914
  bin [57344,57376) has 128502
  bin [57600,57632) has 117524
  bin [57856,57888) has 107338
  bin [58112,58144) has 97488
  bin [58368,58400) has 88500
  bin [58624,58656) has 80196
  bin [58880,58912) has 72197
  bin [59136,59168) has 64935
  bin [59392,59424) has 58081
  bin [59648,59680) has 51183
  bin [59904,59936) has 45589
  bin [60160,60192) has 39897
  bin [60416,60448) has 34923
  bin [60672,60704) has 30767
  bin [60928,60960) has 26645
  bin [61184,61216) has 23050
  bin [61440,61472) has 19662
  bin [61696,61728) has 16559
  bin [61952,61984) has 13838
  bin [62208,62240) has 11500
  bin [62464,62496) has 9017
  bin [62720,62752) has 7012
  bin [62976,63008) has 5214
  bin [63232,63264) has 3656
  bin [63488,63520) has 2571
  bin [63744,63776) has 1815
  bin [64000,64032) has 1219
  bin [64256,64288) has 862
  bin [64512,64544) has 589
  bin [64768,64800) has 353
  bin [65024,65056) has 282
  bin [65280,65312) has 338
  average color I channel 40869.6 for 36012001 element(s)

----------------------------------------

advanced LAStoolies may be able to explain the header difference ... (-:

lasdiff -i 50_19_prdf8_nir_rgb.las -i 50_19_prdf8_pipe.las
checking '50_19_prdf8_nir_rgb.las' against '50_19_prdf8_pipe.las'
  different number_of_point_records: 0 36012001
  different number_of_points_by_return[0]: 0 36012001
headers have 2 differences.
raw points are identical.
both have 36012001 points. took 40.45 secs.

Jung-kuan Liu

unread,
Mar 14, 2017, 5:18:42 PM3/14/17
to last...@googlegroups.com
Hi,

How do I add IR info. into a las/laz file which already has R G B info. with version 1.4? The CIR image is ready.

Thanks!
Ernie

Martin Isenburg

unread,
Mar 27, 2017, 9:46:35 PM3/27/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

today's LAStools release will make all folks in this discussion thread happy. You can now do the following with lascolor.


E:\LAStools\bin>lascolor -version
LAStools (by mar...@rapidlasso.com) version 170327 (academic)

:: add nir into NIR channel
lascolor -i las14.las -image nir.tif -nir -o las14mod.las
lascolor -i las14.las -image rgbnir.tif -nir -band 3 -o las14mod.las

:: add nir into intensity field
lascolor -i las12.laz -image nir.tif -nir -intensity -o las12mod.laz
lascolor -i las12.laz -image rgbnir.tif -nir -band 3 -intensity -o las12mod.laz

:: add rgb into RGB channels and nir into NIR channel
lascolor -i las14.las -image rgbnir.tif -rgbnir -o las14mod.las

:: add rgb into RGB channels and nir into intensity field
lascolor -i las12.laz -image rgbnir.tif -rgbnir -intensity -o las12mod.laz

:: add grey into all three RGB channels 
lascolor -i las12.laz -image grey.tif -grey -o las12mod.laz

:: add grey into intensity field
lascolor -i las12.laz -image grey.tif -grey -intensity -o las12mod.laz

:: add nir into intensity field
lascolor -i las12.laz -image nir.tif -nir intensity -o las12mod.laz
lascolor -i las12.laz -image rgbnir.tif -nir -band 3 -o las12mod.laz

:: replace red channel only
lascolor -i las12.laz -image red.tif -red -o las12mod.laz
lascolor -i las12.laz -image rgb.tif -red -o las12mod.laz
lascolor -i las12.laz -image rgbnir.tif -red -o las12mod.laz

:: replace green channel only
lascolor -i las12.laz -image green.tif -green -o las12mod.laz
lascolor -i las12.laz -image rgb.tif -green -band 1 -o las12mod.laz
lascolor -i las12.laz -image rgbnir.tif -green -band 1 -o las12mod.laz

:: replace blue channel only
lascolor -i las12.laz -image blue.tif -blue -o las12mod.laz
lascolor -i las12.laz -image rgb.tif -blue -band 2 -o las12mod.laz
lascolor -i las12.laz -image rgbnir.tif -blue -band 2 -o las12mod.laz

Let me know if I broke anything but I spend a number of hours testing instead of surfing ... (-:

Regards,

Martin @rapidlasso

Mark Prenter

unread,
Mar 29, 2017, 11:50:17 AM3/29/17
to LAStools - efficient tools for LiDAR processing
It works AWESOME!!!

Thank you!!!

Mark
...

Jung-kuan Liu

unread,
Mar 30, 2017, 5:08:27 PM3/30/17
to last...@googlegroups.com
This is great. However, it came out another question for you. I have two V. 1.2 Laz files, one is saved as RGB for color info. and the other is saved as IRRG (color IR). Would it be possible to use "Lascolor" to integrate these two and came out one LAZ file with RGBIR (of course IR will be saved as intensity) info. with V.1.2?

Thanks!
Ernie

Martin Isenburg

unread,
Mar 31, 2017, 9:30:02 AM3/31/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

indeed that is possible using a combination of las2las and lascopy.

Let's first copy the IR channel from the R channel into the intensity field. In the next version there will be a LAStransform called '-copy_R_into_intensity' but for now we have to do with this little trick:


las2las -i irrg.laz ^
            -copy_R_into_NIR ^
            -copy_NIR_into_intensity ^
            -o irrg_ir_int.laz

now we use lascopy to copy the intensity channel of the result to the rgb.laz file:


lascopy -i irrg_ir_int.laz ^
             -i rgb.laz ^
             -intensity ^
             -o rgb_ir_int.laz

Regards,

Martin

ggtdm...@gmail.com

unread,
Oct 23, 2017, 11:02:21 AM10/23/17
to LAStools - efficient tools for LiDAR processing
Good morning Martin.

I could use some pointers for a problem that is just a slight variation on the previous question(s).

I too have a pair of V. 1.2 Laz files (PDRF3), one containing R-G-B data in the color fields and the other containing IR-R-G in the color fields.  I need to combine this file pair into a single LAS1.4 LAZ file (PDRF8) in which the R-G-B-NIR fields are properly populated.

What LASTOOLS command(s) would allow me to achieve this?  I've tried a few variations based on some of the commands from this thread, but cannot seem to get the right result.

I'm also curious what options I would have for loading the intensity field in my output with some selection (or combination) of R-G-B-IR values from the input file pair.

Thanks,

Karl
...

Martin Isenburg

unread,
Dec 16, 2017, 9:58:19 PM12/16/17
to LAStools - efficient command line tools for LIDAR processing
Hello Karl,

sorry for my late answer. In order for this to work correctly (potentially with lascopy) there are a few more details I would need from you. Ideally a typical sample pair of files. Are the two LAS files identical or at least

(a) contain the exact same LAS points (x/y/z/gps_time/return number/number of returns are identical)
(b) have the points in the exact same order in the file
(c) or have some other guarantee that this copy process could exploit

If you send a pair of LAS files as a sample please compress the files to the LAZ format first and only post a link, not the actual files. In the meantime have a look at lascopy:


Regards,

Martin @rapidlasso

Neil Pinto

unread,
Nov 1, 2018, 3:38:09 PM11/1/18
to LAStools - efficient tools for LiDAR processing
Hi Martin, 

I am trying to colour to a las v1.2 files using 4 band images in the lascolor GUI using the workflows suggested earlier:

:: add rgb into RGB channels and nir into intensity field

:: add rgb into RGB channels and nir into intensity field
lascolor -i las12.laz -image rgbnir.tif -rgbnir -intensity -o las12mod.laz

lascolor -i las12.laz -image rgbnir.tif -rgbnir -intensity -o las12mod.laz

and keep getting "ERROR: cannot understand argument '-pixel'" as the command line is as follows
"lascolor -i "j:\_4_ACTIVE_PROJECTS\18026_SAP_2018_FTG_FRMG\18026-8_FTG_4PPM\5_DSM\DSM_LIDAR\B1\05_las2las\FRMG_FTG_2018_18026-8_8ppm_5475290.las" -pixel is area -image "j:\_4_ACTIVE_PROJECTS\18026_SAP_2018_FTG_FRMG\18026-8_FTG_4PPM\5_DSM\DSM_LIDAR\B1\05_las2las\FRMG_FTG_2018_18026-8_8ppm_5475290.tif" -odir "j:\_4_ACTIVE_PROJECTS\18026_SAP_2018_FTG_FRMG\18026-8_FTG_4PPM\5_DSM\DSM_LIDAR\B1\06_lascolor" -olaz"

When I delete the "-pixel is area" command the process continues but does not provide the desired result. 
Is there anything I can do differently to change the outcome?

Regards,

Neil 
-
...

Jochen Bind

unread,
Nov 2, 2018, 2:34:19 AM11/2/18
to last...@googlegroups.com

Hi Neil,

Judging from your syntax, you need to connect the argument with underscores, i.e. “-pixel_is_area”

 

Hope this helps,

Jo

--





Jochen Bind
Hydrodynamics and GIS Technician
T +64-3-343-8021  
National Institute of Water & Atmospheric Research Ltd (NIWA)
10 Kyle Street, Riccarton, Christchurch
Connect with NIWA: niwa.co.nz Facebook Twitter LinkedIn Instagram
To ensure compliance with legal requirements and to maintain cyber security standards, NIWA's IT systems are subject to ongoing monitoring, activity logging and auditing. This monitoring and auditing service may be provided by third parties. Such third parties can access information transmitted to, processed by and stored on NIWA's IT systems.




Michael Stimson

unread,
Nov 2, 2018, 2:38:25 AM11/2/18
to last...@googlegroups.com

Not in ASPRS LAS 1.2, in 1.4 record format 8 can store RGBI (red, green, blue, near infra red). The specification 1.2 only supports record formats 0 to 3; none of these have a NIR property.

 

From ASPRS LAS specification version 1.4:

Item

Format

Size Required

X

long

4 bytes *

Y

long

4 bytes *

Z

long

4 bytes *

Intensity

unsigned short

2 bytes

Return Number

4 bits (bits 0, 1, 2, 3)

4 bits *

Number of Returns (given pulse)

4 bits (bits 4, 5, 6, 7)

4 bits *

Classification Flags

4 bits (bits 0 – 3)

4 bits

Scanner Channel

2 bits (bits 4 - 5)

2 bits *

Scan Direction Flag

1 bit (bit 6)

1 bit *

Edge of Flight Line

1 bit (bit 7)

1 bit *

Classification

unsigned char

1 byte *

User Data

unsigned char

1 byte

Scan Angle

short

2 bytes *

Point Source ID

unsigned short

2 bytes *

GPS Time

double

8 bytes *

Red

unsigned short

2 bytes *

Green

unsigned short

2 bytes *

Blue

unsigned short

2 bytes *

NIR

unsigned short

2 bytes *

NIR: The NIR (near infrared) channel value associated with this point.

 

NOTE: Red, Green, Blue and NIR values should always be normalized to 16 bit values. For example, when encoding an 8 bit per channel pixel, multiply each channel value by 256 prior to storage in these fields. This normalization allows color values from different camera bit depths to be accurately merged.

 

 

 

 

 

 

 

 

 

 

 

RPS


Michael Stimson
Senior GIS Analyst
Australia Asia Pacific
Level 4 HQ South 520 Wickham St, Fortitude Valley, QLD, Australia, 4006
PO Box 1559, Fortitude Valley, QLD 4006.
D:    +61 7 3539 9694
T:    +61 7 3539 9500
F:    +61 7 3539 9501
E:    Michael...@rpsgroup.com.au
W:    rpsgroup.com.au

 

 

SAVE PAPER. Good for your planet. Good for your Business

This email and its attachments may contain confidential and/or privileged information and is for the sole use of the intended recipient(s). The contents of this email must not be disclosed to or used by or copied in any way by anyone other than the intended recipient(s). If you are not the intended recipient, any use, distribution or copying of the information contained in this email and its attachments is strictly prohibited. Confidentiality and/or privilege in the content of this email is not waived. If you have received this email in error, please email the sender by replying to this message and immediately delete and destroy any copies of this email and any attachments. Please note that neither RPS Consultants Pty Ltd, any subsidiary, related entity ('RPS') nor the sender accepts any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. The views or opinions expressed are the author's own and may not reflect the views or opinions of RPS.

 

From: last...@googlegroups.com <last...@googlegroups.com> On Behalf Of Neil Pinto


Sent: Friday, 2 November 2018 5:10 AM
To: LAStools - efficient tools for LiDAR processing <last...@googlegroups.com>

--

Reply all
Reply to author
Forward
0 new messages