Skip to main content

Hello everyone,

I am currently making a script that looks for houses that have a garden. 

In my current script I have two datasets: 1) houses, 2) gardens
I used for now the NeighborFinder transformer and I have a maximum distance of zero, since the gardens and the houses need to touch one another. So far, so good. However, now I get another problem.

I have the following situation. You can see in the drawn example below that the garden and House 1 share a line, while this is not the case for House 2. However, based on my current settings in the NeighbourFinder, the garden is as well considered a neighbour for House2.

How can I go about it, that House 2 is not included, since House 2 and the garden don't share a line, but only one vertex. Do I need to change  some settings in the NeighbourFinder or do I have to go differently about it.

 

 

This is more a Topology analysis problem rather than spatial proximity.

 

TopologyBuilder will output the common Edges between Areas/Polygons, and moreover can, using Lists, output for each common Edge, the identifier of the House, and the identifier of the Garden.

The caveat is that the polygon vertices need to be snapped together or to polygon boundaries using Eg. Snapper AnchoredSnapper,  AreaGapAndOverlapCleaner etc. in order for topology to be calculated properly.

From there, TopologyBuilder can output the common Edges and List the Garden and House “Faces” that share the common Edge.

 

 

 

Viewing the results output from TopologyBuilder can see the Common Edge that has both a House ID and a Garden ID in the List of Faces (Polygons) that share that Edge.

 

 


@bwn Thank for the elaborative explaination and for the pictures and introducing me to the transformer TopologyBuilder! For my case, it is indeed better to use TopologyBuilder instead of the NeighbourFinder.  I managed to make it work in FME with the TopologyBuilder, however it just took me some time to understand the TopologyBuilder a bit and there is one thing which I don't understand yet.

 

In the TopolgyBuilder you create a list from the faces, but I would assume you would create a list of the edges, since I am interested in the edges/lines (nodes are points, edges are lines and faces are areas) that match a garden as well a House.

But maybe there is something I don't understand yet.

This list you then attach to the edges and then afterwards with the listsearchers you look for edges that have a match as well with a garden and a House.

 


Think of it as the Edges port is outputting essentially a lookup table:  Each Edge has a List of Houses bordering it, and a List of Gardens bordering it.  So this has the data within it for Garden.ID vs House.ID.   The Edges Port has a common “key” value that we can use to join them together in a lookup table being the _edge_id value.  In the example above,  Garden 1 borders _edge_id = 3  and House 1 borders _edge_id=3,  so we can join them together on the  _edge_id Attribute to form the House vs Garden lookup table.

To continue the workspace is, from the ListExploder is to separate the Garden IDs from the House IDs and then join them in FeatureJoiner to make a lookup table.

 

 


Reply