Skip to main content
Question

Converting a multi-point geometry to a line

  • September 24, 2025
  • 9 replies
  • 106 views

ryoung
Participant
Forum|alt.badge.img+1

Hello,

I have been looking for ways to convert multi-point geometries to lines but havent been 100% successful so far. Given is a data set consisting of multi-point geometries identified by a unique key and various attributes.

Its a straightforward matter when the sequence of points forms a linear shape:
Deaggregate the multi-point geometries and feed the single points to a line builder which groups the lines by the unique key.

 

However it is not so straightforward when the points form an arc.
In these cases the line builder creates shapes resembling spider webs rather than arcs.
I tried various ways to sort the points spatially (e.g. with the spatial sorter) to better set up the line builder but so far without much success.

Can you think of other ways to deal with this kind of case?

 

Kind regards
Ricky

 

9 replies

ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • September 24, 2025

Can you share some example geometry?


ryoung
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • September 24, 2025

Hello,

here it comes, a sample shapefile containing the geometries that were described.

 

Thanks for looking into it and kind regards
Ricky


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • September 24, 2025

It sounds like there’s something going wrong with how you are grouping. With your example data if i deaggregate a multipoint that looks like this

 then use a linebuilder, i get no spiderwebs

 


ryoung
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • September 24, 2025

Hmm, interesting - will it be just as fine with this second data sample?
 

Thanks for checking so far

Ricky


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • September 24, 2025

I see the issue there. I may have an example somewhere of using the NeighborFinder and some python to sort the points.


ryoung
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • September 24, 2025

Would you like to share your approach when time allows it? :)


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • September 24, 2025

The process I’ve used before involves using networkx in python. I don’t have access to this currently so not sure it will work for this data.

This is the outcome of a pure FME approach, it’s not perfect because the distance between points in the multipoint geometries varies quite a bit

 


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • September 24, 2025

Thinking about network x got me thinking about the shortest path finder and it does a good job

Cost Type is By Straight Line Distance, Reorder From-To Line = Advanced, Reorder Points = All Points


ryoung
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • September 25, 2025

oh wow - thanks so much, I´m gonna check it out!