FME Version
Files
-
- 200 KB
- Download
Introduction
The steps below show how to create a workspace that reads from an XYZ text file and writes point cloud data to the LAS, Oracle Spatial Point Cloud, and ASTM 57 formats. Note that different point cloud formats may store values using different data types, and though FME tries to maintain precision as much as possible, some precision can be lost.
For a complete list of point cloud formats supported by FME, see the FME Integrations page and filter the category by LiDAR and Point Clouds.
Video
This video demonstrates how to convert delimited text point cloud data (.xyz file) to the ASPRS LiDAR Data Exchange Format (.las). This video was recorded with an older version of FME and the instructions may differ from the article.
Step-by-step Instructions
Writing to LAS
A workspace template showing the completed steps is available for download from the link on this article.
1. Open FME Workbench and Add a Reader
In FME Workbench, start with a blank workspace and add a Reader using the menu Reader > Add Reader or by using the Reader button on the toolbar.
In the Add Reader dialog type "XYZ" into the format field and select "Point Cloud XYZ" when it appears. For dataset, browse to 000734.xyz and select it. Finally, we need to set the coordinate system as the Point Cloud XYZ format doesn’t store it. Set the Coord. System to UTM83-10.
Click on the Parameters button and ensure that FME is reading in the file correctly, there should be data shown in the File Preview section. For more information on reading in XYZ files, see Reading Point Clouds. Click OK twice to add the reader.
2. Add a LAS Writer
Click the Writer button to add a writer to the canvas. For the Format, type “LAS” and then select the ASPRS Lidar Data Exchange Format (LAS). Then browse to a location to save the dataset. Ensure that the LAS File Definition is set to Automatic, then click OK.
Click OK to accept the default parameters in the Feature Type dialog.
3. Run the Workspace
Connect the reader feature type to the writer feature type and then run the workspace. View the output dataset by clicking on the writer feature type to open the popup menu and then click on View Written Data.
After clicking on the View Written Data button, a Select Dataset to View dialog will appear. This is because the writer is getting the file name from the fme_basename. Click on the ellipsis next to Dataset and choose 000734.las and then click OK.
In Visual Preview, notice that a single feature is written representing the entire point cloud. Check that a LAS file was created in the destination directory. Also note the warnings in the FME log, which tell us that the x, y, and z values were converted to Int32. This occurs because the LAS format stores all values as an integer with a scale and offset. Depending on the number of decimal places in the XYZ source file, some precision may be lost.
Writing to Oracle Spatial Point Cloud
To write to the Oracle Spatial Point Cloud format, you need to have an Oracle client library installed on the same machine as FME. For more information on working with Oracle in FME, please see the Tutorial: Getting Started with Oracle article series.
1. Open FME Workbench and Add a Reader
In FME Workbench, start with a blank workspace and add a Reader using the menu Reader > Add Reader or by using the Reader button on the toolbar.
In the Add Reader dialog type "XYZ" into the format field and select "Point Cloud XYZ" when it appears. For dataset, browse to 000734.xyz and select it. Finally, we need to set the coordinate system as the Point Cloud XYZ format doesn’t store it. Set the Coord. System to UTM83-10.
Click on the Parameters button and ensure that FME is reading in the file correctly, there should be data shown in the File Preview section. For more information on reading in XYZ files, see Reading Point Clouds. Click OK twice to add the reader.
2. Add an Oracle Spatial Point Cloud Writer
Click the Writer button to add a writer to the canvas. For the Format, type “Oracle Spatial” and then select the Oracle Spatial Point Cloud format. Then for Connection, select a previously created connection or select Add Database Connection. For information on how to connect to an Oracle database, please see Viewing and Inspecting Oracle Data.
Once the connection is set up, click on the Parameters button.
In the Parameters dialog, additional point cloud components can be added. In the Dimension/Component Map section, add intensity. Click OK twice to add the writer.
In the Feature Type dialog, set the Table Name to PC_00734 and then set the Table Qualifier to which user you are going to write to. For this example, our qualifier is SUPPORT, but yours will be different. The other parameters can be left as the defaults.
3. Run the Workspace
Connect the reader feature type to the writer feature type and then run the workspace. View the output dataset by clicking on the writer feature type to open the popup menu and then click on View Written Data.
In Visual Preview, click on a single point within the point cloud and view the attributes in the Feature Information Window. You will see that each point has an x, y, z, and intensity value that was set up when we added the writer.
Writing to ASTM 57
The ASTM 57 format is an exchange format that can store 3D point clouds and 2D rasters.
1. Open FME Workbench and Add a Reader
In FME Workbench, start with a blank workspace and add a Reader using the menu Reader > Add Reader or by using the Reader button on the toolbar.
In the Add Reader dialog type "XYZ" into the format field and select "Point Cloud XYZ" when it appears. For dataset, browse to 000734.xyz and select it. Finally, we need to set the coordinate system as the Point Cloud XYZ format doesn’t store it. Set the Coord. System to UTM83-10.
Click on the Parameters button and ensure that FME is reading in the file correctly, there should be data shown in the File Preview section. For more information on reading in XYZ files, see Reading Point Clouds. Click OK twice to add the reader.
2. Add an ASTM 57 Writer
Click the Writer button to add a writer to the canvas. For the Format, type “ASTM” and then select the ASTM 57 format. Then browse to a location to save the dataset. Ensure that the File Definition is set to Automatic, then click on the Parameters button.
In the parameters dialog, additional point cloud components can be added. For this example, we will add intensity. Click the plus button in the Point Cloud Component Mapping section to add a new component. In the new component, click the drop-down and select intensity, the Element Name will auto-populate. Click OK twice to add the writer. For a full list of point cloud components, please see the point cloud documentation.
In the Feature Type dialog, change the File Name to 000734 and click OK.
3. Run the Workspace
Connect the reader feature type to the writer feature type and then run the workspace. View the output dataset by clicking on the writer feature type to open the popup menu and then click on View Written Data.
In Visual Preview, click on a single point within the point cloud and view the attributes in the Feature Information Window. You will see that each point has an x, y, z, and intensity value that was set up when we added the writer.
Data Attribution
The data used here originates from open data made available by Map West Virginia.
Comments
0 comments
Please sign in to leave a comment.