Skip to main content

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?

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!


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


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.


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

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