I was previously reprojecting a point cloud in .las format using liblas 1.7.0 (with GeoTIFF 1.4.0 GDAL 1.10.1) as follows:

las2las /tmp/input.las --a_srs EPSG:4326 --t_srs EPSG:3857 --scale 0.001 0.001 0.001 --offset -13704940,4639778,0 --output /tmp/new.las

However, after upgrading to liblas 1.8.0 (with GeoTIFF 1.4.1 GDAL 1.11.3) I now get the following error which I believe indicates the scale factor and offset combination are not enough to cover the data range:

ERROR 1: latitude or longitude exceeded limits error: Could not project point for ReprojectionTransform::latitude or longitude exceeded limits

I have played about with the offset and scale factor and can get it to work only if I set the scale factors to 0.01 and remove the offset, e.g.:

las2las /tmp/input.las --a_srs EPSG:4326 --t_srs EPSG:3857 --scale 0.01 0.01 0.01 --output /tmp/next.las

Why am I getting this error with the newer version of liblas, and what should my reprojection command be?

For your information, here is the lasinfo for the input point cloud:

  Version:                     1.2
  Source ID:                   0
  Reserved:                    0
  Project ID/GUID:             '00000000-0000-0000-0000-000000000000'
  System ID:                   'libLAS Python API'
  Generating Software:         'libLAS 1.8.0'
  File Creation Day/Year:      149/2018
  Header Byte Size             227
  Data Offset:                 738
  Header Padding:              0
  Number Var. Length Records:  4
  Point Data Format:           2
  Number of Point Records:     20
  Compressed:                  False
  Number of Points by Return:  20 0 0 0 0
  Scale Factor X Y Z:          0.00000010000000 0.00000010000000 0.01000000000000
  Offset X Y Z:                -123.1140000 38.4250000 -100.00
  Min X Y Z:                   -123.1139429 38.4257008 -2.43
  Max X Y Z:                   -123.1130518 38.4263682 18.19
  Spatial Reference:
        SPHEROID["WGS 84",6378137,298.257223563,

marked as duplicate by Andre Silva, BERA, xunilk, tinlyx, aldo_tapia Jun 4 '18 at 12:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • It sounds like there is a dodgy point outside the domain, use LAS2LAS -clip_to_bounding_box to remove points outside the specified bounding box. – Michael Stimson May 30 '18 at 22:54
  • that doesn't seem to be an option for this version of liblas unfortunately; I used the --extent option and specified the bounding box from lasinfo (which I assume does the same thing), but got the same result for the reprojection – jeremyeastwood May 30 '18 at 23:06
  • Not in LibLAS, use LAS2LAS from LASTools to pre-clean your data before processing.. also, if you have tiled data the extents will no longer be rectangular to the Cartesian, LASTile can retile for neatness. If you haven't purchased LASTools I think the 'free' version will perform the bounding box clean but not the retile. – Michael Stimson May 30 '18 at 23:12
  • I don't currently have lastools for this project (running on linux), but can try that; any idea why this would suddenly stop working for the new version of liblas (this case worked fine previously)? – jeremyeastwood May 30 '18 at 23:21
  • LibLAS is library, can you post the code that is causing the problem? From your question you're using LAS2LAS so why is it you say you don't have LASTools? – Michael Stimson May 30 '18 at 23:34