I'm trying to write a query in SQL Server using 1 set of points and 2 sets of polygons. The polygons overlap, and I only want to select the points that fall inside of 1 polygon but not the other.
I want to duplicate this behavior in ArcGIS for Desktop.
In ArcGIS:
1) New Selection by Location Points that Intersect Polygon layer 1
2) Remove from the Current Selection by Location Points that Intersect Polygon layer 2
Attempt in SQL Server:
SELECT DISTINCT --MY FIELDS--FROMPoints, Polygons1, Polygons2WHEREPolygons1.Shape.STIntersects(Points.Shape) = 1AND Polygons2.Shape.STDisjoint(Points.Shape) = 1Am I missing something? I think the logic is sound in the SQL query, but it's not working.
Any help would be appreciated, thanks!
أكثر...
I want to duplicate this behavior in ArcGIS for Desktop.
In ArcGIS:
1) New Selection by Location Points that Intersect Polygon layer 1
2) Remove from the Current Selection by Location Points that Intersect Polygon layer 2
Attempt in SQL Server:
SELECT DISTINCT --MY FIELDS--FROMPoints, Polygons1, Polygons2WHEREPolygons1.Shape.STIntersects(Points.Shape) = 1AND Polygons2.Shape.STDisjoint(Points.Shape) = 1Am I missing something? I think the logic is sound in the SQL query, but it's not working.
Any help would be appreciated, thanks!
أكثر...