Question

Generate a median line


Hi, I'm trying to generate a median line between two groups of features, a mixture of lines and points. The inputs are shape files. In the cases I'm interested in the two groups do not overlap spatially. The resulting median line is a line that, at every position along it, is equidistant from the closest point (or point on a line) of each of the two groups. Has anybody done anything similar?


3 replies

Badge +3

@simonb

you could try neighbourfinder. Create lines from closest base and closest candidates. Then get center of that line.

To get a decent median line you should chop or segment the non points.

Other methods are more mathematical in nature.

Got a sample dataset?

Badge +1

hi @simonb, IF I've understood correctly (image below) then I think you could generate this from voronoi polygons, and you can use the VoronoiDiagrammer transformer to do that. I've attached an example workflow with some dummy point data - create voronoi polygons, turn them into lines and then chop into line segments, and then use the Matcher to identify those lines that match (ignoring orientation).

Hope that helps

Mary

example-median-lines.fmw

Hello again @gio, @1spatialmary

Thanks for the ideas, I'll try those out.

Here's a sample dataset of the kind of thing I'm dealing with (don't read anything into the location, just used a random empty bit of sea). In this case there is group A and group B, both of which consist of points and lines. The aim is to get a median line which separates A and B.

Cheers,

Simon

samplee.zip

Reply