Skip to main content
Solved

How to extract end coordinates of a polyline geometry?


Forum|alt.badge.img

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?

Best answer by caracadrian

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

View original
Did this help you find an answer to your question?

5 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • February 4, 2021

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


Forum|alt.badge.img
  • Author
  • February 4, 2021
caracadrian wrote:

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.


Forum|alt.badge.img
  • Author
  • March 2, 2021
ppp19 wrote:

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?


DanAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • March 2, 2021

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


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • March 2, 2021
ppp19 wrote:

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😉


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