Skip to main content
Question

Finding start and end pint of a line


hiyhelg
Contributor
Forum|alt.badge.img+4

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

hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 2, 2024

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

 


nielsgerrits
VIP

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


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 2, 2024

 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

 


nielsgerrits
VIP

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.


nathand2
Contributor
Forum|alt.badge.img+5
  • Contributor
  • April 2, 2024

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


hiyhelg
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 2, 2024

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).

 


redgeographics
Celebrity
Forum|alt.badge.img+47

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings