Hi,
I have a question about something I can’t quite work out and I’m at a loss. I can’t work out how to do something that is really common in land surveying, I’m 50% sure that lastools can even do what I want. The problem is scaling a point cloud about an origin coordinate to shift between grid coordinates and plane coordinates.
The formula for essentially what I am doing is:
X’new = (SCALE_FACTOR * (X’old – ORIGIN_X)) + ORIGIN_X
Y’new = (SCALE_FACTOR * (Y’old – ORIGIN_Y)) + ORIGIN_Y
Basically, I want to scale as per normal, but using a specific coordinate as the origin. The way I can see this is to either translate by a – X/Y origin to effectively set it to 0, then scale, and then translate back, or to somehow set the coordinate origin to the X/Y origin points, scale, and then set the origin back to 0,0. The first method causes a coordinate overflow, the second option I can’t work out how to do. If I just use -reoffset like has been mentioned in other threads then I don’t get the overflow, but it is scaling from, 0/0 not the X/Y origin so I get a result that is 100’s of metres wrong.
If you have any advice that would be appreciated.
If have included a simplified version of my current code which mostly works but has rounding errors because of the las integer overflow. Also, the original point cloud has a scale factor of 0.001 in the header and I want to keep the mm precision.
SCALE_FACTOR =1.0001
ORIGIN_X =331147.806
ORIGIN_Y =6247816.055
:: translate to -X/Y origin then scale
las2las -cpu64 -i "INPUT\*.laz" ^
-translate_then_scale_x -ORIGIN_X SCALE_FACTOR ^
-translate_then_scale_y -ORIGIN_Y SCALE_FACTOR ^
-odir temp1 ^
-olaz
:: translate back by original X/Y origin
"%LASTOOLS_DIR%\las2las.exe" -cpu64 -i "%WORK_DIRECTORY%\temp1\*.laz" ^
-translate_x ORIGIN_X ^
-translate_y ORIGIN_Y ^
-odir temp2 ^
-olaz
Regards,
James