translate_xy

44 views
Skip to first unread message

Susana Gonzalez

unread,
Mar 17, 2021, 7:36:30 AM3/17/21
to last...@googlegroups.com

Hi there,

 

I have a GCP with the values below

X:            428,158.557

Y:            7,073,962.429

 

I need to translate the LAZ file so the center of my GCP becames:

X:            0

Y:            0

 

See file here:

​laz icon GCP.laz

 

Thanks

Susana

 

 

Susana Gonzalez - Forest Engineer, LiDAR Science

 

Interpine Group Ltd

Mobile:      021 026 49733   DDI:  +64 7 350 3209 or Australia +61 2 906 47902
Skype:        sugonar

Address:   99 Sala Street, PO Box 1209, Rotorua 3010, New Zealand
Website:  
www.interpine.co.nz

 

Interpine Innovation is Shaping Today’s Forests with the Technology of Tomorrow

He rangahau tenei ra he hangarau apopo

 

Martin Isenburg

unread,
Mar 17, 2021, 8:49:41 AM3/17/21
to LAStools - efficient command line tools for LIDAR processing
Hello Susana,

you had asked a similar question with the shift in the other direction before:

https://groups.google.com/g/lastools/c/oZqn0FgMLY0/m/WM92kp5RAAAJ

The way to do it in reverse would be following the same concept.

Regards,

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/PS1PR0302MB25393F40F62EAAAFF70D00708D6A9%40PS1PR0302MB2539.apcprd03.prod.outlook.com.

Susana Gonzalez

unread,
Mar 17, 2021, 4:30:14 PM3/17/21
to last...@googlegroups.com

Hi Martin,

 

I know that I already asked in the opposite direction, I managed to move it from 0,0 to eastings and northings but in the other direction I am getting negatives numbers.

 

Not sure what is going on.

 

Thanks

Susana

 

From: last...@googlegroups.com <last...@googlegroups.com> On Behalf Of Martin Isenburg
Sent: Thursday, 18 March 2021 1:44 AM
To: LAStools - efficient command line tools for LIDAR processing <last...@googlegroups.com>
Subject: Re: [LAStools] translate_xy

 

[EXTERNAL]

Martin Isenburg

unread,
Mar 18, 2021, 10:28:40 AM3/18/21
to LAStools - efficient command line tools for LIDAR processing
Hello,

First a question. Why do you use a float for the range in the "extra bytes" ... ? You know that I have a very difficult relationship with the floating point.

[...]
     data type: 9 (float), name "Range", description: "Range from Lidar to Point", scale: 1, offset: 0  
[...]
  attribute1    1.50853    26.5418  ('Range')  
[...]

You really need to store the distances with a resolution as precice as a tenth of a micrometer for the ranges between one and two meters? I would assume centimeters or millimeters might already suffice, no? The LASzip compressor will spend a lot of time and disk space on compressing this useless precision that is most likely just "whatever happened to be in the lower order mantissa bits" in the ALU.

But on to the actual problem ...

It's the same technique as before. You want to move a huge distance. So let's break the move into two components. First a lasinfo report,

lasinfo -i GCP.laz
[....]
   offset x y z:               420000 7070000 0  
[....]

That tells me that the current offset is  420000, 7070000, 0  so to move x = 428158.557 and y = 7073962.429 to x = 0 and y = 0 we first set the current offset to zero.

lasinfo -i GCP.laz -set_offset 0 0 0 -repair_bb

Now we did the largest part of the translation in-place as you can see in the next lasinfo report.

What remains to translate in direction x is 428158.557 -  420000 = 8158.557.
What remains to translate in direction y is 7073962.429 -  7070000 = 3962.429.

So we do one final las2las call for this translation:

las2las -i GCP.laz -translate_x -8158.557 -translate_y -3962.429 -odix _zero -olaz

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

lasinfo (210128) report for 'GCP.laz'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            1
  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:        'QT Modeler 8.2.1573'
  file creation day/year:     76/2021
  header size:                375
  offset to point data:       1347
  number var. length records: 3
  point data format:          1
  point data record length:   41
  number of point records:    16882
  number of points by return: 1889 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               420000 7070000 0
  min x y z:                  428158.055 7073961.979 -0.040
  max x y z:                  428158.984 7073962.943 1.256

  start of waveform data packet record: 0
  start of first extended variable length record: 693509
  number of extended_variable length records: 0
  extended number of point records: 16882
  extended number of points by return: 1889 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             0
  user ID              'LASF_Spec'
  record ID            4
  length after header  768
  description          'by LAStools of rapidlasso GmbH'
    Extra Byte Descriptions
      data type: 2 (char), name "Ring", description: "Lidar Ring in Velodyne", scale: 1, offset: 0
      data type: 9 (float), name "Range", description: "Range from Lidar to Point", scale: 1, offset: 0
      data type: 6 (long), name "elev", description: "copied elevation", scale: 0.01, offset: 0 (not set)
      data type: 6 (long), name "agl", description: "copied above ground level", scale: 0.01, offset: 0 (not set)
variable length header record 2 of 3:
  reserved             0
  user ID              'LASF_Projection'
  record ID            2112
  length after header  0
  description          'OGC WKT'
variable length header record 3 of 3:
  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 28356 - ProjectedCSTypeGeoKey: GDA94 / MGA 56S
      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
the header is followed by 2 user-defined bytes
LASzip compression (version 3.4r3 c2 50000): POINT10 2 GPSTIME11 2 BYTE 2
reporting minimum and maximum for all LAS point record entries ...
  X             8158055    8158984
  Y             3961979    3962943
  Z                 -40       1256
  intensity           0        255
  return_number       0          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      2          4
  scan_angle_rank     0          0
  user_data           0         13
  point_source_ID     0          0
  gps_time 1607514048.607132 1607514465.053890
  attribute0          0         15  ('Ring')
  attribute1    1.50853    26.5418  ('Range')
  attribute2          0          0  ('elev')
  attribute3          0       1.26  ('agl')
number of first returns:        16882
number of intermediate returns: 0
number of last returns:         16882
number of single returns:       16882
WARNING: there are 14993 points with return number 0
WARNING: there are 16882 points with a number of returns of given pulse of 0
histogram of classification of points:
            2556  ground (2)
           11790  low vegetation (3)
            2536  medium vegetation (4)

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

lasinfo (210128) report for 'GCP.laz'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            1
  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:        'QT Modeler 8.2.1573'
  file creation day/year:     76/2021
  header size:                375
  offset to point data:       1347
  number var. length records: 3
  point data format:          1
  point data record length:   41
  number of point records:    16882
  number of points by return: 1889 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               0 0 0
  min x y z:                  8158.055 3961.979 -0.040
  max x y z:                  8158.984 3962.943 1.256

  start of waveform data packet record: 0
  start of first extended variable length record: 693509
  number of extended_variable length records: 0
  extended number of point records: 16882
  extended number of points by return: 1889 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             0
  user ID              'LASF_Spec'
  record ID            4
  length after header  768
  description          'by LAStools of rapidlasso GmbH'
    Extra Byte Descriptions
      data type: 2 (char), name "Ring", description: "Lidar Ring in Velodyne", scale: 1, offset: 0
      data type: 9 (float), name "Range", description: "Range from Lidar to Point", scale: 1, offset: 0
      data type: 6 (long), name "elev", description: "copied elevation", scale: 0.01, offset: 0 (not set)
      data type: 6 (long), name "agl", description: "copied above ground level", scale: 0.01, offset: 0 (not set)
variable length header record 2 of 3:
  reserved             0
  user ID              'LASF_Projection'
  record ID            2112
  length after header  0
  description          'OGC WKT'
variable length header record 3 of 3:
  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 28356 - ProjectedCSTypeGeoKey: GDA94 / MGA 56S
      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
the header is followed by 2 user-defined bytes
LASzip compression (version 3.4r3 c2 50000): POINT10 2 GPSTIME11 2 BYTE 2
reporting minimum and maximum for all LAS point record entries ...
  X             8158055    8158984
  Y             3961979    3962943
  Z                 -40       1256
  intensity           0        255
  return_number       0          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      2          4
  scan_angle_rank     0          0
  user_data           0         13
  point_source_ID     0          0
  gps_time 1607514048.607132 1607514465.053890
  attribute0          0         15  ('Ring')
  attribute1    1.50853    26.5418  ('Range')
  attribute2          0          0  ('elev')
  attribute3          0       1.26  ('agl')
number of first returns:        16882
number of intermediate returns: 0
number of last returns:         16882
number of single returns:       16882
WARNING: there are 14993 points with return number 0
WARNING: there are 16882 points with a number of returns of given pulse of 0
histogram of classification of points:
            2556  ground (2)
           11790  low vegetation (3)
            2536  medium vegetation (4)

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

lasinfo (210128) report for 'c:\GCP_zero.laz'
reporting all LAS header entries:
  file signature:             'LASF'
  file source ID:             0
  global_encoding:            1
  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 210315)'
  file creation day/year:     76/2021
  header size:                375
  offset to point data:       1347
  number var. length records: 3
  point data format:          1
  point data record length:   41
  number of point records:    16882
  number of points by return: 1889 0 0 0 0
  scale factor x y z:         0.001 0.001 0.001
  offset x y z:               0 0 0
  min x y z:                  -0.502 -0.450 -0.040
  max x y z:                  0.427 0.514 1.256

  start of waveform data packet record: 0
  start of first extended variable length record: 693509
  number of extended_variable length records: 0
  extended number of point records: 16882
  extended number of points by return: 1889 0 0 0 0 0 0 0 0 0 0 0 0 0 0
variable length header record 1 of 3:
  reserved             0
  user ID              'LASF_Spec'
  record ID            4
  length after header  768
  description          'by LAStools of rapidlasso GmbH'
    Extra Byte Descriptions
      data type: 2 (char), name "Ring", description: "Lidar Ring in Velodyne", scale: 1, offset: 0
      data type: 9 (float), name "Range", description: "Range from Lidar to Point", scale: 1, offset: 0
      data type: 6 (long), name "elev", description: "copied elevation", scale: 0.01, offset: 0 (not set)
      data type: 6 (long), name "agl", description: "copied above ground level", scale: 0.01, offset: 0 (not set)
variable length header record 2 of 3:
  reserved             0
  user ID              'LASF_Projection'
  record ID            2112
  length after header  0
  description          'OGC WKT'
variable length header record 3 of 3:
  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 28356 - ProjectedCSTypeGeoKey: GDA94 / MGA 56S
      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
the header is followed by 2 user-defined bytes
LASzip compression (version 3.4r3 c2 50000): POINT10 2 GPSTIME11 2 BYTE 2
reporting minimum and maximum for all LAS point record entries ...
  X                -502        427
  Y                -450        514
  Z                 -40       1256
  intensity           0        255
  return_number       0          1
  number_of_returns   0          0
  edge_of_flight_line 0          0
  scan_direction_flag 0          0
  classification      2          4
  scan_angle_rank     0          0
  user_data           0         13
  point_source_ID     0          0
  gps_time 1607514048.607132 1607514465.053890
  attribute0          0         15  ('Ring')
  attribute1    1.50853    26.5418  ('Range')
  attribute2          0          0  ('elev')
  attribute3          0       1.26  ('agl')
number of first returns:        16882
number of intermediate returns: 0
number of last returns:         16882
number of single returns:       16882
WARNING: there are 14993 points with return number 0
WARNING: there are 16882 points with a number of returns of given pulse of 0
histogram of classification of points:
            2556  ground (2)
           11790  low vegetation (3)
            2536  medium vegetation (4)






Reply all
Reply to author
Forward
0 new messages