0

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

  1. HWY_Database = contains the lines
  2. POLY_Database = Polygon of interest

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])

1 Answer 1

1
SELECT GEOM 
FROM [dbo].[HWY_Database] as hwy
join [dbo].[POLY_Database] as p
    on hwy.GEOM.STIntersects(p.NEATCELL) = 1
where STFIPS = '04'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.