Skip to main content
Question

How to exclude vertex touches from OGC-touches while using SpatialRelator?


bobo
Contributor
Forum|alt.badge.img+3
  • Contributor

Hi, I’ve got two polygon datasets A and B, and I’d like to identify which polygons from dataset B that touch polygons from dataset A, but only edge to edge contact count as touch. How can I get the ideal result or exclude vertex touches?

8 replies

crutledge
Influencer
Forum|alt.badge.img+33
  • Influencer
  • June 25, 2025

Hi ​@bobo 

I think you could use the chopper to generate verticies. Then buffer. Then use buffer to clip the original set of polygons. 
Then run the relate with edge. So you can use the verticies to Cut out the portion of the polygon that touches at one point (verticy). With that removed, the remainder will be edge.
Hope that helps.


takashi
Evangelist
  • June 25, 2025

Hi ​@bobo ,

Alternatively, if you set Yes to the Calculate Cardinality of Intersections parameter in SpatialRelator, the resulting features will have these list members which indicate the number of intersections by their shape - point, line, and area.

  • _relationships{}.card_point
  • _relstionships{}.card_line
  • _relationships{}.card_area

After exploding the list with ListExploder, you can then filter them by the condition 0 < card_line to select B (Supplier) features that share a boundary line with an A (Requestor) feature.


crutledge
Influencer
Forum|alt.badge.img+33
  • Influencer
  • June 26, 2025

Oh that is a much more elegant solution ​@takashi I did not know that is how Cardinality functioned. Filing this tip away for “Future Me” 😁


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • June 26, 2025

You can also use a spatial predicate in the Spatial Filter to differentiate between touch at a point and share an edge

 


crutledge
Influencer
Forum|alt.badge.img+33
  • Influencer
  • June 26, 2025

Always learning. I love it. Thanks ​@ebygomm . That is my deep dive on this one.

+

One question two things I learned. Thank you for sharing.


bobo
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 27, 2025
takashi wrote:

Hi ​@bobo ,

Alternatively, if you set Yes to the Calculate Cardinality of Intersections parameter in SpatialRelator, the resulting features will have these list members which indicate the number of intersections by their shape - point, line, and area.

  • _relationships{}.card_point
  • _relstionships{}.card_line
  • _relationships{}.card_area

After exploding the list with ListExploder, you can then filter them by the condition 0 < card_line to select B (Supplier) features that share a boundary line with an A (Requestor) feature.

It works! And is it possible to set tolerance on this paramerter, some polygons they do share a boundary line but card_line ouput 0 while card_point  outputting 1.


bobo
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 27, 2025
ebygomm wrote:

You can also use a spatial predicate in the Spatial Filter to differentiate between touch at a point and share an edge

 

I see, but can I set a tolerance on this one?


takashi
Evangelist
  • June 29, 2025

There is no option to set tolerance for determining spatial relations with SpatialRelator or SpatialFilter. If there could be tiny gaps or overlaps between adjacent polygons and you would like to ignore them when determining spatial relations, consider using an appropriate transformer - e.g.  Snapper (Snapping Type: Segment Snapping) or AreaGapAndOverlapCleaner beforehand to resolve the gaps and overlaps.


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