Question

Finding start and end pint of a line

  • 2 April 2024
  • 7 replies
  • 59 views

Badge +3

Dear FME community,

I have a featureklass of lines. I want to find the start and end point of the lines. I used the Snipper transformers, setup as the screen shot below. '0' is the first vertex, '-1' is the ending vertex but the start and  end points which I created , don not lie along the line. I also used coordintateExtractor,, it gave me the same result. I couldn’t figure out what went wrong.

I would appreciate any help to solve this problem.


7 replies

Badge +3

Sorry i forgot to attach the PrtSc of the transformers i used.

 

Userlevel 6
Badge +32

You lines might be collections / aggregates. You can check this using the AggregateFilter.

Badge +3

 I checked it, the lines are not aggregates. I have 3000 lines,  I get 3000 start points and 3000 end points but location of the startpoint and end point donot fit with the line

 

Userlevel 6
Badge +32

Weird. Can you provide a sample of a line where this happens? A zipped .ffs file with the line without attributes? Takes a Sampler to get one feature, an AttributeKeeper to strip all attributes and a FeatureWriter to write to ffs.

Badge +3

I did this once as well, used a similar approach as you did, but I did not extract all coordinates, but used a ‘specify coordinate’ extraction. This way I did not use a ListIndexer, because it is in separate transformers. Might work for your case as well

Badge +3

Thank you for your replay. My idee is  to label start and end point of  the line. Stlil the vertex I am making does start and  end at lines( see the printScren).

 

Userlevel 5
Badge +25

Instead of the Snipper try 2 CoordinateExtractor (parallel) to get the coordinates of a specified point as attributes (index 0 is the first point, -1 is the last point) and then a VertexCreator to replace the line with a point taken from those attributes

Reply