Question

Using TopologyBuilder to extract border polylines from polygons

  • 19 February 2022
  • 2 replies
  • 48 views

I’m struggling with the TopologyBuilder transformer and, since I’m sure my use case is quite common, I hope someone might be able to help me.

 

I want to extract the topological boundary polyline from polygons. In addition to the polyline geometry, I’d like to carry polygon attributes through to left and right-side attributes of each new polyline. For example, if my input polygons were countries of the world, I’d like my output polylines to be borders with each attributed with the country on each side. e.g. Left: France, Right: Germany.

 

I’ve got the polylines geometry coming out of the TopologyBuilder perfectly, but not so lucky on the attributes. I get _left_face and _right_face attributes coming out, but these edge IDs don’t seem to mean anything. They don’t relate to any input attributes, nor are the polygon table row id.

 

I’ve also tried “Generate List From Input Faces”, defined a list name, Selected Attributes, and my attribute field name. Sadly, none of these are populated on the output. Ideally, I would like attributes associated with the left and right of the line, rather than a list, anyway.

 

Any help appreciated!

/Warren

 

 

 


2 replies

Userlevel 3
Badge +17

Hi @warren​ , all the attributes of input polygons will be transferred to the features output from the Face port of the TopologyBuilder, and every Face feature has "_face_id" attribute. The "_left_face" and "_right_face" of each Edge feature links to a "_face_id".

Therefore, you can merge the attributes of left or right Face feature (originally from the input polygon) to Edge feature using "_face_id" and "_left/right_face" as join key.

Many thanks, @Takashi Iijima​. You've clearly explained that I can get a handle on the face_id, plus my original polygon attributes, from the Face output port. Now, I have to admit, most of my FME workflows are quite serial in nature and I have not split and merged streams before. How can I efficiently merge/join the streams coming from the Edges and Faces ports? For each edge, I need to use the _left_face and _right_face to lookup by _face_id from the Faces stream and then pick up the attribute field I'm actually interested in. This would be the country name field in my example. I would then have something like left_country and right_country attributes attached to my polyines.

Reply