Question

populating attributes from polygon to polyline using nearest neighbour or spatial relator?

  • 27 February 2020
  • 2 replies
  • 20 views

Hi,

Sorry if this is a super easy question that i have just misinterpreted on how to use the transformers. But i haven't got the accuracy i thought i would, so would love some guidance/help.

 

Basically i have Road network polygons that include an Asset ID field that i need to transfer across to the neighbouring Kerb and Channel Polylines that i have. The polylines contain no attributes that i need to maintain.

The Kerb and Channel polylines (red lines in image below )are within 1m of the road network polygons (cream(ish) polygons in image below) but they in no way ever intersect or are contained within each other at any point.

Conceptually what i want to do is simple, but i just haven't managed to achieve it with either Nearest Neighbour or Spatial Relator. Should i be using a different transformer altogether?

 

Thank you in advance

 


2 replies

Userlevel 1
Badge +21

The tricky bit here is that the ends of lines can be within 1m of multiple polygons as circled in red.

 

From your sample data, I would probably approach this by extracting the line geometry into an attribute with a geometry extractor. Then use a snipper to snip 50% off each line to convert the line to a point, use this as a base in the Neighbour Finder with the polygons as candidates, and merge attributes. Then use a geometry replacer to restore the original line geometry.

Badge +2

@courtknee82 The Matcher had an upgrade in FME 2019 that uses the Frechet distance to match lines that are nearly parallel. I wonder if this would work with your data? The blog Upserts and Dog-Walking gives some background on the new Matcher capabilities.

Reply