Skip to main content
Solved

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

  • Jun 25, 2025 3:23 PM UTC
  • 8 replies
  • 268 views

bobo
Contributor
Forum|alt.badge.img+3

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?

Best answer by takashi

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.

View original
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

crutledge
Influencer
Forum|alt.badge.img+55
  • Influencer
  • Jun 25, 2025 4:10 PM UTC

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
Celebrity
  • Best Answer
  • Jun 25, 2025 9:45 PM UTC

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+55
  • Influencer
  • Jun 26, 2025 3:28 AM UTC

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
Evangelist
Forum|alt.badge.img+54
  • Evangelist
  • Jun 26, 2025 7:56 AM UTC

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+55
  • Influencer
  • Jun 26, 2025 11:04 AM UTC

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
  • Jun 27, 2025 2:41 PM UTC

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
  • Jun 27, 2025 4:02 PM UTC

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
Celebrity
  • Jun 29, 2025 6:19 AM UTC

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.