2

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?

2

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.

  • Thanks for the answer. I will try this workflow. One more question. In what units I set the distance? I see there is measure tool in the inspector but where do I set the unit? – user1919 Mar 17 '15 at 11:25
  • 1
    I believe they're whatever the units of the data projection are. The documentation confirms - docs.safe.com/fme/html/FME_Transformers/… "The maximum distance is measured in the units of coordinates of the input features." – GIS-Jonathan Mar 17 '15 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.