Solved

las2las conversion - while maintaining scale factor and offset

  • 18 April 2019
  • 5 replies
  • 18 views

Badge

When writing las files fme defaults to determining its own scale factor and offset values to utilise in the output file. For a las to las conversion is there a way of forcing fme to maintain/use the same offset and scale factor values that the input las file has?

icon

Best answer by jovitaatsafe 30 April 2019, 02:37

View original

5 replies

Userlevel 1
Badge +11

Hi @pointpixel,

Is there any reprojection involved in your translation from LAS to LAS? If so, what could be happening is that the local coordinates are being converted to global ones with the offset and scaling applied before reprojection, after which, the offset and scale are no longer preserved.

One way to work around this is to re-apply the scale and offset before you write out. You can use a PointCloudPropertyExtractor set to Retrieve Properties to grab the original scale and offset as attributes. Next you can reapply them using a Scaler and an Offsetter before writing out. Hope that helps!

Badge

Hi @jovitaatsafe, There's no reprojection and so no risk of the input files scale and offset becoming invalid - you're right this would be something to watch out for.

Are you saying, for example, that if I apply a Scaler with 0.001 and Offsetter with values of 10000 200000 0 just before writing out the las file that these scale and offset values will be forced into use in the writing of the las file? Thanks

Userlevel 1
Badge +11

Hi @jovitaatsafe, There's no reprojection and so no risk of the input files scale and offset becoming invalid - you're right this would be something to watch out for.

Are you saying, for example, that if I apply a Scaler with 0.001 and Offsetter with values of 10000 200000 0 just before writing out the las file that these scale and offset values will be forced into use in the writing of the las file? Thanks

I don't think it'll apply the values, but I believe it would conserve the original scale and offset values as properties on the X, Y, Z components when writing out.

Userlevel 1
Badge +11

Hi @pointpixel

My sincere apologies for causing confusion, I checked in with one our point cloud developers on it, and I'm missing a very important step in this process. Before applying the desired scale and offset that we want to preserve, we need to 'undo' the transformation before we apply it. So, to correct my answer to your earlier question, yes this process does apply the transformation on the values. This means that your workflow should look like:

  1. Reader > PointCloudPropertyExtractor > Vertical reprojection, then

  2. Undo the original scale/offset before we re-apply it. Attach a Scaler set to divide 1.0/@Value(_pre_x_scale), and _pre_y_scale for Y, and etc for Z

     

  3. Add an Offsetter

     

    X Offset: -@Value(_pre_x_offset)/@Value(_pre_x_scale)

     

    Y Offset: -@Value(_pre_y_offset)/@Value(_pre_y_scale)

     

    Z Offset: -@Value(_pre_z_offset)/@Value(_pre_z_scale)

  4. Attach a PointCloudTransformationApplier with Apply Transformation Matrix set to Yes. Here we will set X, Y, and Z

     

     

     

    These steps are the blue bookmark, for undoing the transformation before setting it to Int32 (green bookmark), and then applying the scale and offset to preserve (red bookmark).

     

     

Please let me know if you have any other questions and I'd be happy to find out for you. Update: I've attached a workspace below. Thanks for your patience and hope this clears things up for you!

 

preserve-scale-offset.fmwt
Badge

Hi @pointpixel

My sincere apologies for causing confusion, I checked in with one our point cloud developers on it, and I'm missing a very important step in this process. Before applying the desired scale and offset that we want to preserve, we need to 'undo' the transformation before we apply it. So, to correct my answer to your earlier question, yes this process does apply the transformation on the values. This means that your workflow should look like:

  1. Reader > PointCloudPropertyExtractor > Vertical reprojection, then

  2. Undo the original scale/offset before we re-apply it. Attach a Scaler set to divide 1.0/@Value(_pre_x_scale), and _pre_y_scale for Y, and etc for Z

     

  3. Add an Offsetter

     

    X Offset: -@Value(_pre_x_offset)/@Value(_pre_x_scale)

     

    Y Offset: -@Value(_pre_y_offset)/@Value(_pre_y_scale)

     

    Z Offset: -@Value(_pre_z_offset)/@Value(_pre_z_scale)

  4. Attach a PointCloudTransformationApplier with Apply Transformation Matrix set to Yes. Here we will set X, Y, and Z

     

     

     

    These steps are the blue bookmark, for undoing the transformation before setting it to Int32 (green bookmark), and then applying the scale and offset to preserve (red bookmark).

     

     

Please let me know if you have any other questions and I'd be happy to find out for you. Update: I've attached a workspace below. Thanks for your patience and hope this clears things up for you!

 

preserve-scale-offset.fmwt

@jovitaatsafe - sorry for the slow response, but thank you for this explanation and solution

Reply