質問

I'm trying to get features back that are outside the intersection of themselves and a polygon defined in a query.

When I run the query with the intersection set to true (ie. =1) the results are normal and expected.

However, when I use the not equal to flag (!= or <>), I get very unexpected numbers - many records per student, and even when using the distinct flag, it seems the STIntersects function isn't respected.

select 
 Students.shape
from Students
join
Boundaries
on (Points.shape.STIntersects(Boundaries.shape) !=1)
where  Boundaries.BNum = '408'

Can the STIntersects function handle this type of request?

Thanks!!!

役に立ちましたか?

解決

Further to this, the STDisjoint function will return multiple records as it will test the intersection (or lack thereof) for points against multiple polygons.

So the real answer was to use the STIntersects function as a sub-selection, and basically grab all the features that are NOT IN that sub selection.

A post describing this can be found here.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top