Hi, I have a CSV file with 20 spatial points & I was able to convert the points into a line (using LineBuilder) but the line which is created is having a single feature to it. I have used Chopper Transformer to cut the line. It does the job for cutting the lines but all features get same as the first one feature.
How I can separate the feature as well with the lines
Please Help ..!
Best answer by geomancer
geomancer wrote:
Passing your (visible) point data through a modified version of my workspace (see attachment) I get the following results:
Hi @rohan98 , the VertexCreator changes point features into line features when in Add Point mode.
To make this work, I first added to each feature the coordinates of the next feature as attributes in the AttributeManager, by utilizing the Enable Adjacent Feature Attributes setting, looking forward to the next ('subsequent') feature.
You can create lines from the input points, where the second point gets the coordinates of the next feature.
You can realise this by first adding the coordinates of the next feature to a point (using an AttributeManager with 'Enable Adjacent Feature Attributes'), and then adding a vertex to the point, using these coordinates, thus creating a line.
in the attached workspace the CSV file contains attributes called X and Y, which FME 'automagically' recognises as coordinates. And of course the last point has to be treated different, as it has no next feature.
Does your CSV data have a field that indicates which points belong to which lines? (ie. Line1, Line2, etc.) If so, you can Group By this field in the LineBuilder, and it will output separate lines.
You can create lines from the input points, where the second point gets the coordinates of the next feature.
You can realise this by first adding the coordinates of the next feature to a point (using an AttributeManager with 'Enable Adjacent Feature Attributes'), and then adding a vertex to the point, using these coordinates, thus creating a line.
in the attached workspace the CSV file contains attributes called X and Y, which FME 'automagically' recognises as coordinates. And of course the last point has to be treated different, as it has no next feature.
You can create lines from the input points, where the second point gets the coordinates of the next feature.
You can realise this by first adding the coordinates of the next feature to a point (using an AttributeManager with 'Enable Adjacent Feature Attributes'), and then adding a vertex to the point, using these coordinates, thus creating a line.
in the attached workspace the CSV file contains attributes called X and Y, which FME 'automagically' recognises as coordinates. And of course the last point has to be treated different, as it has no next feature.
Passing your (visible) point data through a modified version of my workspace (see attachment) I get the following results:
Passing your (visible) point data through a modified version of my workspace (see attachment) I get the following results:
Thanks this works 😊 .
I was just trying it in different way like adding a counter to it & giving it a unique id to it & then passing it through the vertex creator (Mode ->Replace with Points) then create a line from with their specified ids but I am ending up 1st attribute to all other.
Does your CSV data have a field that indicates which points belong to which lines? (ie. Line1, Line2, etc.) If so, you can Group By this field in the LineBuilder, and it will output separate lines.
I have used counter to generate unique ids to it & then pass it through vertex creator & in line builder when ever I use Group By this field I wont get any output.
Does your CSV data have a field that indicates which points belong to which lines? (ie. Line1, Line2, etc.) If so, you can Group By this field in the LineBuilder, and it will output separate lines.
A solution using 2 LineBuilders in parallel with GroupBy:
Add the steps from either of my workspaces (VertexCreator in Add Point mode, or LineBuilder, in both cases using appropriate attributes you have created before) and you will get line objects between two adjacent points.
And undoubtedly there are other ways to create the line objects. Try and learn!
Passing your (visible) point data through a modified version of my workspace (see attachment) I get the following results:
Hi @rohan98 , the VertexCreator changes point features into line features when in Add Point mode.
To make this work, I first added to each feature the coordinates of the next feature as attributes in the AttributeManager, by utilizing the Enable Adjacent Feature Attributes setting, looking forward to the next ('subsequent') feature.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.