Skip to main content
Question

Join points to nearest line and summarise

  • December 21, 2016
  • 3 replies
  • 127 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.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+19
  • 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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings