Skip to main content

I want to single out polygons that share only one edge with other polygons. In the example below the polygon circled in red has one shared edge whilst the blue polygons have two neighbouring edges.

 

I have tried everything I could think of using TopologyBuilder but have not found a way to separate "reds" from "blues". I can't find a useful patern amongst lists and attributes.

 

Any suggestions on how to count how many of a polygons edges are shared with other polygons?

 

House

You can do this with a LineOnLineOverlayer, see attached workspace.


This worked for me:

The process assumed no overlapping polygons, only polygons with hared or no boundaries. It also assumes that an edge is a single line segment (two vertices).

 

  1. Create unique ID for each polygon
  2. Extract polygon geometry to later get back
  3. Use Chopper to split polygon into line segments (max verts = 2)
  4. LineOnLineOverlayer (Separate colinear segments = yes) and make sure to set overlap count attribute
  5. ExpresisonEvaluator - subtract 1 from overlap count attribute (this should result in '0' for edges not touching anything and a '1' for shared edges)
  6. Aggregate, group by the original polygon id - set attributes to sum to be the overlap count Attribute. You should now have one feature with the number of shared boundaries
  7. Use GeoemtryReplacor to restore original geometry

 

image


@virtualcitymatt​ @nielsgerrits​ 

 

Thanks to both of you! Subtracting the overlay by 1 gave me the tools to move on.

 

 


Reply