Skip to main content
Question

Count shared edges of a polygon?


aron
Supporter
Forum|alt.badge.img+16
  • Supporter

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

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

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


virtualcitymatt
Celebrity
Forum|alt.badge.img+35

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


aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • October 25, 2021

@virtualcitymatt​ @nielsgerrits​ 

 

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

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings