I am trying to select all the parks within 200m or a railway. I can easily create and visualise the 200m buffer. However when i try and find only the parks that intersect it i get all parks returned, not just those in the intersection area. This is the code i have so far:
SELECT P.[geogtab] as parks, P.[id] as park_id FROM [dbo].[railway] S inner JOIN [dbo].[parks] P ON S.geogtab.STBuffer(200).STIntersects(P.geogtab) = 1
geogtab is my geography column and it is indexed. Is there an error in my syntax that causes all items from Table P (the parks) ?