Skip to main content
Solved

Extracting points from line (SHP)


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.

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

4 replies

takashi
Influencer
  • 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
  • May 7, 2018
takashi wrote:
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
Influencer
  • 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
  • May 7, 2018
takashi wrote:

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.

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