Solved

Link polygons using a line layer

  • 2 December 2019
  • 5 replies
  • 8 views

Badge +2

I have a set of polygons with OwnerID and a set of polygons without OwnerID. On another layer, I have connection lines. I am trying to give OwnerID attribute to linked polygons using the endpoint of lines to link them together.

LineOnAreaOverlayer is good for 90% of the cases but some polygons are traversed by the lines and sould not be considered.

here is sample, green polygons has an OwnerID, white polygons don't

Usually, I have only two (2) polygons to link together,

but sometimes there is multiple polygons to chain link together.

 

Any Idea ?

Thank you

icon

Best answer by ebygomm 3 December 2019, 13:15

View original

5 replies

Userlevel 2
Badge +12

This requires a few steps:

First get the ownership on the lines by using the green polygons and the lines in a LineonAreaOverlayer.

Then replace the line by the two end point (VertexCreator) with the ownership.

Use the white polygons and the points to transfer the ownership on the white polygons, using a pointonAreaOverlayer.

These steps need to be repeated until all polygons are green (have ownership).

Hope this helps.

Badge +3
  1. Convert the Link Line Geometries into End MultiPoints by using Snipper then Aggregator. This eliminates false intersections between Lines and Properties that just happen to be between the 2 end points. Now the MultiPoint Geometries will only intersect with Properties on the end points of the Link Lines.
  2. You can then use a similar Workspace as to what you've already got: Instead of LineOnAreaOverlayer, now use PointOnAreaOverLayer. Or.......do something like below, this puts the Parent Property ID and the Remote Property ID as Merged Attributes to the Link Lines, and then uses FeatureMerger to merge the Parent Property ID back to the Remote Property.

assignpropertidtosatelliteproperty.fmw

Badge +3

...for the second part of the problem, where there are cascading Satellite properties linked to each other, then to avoid iteration you are best to form an Isochrone Chart of each "Subnetwork" of properties.

FME has a ready-made transformer for this called NetworkTopologyCalculator (which I love for tracing Networks like this......cuts out a whole lot of other programmatic/iteration methods that otherwise needs to be done and seems to have reasonably high performance). What this Transformer does is find all Isochrones/Subnetworks and assigns them a Unique Group Integer ID. So in this way you can then use results from the previous answer where you have a Parent Property linking to a Satellite Property, to then merge those results to the complete toplogically connected group of Satellite Properties that trace back to a Parent Property, because NetworkTopologyCalculator has conveniently already traced them all back to the Parent Properties for you.

As NetworkToplogyCalculator uses Line End Points to Line End Points snapped together to figure out the SubNetworks of linked Properties, there is a little bit of transformation required. Essentially the Property and Link Line base geometries you have need to first be converted into Toplogically snapped together Property "Nodes" that have any Link Lines that go to this Property drawn to these representative Nodes and touching each other:

  1. Create a Node representing all Properties by using CenterPointReplacer. It doesn't matter where this Point gets put.....it is just going to be a place to snap the ends of the link lines to to make these line ends touch each other
  2. Put the X and Y coordinates as Attributes on these Nodes by using CoordinateExtractor
  3. Use PointOnAreaOverlayer on the Multipoint End Points as discussed on the previous solution but output this to a List on the Areas that is comprised of the LinkLineIDs
  4. Use ListExploder to flatten this into a table of PropertyID vs LinkLineIDs lookup table. Because CoordinateExtractor put X,Y on the Property Nodes, you should now have a groups of X,Y attributes per LinkLineIDs that correspond to the Center point of each Property that Link Line's end point intersects with.
  5. Use Sorter to sort this by LinkLineID and the feed this into LineBuilder that redraws the link lines using the Property Node X,Y values (the Connection Break attribute will be the LinkLineID so that LineBuilder starts a new line whenever LinkLineID changes)
  6. Chopper on the end result with Max Vertices=2 to make sure you get end point to end point touching, because the PointOnAreaOverlayer/ListExploder/Sorter method may end up giving Lines with more than 2 vertices where there are multiple Properties overlaying each other with the one Link Line touching it.
  7. Finally NetworkToplogyCalculator on the resulting Lines now connected together at the Property Center "Node" will give the Property link Subnetworks since now they are represented with End-to-End touching. You can use a Tester after the first pass of getting Parent Property IDs to the Satellite properties (as discussed in the previous solution) to figure out which Satellite Properties didn't get a Parent Property ID and which ones did. The ones that didn't can get theirs by FeatureMerger against the ones that did by having the NetworkToplogyCalculator Subnetwork IDs as the common Join Attribute value.
Userlevel 1
Badge +10

I'd use a spatial relator to relate polygons to lines that start and finish within them to build a list of line_ids, then a listcombiner (custom transformer) to create groups that reflect the 'chain linking' of polygons, then transfer the title id for each group to the relevant polygons

Output

Assign_title_to_property.fmwt

Badge +2

I'd use a spatial relator to relate polygons to lines that start and finish within them to build a list of line_ids, then a listcombiner (custom transformer) to create groups that reflect the 'chain linking' of polygons, then transfer the title id for each group to the relevant polygons

Output

Assign_title_to_property.fmwt

This is working well ! Thank you !

Can you explain the spatial test "1020F1102" used in the spatial Relator ? I understand, according to my searches that it refers to a test matrix but I can't figure out how it is interpreted. It works so well, it's like magic !!!... I would like to understand the magic so I can apply it elsewhere :)

 

Thank's again !

Reply