Solved

Build 3D Line using x,y,z text file


Badge +1

I have a .csv file with x, y, z coordinates. From these points, I want to create a 3D line. Currently, I have the issue that the z coordinates are not being transferred onto the line when I create a line from the points. Does anyone have an idea of how I can proceed?

icon

Best answer by nielsgerrits 8 May 2024, 10:12

View original

7 replies

Userlevel 6
Badge +34

Multiple ways to do this.

One way is to read the CSV, define x,y,z colums as x,y,z coordinate. Then use a LineBuilder to connect the points.

Other was is to read the x,y,z as text, use a VertexCreator to create points from x,y,z, then the LineBuilder.

Badge +1

The issue is that when I do this, the z coordinates of the line are lost in the “LineBuilder”. So the line only takes the z-coordinate of the start, and the remaining data as well as the third dimension are lost.

Userlevel 6
Badge +34

The issue is that when I do this, the z coordinates of the line are lost in the “LineBuilder”. So the line only takes the z-coordinate of the start, and the remaining data as well as the third dimension are lost.

Not sure if I understand your issue. These steps produces 3D points and then 3D lines.

Can you share a sample of your data? Then I’ll create a workspace demonstrating this.

Badge +1

The input data looks like this. I cannot share the entire dataset with you, sorry. My script in FME is looking like this.

Thanks for your help

Userlevel 6
Badge +34

This works as expected. You see only one attribute because you set Accumulation Mode to Use Attributes From One Feature. But the actual 3d coordinates are in the line you see in the Graphics window in Visual Preview. If you want to keep all coordinates, check the Generate List box and configure it.

Badge +1

Perfect, it works. Thanks for your help

 

Userlevel 6
Badge +34

Cheers :)

Reply