r-lidar / RCSF

Airborne LiDAR filtering method based on Cloth Simulation
Apache License 2.0
17 stars 2 forks source link

Float accuracy computation #2

Closed Jean-Romain closed 6 years ago

Jean-Romain commented 6 years ago

The CSF lib seems to be written with float https://github.com/Jean-Romain/RCSF/blob/master/src/point_cloud.h. The code must be modified to work either with int or double. Indeed:

  1. LAS specifications state that points coordinates are stored on 64 bits i.e. double thus coercing the coordinates to float we will have trouble with numbers outside the range of representable values.
  2. R does not have float values anyway. Only double so independently of the specification we may have troubles with user-defined values
  3. Integers are an option. Coordinates can be offseted and rescaled according to a given precision. This is fully workable with LAS objects that internally contain a scale and an offset and are actually stored on integers but in the general case I think it is not a good idea.
jianboqi commented 6 years ago

I think this can be easily modified, since all other parts of the code are using double. I may have forgotten this.

jianboqi commented 6 years ago

Hi, Jean-Romain I fixed this, but it seems that I do not have the writing permission. I can not push the code.

Jean-Romain commented 6 years ago

You did not accept my invitation. You are still answering as a regular github user. You should have (somewhere) in you git account a notification to be collaborator on this repo.

jianboqi commented 6 years ago

OK, I can submit code now. Thanks.