Skip to main content

Hello,

I'd like to generate lines out of a list of points created with the VertexCreator out of an Excel file. The solution might be a PointConnector, but this transformer creates one polyline out of these points. However, I need lines, not a polyline. I want to generate a line from point 1 to point 2, a line from point 2 to point 3 and so on.

Using the Chopper after running the PointConnector does not do the work because all the lines take the attribute values of the polyline which has the attributes of the first point. So all the lines have the information of point 1.

Thank you for answers and hints!

Felix

Hi @felixderglueckl, you need to use the connection break attribute(s) in the PointConnector to define groups that will be transformed into lines.

So essentially a unique id per group of point that should form one line.

Hope this helps.


Hi @itay

Thank you for your answer. I tried this as well, but the probem is that every attribute value changes from row to row. So the results are point objects.

So first I need that attribute field that is filled with line ids.

But first of all every point in that list need to be duplicated because the ending point of one line is the beginning point of the next one.

Is there a solution to solve the problems I mentioned?

Or is there another option to directly create lines out of a list of points?

Felix


Hi @itay

Thank you for your answer. I tried this as well, but the probem is that every attribute value changes from row to row. So the results are point objects.

So first I need that attribute field that is filled with line ids.

But first of all every point in that list need to be duplicated because the ending point of one line is the beginning point of the next one.

Is there a solution to solve the problems I mentioned?

Or is there another option to directly create lines out of a list of points?

Felix

Hi @felixderglueckl I cannot help you with generating the lines id since I dont have an idea how your data looks like and what it is about.

 

So you will need to generate that line ID some how, based on your knowledge of the data.

 

To duplicate each start point (to become end point) you can use the cloner.

 

You could look into the VertexCreator to generate lines from points, but I dont think it will help much...

 


This is the Excel table. The first column declares the point id. Coordinates are in the second and third column. The fourth column specifies the order in which the points must be connected through lines.


This is the Excel table. The first column declares the point id. Coordinates are in the second and third column. The fourth column specifies the order in which the points must be connected through lines.

I take it that there are more points in your file and that this is an example.

 

You would try to generate an unique id based on the order column, since each group will start with 1.

 

Depending on your data size, it might be easier to create the grouping id manually in xls.

 

 


I take it that there are more points in your file and that this is an example.

 

You would try to generate an unique id based on the order column, since each group will start with 1.

 

Depending on your data size, it might be easier to create the grouping id manually in xls.

 

 

Yes, this is an example to show you the structure of the Excel sheet. There are a few more points.

 

Thank you for your answer! I think I'll realize that with an Excel macro.

 


Yes, this is an example to show you the structure of the Excel sheet. There are a few more points.

 

Thank you for your answer! I think I'll realize that with an Excel macro.

 

xlsxr2none.fmwt this is what I had in mind...

 

 


Hi @felixderglueckl, I think there are several possible ways, but I have some questions that should be clarified to check if my approach can satisfy the requirement.

  1. Your requirement is to create line segments, each of which connects two adjacent points in the order defined by the 'Order' column. Is it correct?
  2. If #1 is correct, which attributes should be added to a resulting line - first node or second node?
  3. In your table example, the point having Point-ID=22 appears twice. What does it mean?

Hi @felixderglueckl, I think there are several possible ways, but I have some questions that should be clarified to check if my approach can satisfy the requirement.

  1. Your requirement is to create line segments, each of which connects two adjacent points in the order defined by the 'Order' column. Is it correct?
  2. If #1 is correct, which attributes should be added to a resulting line - first node or second node?
  3. In your table example, the point having Point-ID=22 appears twice. What does it mean?
If I understand your requirement correctly, this workflow does the trick.

 

Note: The AttributeManager creates a new attribute called '_geometry' which stores a geometry representation (OGC WKT format in the example above) for a line segment connecting between the point and the next point only if the 'Order' is less than the 'Order' of the next point. Otherwise - i.e. if the point is the last vertex of a line, it saves an invalid string into the '_geometry' so that the feature will be rejected by the next GeometryReplacer.

 


Reply