Skip to main content
Solved

How to extract end coordinates of a polyline geometry?

  • February 4, 2021
  • 5 replies
  • 103 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

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

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

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+21
  • 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

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😉