Skip to main content
Solved

Extracting points from line (SHP)

  • May 7, 2018
  • 4 replies
  • 675 views

Forum|alt.badge.img

Hello, I have a .SHP with lines and I need to extract X, Y coordinates as points for start and end nodes of lines and give them an ID. I could have a polyline containing several lines connected, in that case end node of first line is the same point as start point of next line. I tried with CoordinateExtractor, CoordinateConcentenator, AttributeKeeper but had no luck. Is there any solution for my problem?

Best answer by takashi

To extract points {p0, p1, p1, p2, p2, p3} from a polyline p0-p1-p2-p3, you can do that with two Choppers in series.

  1. Chopper (Mode: Vertex, Maximum Vertices: 2)
  2. Chopper (Mode: Vertex, Maximum Vertices: 1)

To extract points {p0, p1, p2, p3} from the same polyline, you can just use a single Chopper.

  1. Chopper (Mode: Vertex, Maximum Vertices: 1)

I don't think you need to use SpatialRelator.

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.

4 replies

takashi
Celebrity
  • 7843 replies
  • May 7, 2018
If a polyline has four vertices p0, p1, p2 and p3, which one is your desired result - {p0, p1, p1, p2, p2, p3} or {p0, p1, p2, p3}?

 

 


Forum|alt.badge.img
  • Author
  • 39 replies
  • May 7, 2018
If a polyline has four vertices p0, p1, p2 and p3, which one is your desired result - {p0, p1, p1, p2, p2, p3} or {p0, p1, p2, p3}?

 

 

@takashi, it doesn't matter. I need to write this points to Oracle DB. First result would be easier, I think, where I would just write to DB, and second i would need to use SpatialRelator before writing to DB.

 


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • May 7, 2018

To extract points {p0, p1, p1, p2, p2, p3} from a polyline p0-p1-p2-p3, you can do that with two Choppers in series.

  1. Chopper (Mode: Vertex, Maximum Vertices: 2)
  2. Chopper (Mode: Vertex, Maximum Vertices: 1)

To extract points {p0, p1, p2, p3} from the same polyline, you can just use a single Chopper.

  1. Chopper (Mode: Vertex, Maximum Vertices: 1)

I don't think you need to use SpatialRelator.


Forum|alt.badge.img
  • Author
  • 39 replies
  • May 7, 2018

To extract points {p0, p1, p1, p2, p2, p3} from a polyline p0-p1-p2-p3, you can do that with two Choppers in series.

  1. Chopper (Mode: Vertex, Maximum Vertices: 2)
  2. Chopper (Mode: Vertex, Maximum Vertices: 1)

To extract points {p0, p1, p2, p3} from the same polyline, you can just use a single Chopper.

  1. Chopper (Mode: Vertex, Maximum Vertices: 1)

I don't think you need to use SpatialRelator.

Either one is good, I think i will be using the second one. Thank you @takashi. You are right, i don't need SpatialRelator.