Question

Calculate Start, End and Middle Coordinates for Polylines


Badge

Hi All,

I have a shapefile that consists of polylines (some lines are curved) and I want to calculate new attributes for the start, end, and middle xy coordinates for each line. The final results should be the original geometry but with 6 new attributes.

Note that the middle coordinates need to be on the line, not the bounding box.

Any thoughts on how to best accomplish this task?

Regards,

Michael


3 replies

Badge +2

Hi @potterman81

One way you could find the coordinates for the middle point of each line would be to first use a Snipper. In here set the Snipping Mode to Distance (Percentage) and set both the Starting and Ending Location to 50 (see image attached). This essentially creates a point feature at the centre of the line. From here you can use the Coordinate Extractor and using the Mode Specify Coordinates you can rename the X and Y attributes to signify this is the middle xy point.

Badge

The coordinate extractor with parameter 0 for the start and -1 for the end will extract the start and finish vertices and allow then to be added as attributes

Badge +2

Hi,

I think you are asking only about arcs in polylines and not rest of the line right?

or does the sugestions received were answered your question.

Pratap

Reply