Skip to main content
Question

Join points to nearest line and summarise

  • December 21, 2016
  • 3 replies
  • 193 views

I have two datasets:

1) road (line)

 

2) incidents (points)

 

 

I need to join the incidents to the nearest line and summarise how many points are on each line. I have tried NeighborFinder but I only get results coming out of the reject port. this would be a simple spatial join in Arc/QGIS and I'm sure there's a transformer(s) in FME that does this.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • December 21, 2016

The NeighborFinder only rejects objects without geometry. You could check on the geometry type by using a GeometryFilter.

Another issue could be if the points and lines are in different coordinate systems.

If this is solved the NeighborFinder should be the right transformer.


Forum|alt.badge.img
  • December 21, 2016
Firstly, run the data through a GeometryFilter to make sure FME sees the points as points and the line as lines. Your points should be the Base and the line should be the Candidate.

 

 

Before the points enter the NF, attached a Counter. This will give each road a unique count. You can then (after the NF) use a StatisticsCalculator to give the Total Count, with Group By set to the Counter value. This will give you number of points per road (i.e. the count). If each road has a unique name/attribute, you can use this in lieu of the Counter. You need to exit the Complete port of the SC to get all the points.

 


  • Author
  • December 22, 2016

Thanks @amit your suggestion worked perfectly