# Spatial intersect types

149
3
10-12-2017 04:24 PM
Regular Contributor

Hi all

I realise this isn't strictly an AppStudio question, maybe more a Runtime question in general....

When running a query with a spatial relationship, there doesn't appear to be a spatial relationship that returns features that not only intersect, but where the area of intersection is greater than zero.

SpatialRelationshipEnvelopeIntersects  is closest, but it also returns features that 'touch', i.e. they share a common boundary, although nothing actually overlaps.

Currently I have to find this by first running the query using the 'intersects' method, then stepping through the results one by one and checking if the intersection of each feature geometry with the query geometry is actually greater than zero.

So I can achieve it, but I can't help thinking there should be a query type that achieves it in one step.

Any ideas from anyone?

cheers,

-Paul

Tags (4)
1 Solution

Accepted Solutions
New Contributor III

Hi Paul,

Did you try (SpatialRelationshipEnvelopeIntersects AND  !Enums.SpatialRelationshipDisjoint)?

As per the help, Enums.SpatialRelationshipDisjoint supposed to tell if the intersection is empty or not.

Kaushik

3 Replies
New Contributor III

Hi Paul,

Did you try (SpatialRelationshipEnvelopeIntersects AND  !Enums.SpatialRelationshipDisjoint)?

As per the help, Enums.SpatialRelationshipDisjoint supposed to tell if the intersection is empty or not.

Kaushik

Regular Contributor

Thanks Kaushik. yes it looks like you're right.

fyi, 'disjoint' doesn't seem to be in old runtime, the equivalent seems to be:

`query.spatialRelationship = Enums.SpatialRelationshipEnvelopeIntersects & !Enums.SpatialRelationshipTouches`
Regular Contributor

No, take that back. 'touches' doesn't achieve the same as 'disjoint'.

So it appears that using Kaushik's approach is possible in the new Runtime v100.x, but not in the old Runtime.