[GIS] FME – How to merge geometries that they are in a distance of x meters

fmemerge

I have a CAD file which I import in FME. I have two different geometries. A polygon and a point geometry. Each point geometry has some attributes which I want to pass to the polygon geometry. Both the points and the polygons have no id. So I can not merge based on the id.
I thought to use a "merge geometry in distance within" transformer.
Is there something like this?
For example: merge all the points and polygons which are in a distance of x into a big point (or polygon).

How do I do this in FME?

Best Answer

There is no single transformer for this. Instead you must use a combination of transformers.

  • First, a NeighborFinder, setting the "Maximum Distance" to whatever you want the search distance to be.
  • Pipe the points into one input, and the Polygons into the other; I don't believe in this case it should matter which.
  • Enter a name for "Close Candidate List Name" too.
  • The results that come out of MATCHED have found a matching point/polygon.
  • These results should go into a ListSorter - sorting by the distance, numeric, increasing. This way you're finding the nearest candidate.
  • Then use a ListIndexer on the list, using a List Index of 0. This gets the attributes of the nearest candidate and gives them to the base feature.

It's also possible to throw a FeatureMerger onto the end to then pull the geometry through too using the id of the feature you're now got via the NeighborFinder.