Skip to main content
Question

How to transform point cloud file from one UCS to another in Autodesk RCP and Leica PTS formats

  • November 27, 2018
  • 5 replies
  • 171 views

How to transform point cloud file from one UCS to another in Autodesk RCP and Leica PTS formats

5 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 28, 2018

Hi @dchar,

FME currently has no dedicated reader or writer for the Leica PTS format. However, it is a simple Ascii file that can be read with FME's Point Cloud XYZ reader. Writing is a bit more complex, requiring an FME Workbench workspace to insert the first record containing the number of points.

FME can currently only write to Autodesk Recap RCP and RCS files.

FME Workbench has a number of tools that can be used to convert between world, projected and user coordinate systems, including the Reprojector, Scaler, 3DRotator, and 3dAffiner transformers.

If you would like to provide more details on your desired transformation, I would be happy to create an annotated workspace to illustrate how to do it in FME.


  • Author
  • November 28, 2018
Hi Dave - thank you for your response! We have point clouds in Autodesk .rcp and Leica .pts formats and are looking to apply a transformation to the point values (translate xyz, rotate). The structure of our various .pts files varies between (xyzi) and (xyziRGB). I have been able to successfully read the .pts files by changing extension to .xyz. I then applied a 3DRotator and Offsetter and write out to .ptx by changing file extension in the Writer. The transformation appears to be successful, however the first record is not present in the output file, and the precision of the xyz values is 14 digits after decimal place (only 6 in input file). I would like to be able to skip over the lines that contain point counts (such as the header), and also to test the input file to see whether xyzi or xyziRGB and to process accordingly. Would greatly appreciate any help or direction that you could provide! Thanks again Dave,

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 28, 2018
dchar wrote:
Hi Dave - thank you for your response! We have point clouds in Autodesk .rcp and Leica .pts formats and are looking to apply a transformation to the point values (translate xyz, rotate). The structure of our various .pts files varies between (xyzi) and (xyziRGB). I have been able to successfully read the .pts files by changing extension to .xyz. I then applied a 3DRotator and Offsetter and write out to .ptx by changing file extension in the Writer. The transformation appears to be successful, however the first record is not present in the output file, and the precision of the xyz values is 14 digits after decimal place (only 6 in input file). I would like to be able to skip over the lines that contain point counts (such as the header), and also to test the input file to see whether xyzi or xyziRGB and to process accordingly. Would greatly appreciate any help or direction that you could provide! Thanks again Dave,

Hi @dchar,

The Point Cloud XYZ reader parameters has a Lines to Skip section, where you can set the number of lines to skip to 1 to avoid reading the number of records.

To test whether the point cloud has RGB values on it, use a PointCloudFilter to test if the component color_red == -1. If the point cloud has no RGB, it will be output through the <Rejected> port. If it does have RGB, it will be output through the Unfiltered port.

 


  • Author
  • November 29, 2018

Hi Dave - can you explain why the precision of the output point cloud is so much higher than the input file? I would like to be able to maintain the same number of decimal places in the resulting point cloud. I am assuming that this has something to do with the data type (real64) in the reader or writer. The other issue with the larger values being output is the amount of time it takes to write the transformed file. It took 1.5 hours to transform a 55MB pts file to translated pts and rcp. Once again, any advice you could provide would be appreciated.

Also, you mentioned inserting the first record containing number of points. How would I go about either maintaining this record or rewriting it to the output file?


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • November 29, 2018

Hi @dchar,

When calculating the result of the transformation, FME will use the number of decimal places allowed by the data type of the components. However, you can use the @floor or @ceil functions in the PointCloudExpressionEvaluator to round off the subsequent coordinates before writing to the output.

I am attaching a workspace that uses the Text File reader to read the header record (by limiting the number of lines to read) and the Point Cloud XYZ reader to read the point values. The header record is sent to a Text File writer, and the transformed points are sent to a Point Cloud XYZ writer set to append to a file.

By ordering the writers in the Navigation window of Workbench, we can control which writes first. In this case I have the Text file writing first, then the Point Cloud XYZ writer appending to the same file. FME will completely write to the first writer before it starts to write to the second, so collisions are avoided.

The workspace does a simple rotation to simulate the transform, then rounds the point values with the PointCloudExpressionEvaluator. You can replace the Rotator with your own transformation logic. The workspace runs in about 5 seconds on a 800,000 point PTS file.

transformpts.fmw


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings