Reputation: 145
I want to to perform a STInteract
using two tables and finding the intersections of the lines onto a given polygon. I have converted all the tables to have geometries for all. I am having a problem writing the query for this.
These are my two table
This is my script:
--visually checking if they intersect
SELECT GEOM FROM [dbo].[HWY_Database] where STFIPS = '04'
UNION ALL
SELECT NEATCELL FROM [dbo].[POLY_Database]
So I dont know how to write this so this what I Initially wrote:
--intersect Neatcell and GEOM
SELECT GEOM FROM [dbo].[HWY_Database] where STFIPS = '04'
Where GEOM.STIntersects(NEATCELL FROM [dbo].[POLY_Database])
Upvotes: 0
Views: 7948
Reputation: 32707
SELECT GEOM
FROM [dbo].[HWY_Database] as hwy
join [dbo].[POLY_Database] as p
on hwy.GEOM.STIntersects(p.NEATCELL) = 1
where STFIPS = '04'
Upvotes: 1