Solved

How to extract end coordinates of a polyline geometry?

  • 4 February 2021
  • 5 replies
  • 8 views

Badge

Hi Community,

I just wanted to know that for a pipe geometry co-ordianates...council ideally collect points for particular pipe as a polyline (meaning having more than two co-ordinates for a line).

My Question is how to collect co-ordinates of starting and end point of a specific line out of given all co-ordinates defining a polyline?

icon

Best answer by caracadrian 4 February 2021, 06:47

View original

5 replies

Badge +20

Use CoordinatesExtractor set to Specify Coordinate. For start point use Index 0 and for end point index -1

Badge

Use CoordinatesExtractor set to Specify Coordinate. For start point use Index 0 and for end point index -1

Hi @caracadrian,

thanks for your reply on this. I usually keep index 0 and -1 using coordinateextractor..but I want to make sure that it is giving me exact end points of that poly line and not any random two points out of it.

Badge

Hi @caracadrian,

thanks for your reply on this. I usually keep index 0 and -1 using coordinateextractor..but I want to make sure that it is giving me exact end points of that poly line and not any random two points out of it.

Hi There,

Any comments on my previous question please?

Userlevel 2
Badge +11

Hi @ppp19​  Yes, index 0 returns the first coordinate, and -1 is the last coordinate. There is no randomness with the CoordinateExtractor.

Badge +20

Hi @caracadrian,

thanks for your reply on this. I usually keep index 0 and -1 using coordinateextractor..but I want to make sure that it is giving me exact end points of that poly line and not any random two points out of it.

What @danatsafe​ said.

In programing 0 is the first element and -1 is the last. Well, sometimes, -1 is previous, but first+previous=first+last, unless you have a polygon (closed polyline/area feature), in witch case first=last. So... what DanAtSafe said😉

Reply