2

First of all, I'm new to FME, but I'll try to be specific with my question.

I have two different shapefiles with point features. These points have information on bridges and overpasses etc. but are from different providers. These points are located quite close to the actual location of these bridges etc. So I think a spatial join can be done in this case.

The problem is, there are sometimes a lot of different points in one layer and only one point in the other layer. Both layers have one attribute in common, which represents the road number where the bridge etc. is located.

In FME I have tried to join these two layers with "NeighborFinder" -transformer, with 50 meter search radius. I think I could be more precise with the join if I could prefer joins that have common attribute.

For examble If point A has two different points close to it in the other layer. Point B is 10 meters away and point C is 45 meters away. In this case Neighborfinder would join point B to point A. But, I'd like FME to check what is the ROADNUMBER attribute in point A, then check what points are within 50 meters from it, then check if any of the points close to it (B & C) have ROADNUMBER attribute similar to point A, If there is similar attribute on either of these, the one with similar attribute would be preferred and joined to point A. In case there was no similar attribute, then just the closest point would be joined to point A.

Another thing i would like to know, is the number of candidates available for join within the search radius, but this is just secondary knowledge in this case.

  • This "join" is usually defined by giving one or more attributes in the Group By parameter – Detlev Nov 27 '15 at 17:13
  • Joiner will also do the ROADNUMBER match docs.safe.com/fme/html/FME_Transformers/… performance will be impacted with many features – Mapperz Nov 28 '15 at 2:02
  • Can Joiner do spatial joins (join by location) or only attribute joins? Can / should it be used with NeighborFinder? If so, then before or after? – Sisuaski Nov 28 '15 at 10:07
2

@Detlev is correct, the Group By parameter is just for this purpose.

In your neighborfinder, set all the parameters as you did previously. However, set the Group By parameter to ROADNUMBER.

enter image description here

You can run your analysis on anything that comes out of the Matched port. You can attach another NeigborFinder without a Group By parameter out of the Unmatched Candidate to pick up anything that is still within 50m but not necessarily with the same ROADNUMBER attribute.

As far as how many neighbours to test for, that depends on your requirements. The more you have, the more time consuming the analysis. Is 10 too many? Is 50? Depends on how many points are in your dataset and what is a reasonable number of neighbours.

  • Thanks for your answer, it helped a lot. Would you happen to know, how can I count the number of available candidates in the join. For examble, I have 50 m search radius set, and neighborfinder picks the closest candidate. I'd also like to know how many other candidates were there within that 50 m radius. Can this be count into an attribute with NeighborFinder, or do I need some other transformer? (I asked this as "secondary knowledge, but have come to conclusion that it's rather important info) – Sisuaski Dec 15 '15 at 6:20
  • This can easily be done using lists. Define a list in the "Close Candidate List Name". That will store all the neighbours in a list. You can use a ListElementCounter for that. – Fezter Dec 16 '15 at 22:18
  • I'm just falling in love with FME. Thanks, your advice was helpfull! I added "Close Candidate List Name" to Neighborfinder -transformer. I also Increased the number from 1 to 10 in the "Number of Neighbors to Find" -field to get more than 1 candidates counted. – Sisuaski Dec 18 '15 at 8:33
  • First I used "Close Candidate List Name" transformer by adding one to every neighborfinder, but later realized it only requires one for all neighborfinders. I'm finding myself being very newbie, but getting there eventually :D – Sisuaski Dec 18 '15 at 8:41

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.