Tif to Las or Laz

131 views
Skip to first unread message

Darin D

unread,
Feb 14, 2020, 1:04:33 AM2/14/20
to LAStools - efficient tools for LiDAR processing
HI...

I have a large TIF file that I need in LAS or LAZ format for software to recognize.  Any idea how to convert?

Martin Isenburg

unread,
Feb 14, 2020, 1:26:54 AM2/14/20
to LAStools - efficient command line tools for LIDAR processing
Hello,

Here are the DEM files he is talking about:


Turned out that the files Darin was using were BigTIFF which demzip does not support at the moment:

demzip -i Seine_River_LiDAR_DEM.tif -o Seine_River_LiDAR_DEM.laz
Seine_River_LiDAR_DEM.tif: This is a BigTIFF file.  This format not supported
by this version of libtiff..
ERROR: failed in XTIFFOpen
ERROR: cannot open TIF raster 'Seine_River_LiDAR_DEM.tif'

But I found a workaround via GDAL. First we need to convert to IMG and then to LAZ using these command lines:

GDAL\bin\gdal_translate -of HFA Seine_River_LiDAR_DEM.tif Seine_River_LiDAR_DEM.img
demzip -i Seine_River_LiDAR_DEM.img -o Seine_River_LiDAR_DEM.laz

GDAL\bin\gdal_translate -of HFA Lake_St_Martin_LiDAR_DEM.tif Lake_St_Martin_LR_DEM.img
demzip -i Lake_St_Martin_LiDAR_DEM.img -o Lake_St_Martin_LiDAR_DEM.laz

GDAL\bin\gdal_translate -of HFA CooksCreek_LiDAR_DEM.tif CooksCreek_LiDAR_DEM.img
demzip -i CooksCreek_LiDAR_DEM.img -o CooksCreek_LiDAR_DEM.laz

To do this successfully you will need to wait for the next version of demzip as I also found and fixed a small bug. Not the most efficient workflow because the intermediate IMG/IGE files are huge but it works. Here are the results in bytes and a lasinfo report. Also two images of the largest file are attached. The DEM hillshade was z-enhanced and shows an underlying tiling structure. I wonder if this is the result of the subsampling of 10,000,000 points by lasview or whether these are edge artifacts from processing the tiles without buffers ...

   530,457,578 Seine_River_LiDAR_DEM.tif
             90 Seine_River_LiDAR_DEM.tfw

           8,165 Seine_River_LiDAR_DEM.img
 11,655,257,499 Seine_River_LiDAR_DEM.ige 
 
      74,710,863 Seine_River_LiDAR_DEM.laz 
 
===================

         7,345 Lake_St_Martin_LiDAR_DEM.img
 5,317,435,329 Lake_St_Martin_LiDAR_DEM.ige

   793,429,329 Lake_St_Martin_LiDAR_DEM.tif  
            90 Lake_St_Martin_LiDAR_DEM.tfw

   348,363,747 Lake_St_Martin_LiDAR_DEM.laz 
 
===================

 4,923,818,542 CooksCreek_LiDAR_DEM.tif  
              90 CooksCreek_LiDAR_DEM.tfw 

  7,633 CooksCreek_LiDAR_DEM.img
22,099,629,849 CooksCreek_LiDAR_DEM.ige  
 
 1,184,765,277 CooksCreek_LiDAR_DEM.laz  

====================

lasinfo -i CooksCreek_LiDAR_DEM.laz
lasinfo (200209) report for 'CooksCreek_LiDAR_DEM.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.4
  system identifier:          'raster compressed as LAZ points'
  generating software:        'LAStools (c) by rapidlasso GmbH'
  file creation day/year:     44/2020
  header size:                375
  offset to point data:       603
  number var. length records: 2
  point data format:          0
  point data record length:   20
  number of point records:    2111110932
  number of points by return: 2111110932 0 0 0 0
  scale factor x y z:         0.5 0.5 0.01
  offset x y z:               600000 5500000 0
  min x y z:                  634381.5 5495001.5 198.16
  max x y z:                  693975.5 5584928.5 313.23
  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: 2111110932
  extended number of points by return: 2111110932 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 2:
  reserved             0
  user ID              'Raster LAZ'
  record ID            7113
  length after header  80
  description          'by LAStools of rapidlasso GmbH'
    ncols  60000
    nrows  92000
    llx   634000
    lly   5494000
    stepx    1
    stepy    1
    sigmaxy <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 26914 - ProjectedCSTypeGeoKey: NAD83 / UTM 14N
      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
LASzip compression (version 3.4r3 c2 50000): POINT10 2
reporting minimum and maximum for all LAS point record entries ...
  X               68763     187951
  Y               -9997     169857
  Z               19816      31323
  intensity           0          0
  return_number       1          1
  number_of_returns   1          1
  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
number of first returns:        2111110932
number of intermediate returns: 0
number of last returns:         2111110932
number of single returns:       2111110932
overview over extended number of returns of given pulse: 2111110932 0 0 0 0 0 0 0 0 0 0 0 0 0 0
histogram of classification of points:
      2111110932  never classified (0)

CooksCreek_LiDAR_DEM.jpg
CooksCreek_LiDAR_DEM_hillshaded_z_enhanced.jpg
Reply all
Reply to author
Forward
0 new messages