Warning: total of XXXXX overflows caused by -translate_xyz

245 views
Skip to first unread message

Brian Green

unread,
Oct 15, 2022, 5:54:00 AM10/15/22
to LAStools - efficient tools for LiDAR processing
I'm attempting to translate two .las files by -7710000 -678000

I get the following:

las2las -cpu64 -lof file_list.4980.txt -merged -o "merged.las"
command was manually edited. new command:
las2las -cpu64 -lof file_list.4980.txt -merged -o "merged.las" -rescale 0.001 0.001 0.001
WARNING: complete or cancel current BROWSE window first ...
WARNING: complete or cancel current BROWSE window first ...
WARNING: complete or cancel current BROWSE window first ...
las2las -cpu64 -lof file_list.4980.txt -olas
command was manually edited. new command:
las2las -cpu64 -lof file_list.4980.txt -rescale 0.001 0.001 0.001 -olas
las2las -cpu64 -lof file_list.4980.txt -olas
command was manually edited. new command:
las2las -cpu64 -lof file_list.4980.txt -translate_xyz -7710000 -678000 0  -olas
WARNING: total of 12594659 overflows caused by '-translate_xyz -7710000.000000 -678000.000000 0.000000 '
WARNING: total of 106060004 overflows caused by '-translate_xyz -7710000.000000 -678000.000000 0.000000 '

The y coordinate appears to translate correctly.  The x does not.

Below is the lasinfo report for the original files.  I was previously getting the warning about excessive precision of the bounding box but i ran the repair_bb command which appears to have solved that.  I also did a rescale to 0.001 0.001 0.001. I'm stumped.

Note that not all of LAStools is "free" (see http://lastools.org/LICENSE.txt)
contact 'martin....@rapidlasso.com' to clarify licensing terms if needed.
lasinfo -cpu64 -lof file_list.12972.txt
lasinfo (201207) report for 'd:\Pix4d Projects\HamiltonP4D\HamiltonP4D\2_densification\point_cloud\temp\HamiltonP4D_group1_densified_point_cloud_part_2_1.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.2
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las64 (version 201207)'
  file creation day/year:     223/2022
  header size:                227
  offset to point data:       1614
  number var. length records: 4
  point data format:          3
  point data record length:   34
  number of point records:    12594659
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               7710000 678000 0
  min x y z:                  7710571.551 678113.679 -111.456
  max x y z:                  7710931.477 679247.277 421.580
variable length header record 1 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  168
  description          'GeoTIFF GeoKeyDirectoryTag'
    GeoKeyDirectoryTag version 1.1.0 number of keys 20
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1025 tiff_tag_location 0 count 1 value_offset 1 - GTRasterTypeGeoKey: RasterPixelIsArea
      key 1026 tiff_tag_location 34737 count 48 value_offset 0 - GTCitationGeoKey: NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet
      key 2048 tiff_tag_location 0 count 1 value_offset 4269 - GeographicTypeGeoKey: GCS_NAD83
      key 2049 tiff_tag_location 34737 count 6 value_offset 48 - GeogCitationGeoKey: NAD83
      key 2054 tiff_tag_location 0 count 1 value_offset 9102 - GeogAngularUnitsGeoKey: Angular_Degree
      key 2057 tiff_tag_location 34736 count 1 value_offset 7 - GeogSemiMajorAxisGeoKey: 6378137
      key 2059 tiff_tag_location 34736 count 1 value_offset 6 - GeogInvFlatteningGeoKey: 298.2572221
      key 2062 tiff_tag_location 34736 count 7 value_offset 8 - GeogTOWGS84GeoKey: TOWGS84[0.9956,-1.9013,-0.5215,-0.025915,-0.009426,-0.011599,0.00062]
      key 3059 tiff_tag_location 0 count 1 value_offset 1 - key ID 3059 not implemented
      key 3072 tiff_tag_location 0 count 1 value_offset 32767 - ProjectedCSTypeGeoKey: user-defined
      key 3074 tiff_tag_location 0 count 1 value_offset 32767 - ProjectionGeoKey: user-defined
      key 3075 tiff_tag_location 0 count 1 value_offset 8 - ProjCoordTransGeoKey: CT_LambertConfConic_2SP
      key 3076 tiff_tag_location 0 count 1 value_offset 9003 - ProjLinearUnitsGeoKey: Linear_Foot_US_Survey
      key 3078 tiff_tag_location 34736 count 1 value_offset 2 - ProjStdParallel1GeoKey: 44.33333333
      key 3079 tiff_tag_location 34736 count 1 value_offset 3 - ProjStdParallel2GeoKey: 46
      key 3084 tiff_tag_location 34736 count 1 value_offset 1 - ProjFalseOriginLongGeoKey: -120.5
      key 3085 tiff_tag_location 34736 count 1 value_offset 0 - ProjFalseOriginLatGeoKey: 43.66666667
      key 3086 tiff_tag_location 34736 count 1 value_offset 4 - ProjFalseOriginEastingGeoKey: 8202083.333
      key 3087 tiff_tag_location 34736 count 1 value_offset 5 - ProjFalseOriginNorthingGeoKey: 0
variable length header record 2 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34736
  length after header  120
  description          'GeoTIFF GeoDoubleParamsTag'
    GeoDoubleParamsTag (number of doubles 15)
      43.6667 -120.5 44.3333 46 8.20208e+06 0 298.257 6.37814e+06 0.9956 -1.9013 -0.5215 -0.025915 -0.009426 -0.011599 0.00062
variable length header record 3 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34737
  length after header  55
  description          'GeoTIFF GeoAsciiParamsTag'
    GeoAsciiParamsTag (number of characters 55)
      NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet|NAD83|
variable length header record 4 of 4:
  reserved             43707
  user ID              'liblas'
  record ID            2112
  length after header  828
  description          'OGR variant of OpenGIS WKT SRS'
reporting minimum and maximum for all LAS point record entries ...
  X              571551     931477
  Y              113679    1247277
  Z             -111456     421580
  intensity           0          0
  return_number       0          0
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      2         11
  scan_angle_rank     0          0
  user_data           0          0
  point_source_ID     0          0
  gps_time 0.000000 0.000000
  Color R 0 65280
        G 256 65280
        B 0 65280
number of first returns:        12594659
number of intermediate returns: 0
number of last returns:         12594659
number of single returns:       12594659
WARNING: there are 12594659 points with return number 0
WARNING: there are 12594659 points with a number of returns of given pulse of 0
histogram of classification of points:
         1686442  ground (2)
          914849  low vegetation (3)
         5728889  high vegetation (5)
         2131514  building (6)
         2132965  road surface (11)
 +-> flagged as keypoints: 914849
  +--->          914849 of those are low vegetation (3)
lasinfo (201207) report for 'd:\Pix4d Projects\HamiltonP4D\HamiltonP4D\2_densification\point_cloud\temp\HamiltonP4D_group1_densified_point_cloud_part_3_1.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.2
  system identifier:          'LAStools (c) by rapidlasso GmbH'
  generating software:        'las2las64 (version 201207)'
  file creation day/year:     223/2022
  header size:                227
  offset to point data:       1614
  number var. length records: 4
  point data format:          3
  point data record length:   34
  number of point records:    106060004
  number of points by return: 0 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               7711000 678000 0
  min x y z:                  7710931.477 677876.795 -628.757
  max x y z:                  7711798.174 679234.690 424.177
variable length header record 1 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34735
  length after header  168
  description          'GeoTIFF GeoKeyDirectoryTag'
    GeoKeyDirectoryTag version 1.1.0 number of keys 20
      key 1024 tiff_tag_location 0 count 1 value_offset 1 - GTModelTypeGeoKey: ModelTypeProjected
      key 1025 tiff_tag_location 0 count 1 value_offset 1 - GTRasterTypeGeoKey: RasterPixelIsArea
      key 1026 tiff_tag_location 34737 count 48 value_offset 0 - GTCitationGeoKey: NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet
      key 2048 tiff_tag_location 0 count 1 value_offset 4269 - GeographicTypeGeoKey: GCS_NAD83
      key 2049 tiff_tag_location 34737 count 6 value_offset 48 - GeogCitationGeoKey: NAD83
      key 2054 tiff_tag_location 0 count 1 value_offset 9102 - GeogAngularUnitsGeoKey: Angular_Degree
      key 2057 tiff_tag_location 34736 count 1 value_offset 7 - GeogSemiMajorAxisGeoKey: 6378137
      key 2059 tiff_tag_location 34736 count 1 value_offset 6 - GeogInvFlatteningGeoKey: 298.2572221
      key 2062 tiff_tag_location 34736 count 7 value_offset 8 - GeogTOWGS84GeoKey: TOWGS84[0.9956,-1.9013,-0.5215,-0.025915,-0.009426,-0.011599,0.00062]
      key 3059 tiff_tag_location 0 count 1 value_offset 1 - key ID 3059 not implemented
      key 3072 tiff_tag_location 0 count 1 value_offset 32767 - ProjectedCSTypeGeoKey: user-defined
      key 3074 tiff_tag_location 0 count 1 value_offset 32767 - ProjectionGeoKey: user-defined
      key 3075 tiff_tag_location 0 count 1 value_offset 8 - ProjCoordTransGeoKey: CT_LambertConfConic_2SP
      key 3076 tiff_tag_location 0 count 1 value_offset 9003 - ProjLinearUnitsGeoKey: Linear_Foot_US_Survey
      key 3078 tiff_tag_location 34736 count 1 value_offset 2 - ProjStdParallel1GeoKey: 44.33333333
      key 3079 tiff_tag_location 34736 count 1 value_offset 3 - ProjStdParallel2GeoKey: 46
      key 3084 tiff_tag_location 34736 count 1 value_offset 1 - ProjFalseOriginLongGeoKey: -120.5
      key 3085 tiff_tag_location 34736 count 1 value_offset 0 - ProjFalseOriginLatGeoKey: 43.66666667
      key 3086 tiff_tag_location 34736 count 1 value_offset 4 - ProjFalseOriginEastingGeoKey: 8202083.333
      key 3087 tiff_tag_location 34736 count 1 value_offset 5 - ProjFalseOriginNorthingGeoKey: 0
variable length header record 2 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34736
  length after header  120
  description          'GeoTIFF GeoDoubleParamsTag'
    GeoDoubleParamsTag (number of doubles 15)
      43.6667 -120.5 44.3333 46 8.20208e+06 0 298.257 6.37814e+06 0.9956 -1.9013 -0.5215 -0.025915 -0.009426 -0.011599 0.00062
variable length header record 3 of 4:
  reserved             43707
  user ID              'LASF_Projection'
  record ID            34737
  length after header  55
  description          'GeoTIFF GeoAsciiParamsTag'
    GeoAsciiParamsTag (number of characters 55)
      NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet|NAD83|
variable length header record 4 of 4:
  reserved             43707
  user ID              'liblas'
  record ID            2112
  length after header  828
  description          'OGR variant of OpenGIS WKT SRS'
reporting minimum and maximum for all LAS point record entries ...

Jochen Rapidlasso

unread,
Oct 15, 2022, 6:06:10 AM10/15/22
to LAStools - efficient tools for LiDAR processing
Hi,
the translation you intend to do violates the range of what a LAS file can hold.
The points in a LAS file are stored as 4 byte long integer which will cover a range of
−2.147.483.648 to 2.147.483.647

Your points have to be in this range.
If you want to shift your whole dataset you should do this by shift the offset in the header.
(Argument -reoffset)
The header is a double float and cover a much higher range.

A small sample:
(Its always good to break problems down - so my favorite test-las file contains just 8 points)

lasinfo -i cube.laz
  version major.minor:        1.2
  scale factor x y z:         1 1 1
  offset x y z:               0 0 0
  min x y z:                  1 1 1
  max x y z:                  2 2 2

reporting minimum and maximum for all LAS point record entries ...
  X                   1          2
  Y                   1          2
  Z                   1          2

Rescale the cube to 0.001 will blow up the point values - make shure you really want to do that!

las2las -i cube.laz -rescale 0.001 0.001 0.001 -o cube0001.laz
lasinfo -i cube0001.laz


  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               0 0 0
  min x y z:                  1.000 1.000 1.000
  max x y z:                  2.000 2.000 2.000
LASzip compression (version 3.4r3 c2 50000): POINT10 2 RGB12 2

reporting minimum and maximum for all LAS point record entries ...
  X                1000       2000
  Y                1000       2000
  Z                1000       2000

Doing a translate by more than 2 million in 0.001 resolution will produce the warning you got:

las2las -i cube0001.laz -translate_xyz -7710000.000000 -678000.000000 0.0 -o ctra.laz

WARNING: total of 8 overflows caused by '-translate_xyz -7710000.000000 -678000.000000 0.000000 '

Doing a translate of "only" 1.2 mio will work:

las2las -i cube0001.laz -translate_xyz -1210000.000000 -678000.000000 0.0 -o ctra.laz
lasinfo -i ctra.laz
...
  offset x y z:               0 0 0
  min x y z:                  -1209999.000 -677999.000 1.000
  max x y z:                  -1209998.000 -677998.000 2.000

reporting minimum and maximum for all LAS point record entries ...
  X          -1209999000 -1209998000
  Y          -677999000 -677998000
  Z                1000       2000

Now I shift this translation into the offset - do keep my point values where they have been:

las2las -i ctra.laz -o coffs.laz -reoffset -1210000.0 -678000.0 0.0
lasinfo -i coffs.laz

  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               -1210000 -678000 0
  min x y z:                  -1209999.000 -677999.000 1.000
  max x y z:                  -1209998.000 -677998.000 2.000

reporting minimum and maximum for all LAS point record entries ...
  X                1000       2000
  Y                1000       2000
  Z                1000       2000

So doing a offset change of many mio points will work but
during the reoffset the point data itself will be adjusted also - so may you have to do
several steps to reach your aim.
Or: Reduce the resulution from 0.001 to 1 before - this gives you a much higher integer data range.

Remember:
Keep your scale factor as low as possible - remember the resulution_fluff warnings!
Always take the warnings of a tool serious. Your data will be may get complete wrong if you igore some warnings.
You may also have a look at the lasoptimize tool.

Best regards,

Jochen @rapidlasso
cube.laz
Reply all
Reply to author
Forward
0 new messages