I have geographic data that was loaded into the geography datatype. For very specific purposes, I now need to have store this as a geometry. However, I need to perform a query like this.
DECLARE @radius INT -- e.g. 3000 metres
DECLARE @geo geometry -- my starting shape
SET @geo = @geo.STBuffer(@radius) -- this obviously doesnt work..
SELECT Geo FROM GeometryTable
WHERE Geo.STWithin (@geo) = 1
This trick might work, if someone can validate this technique or provide a better alternative then they’ll get the accepted answer.
Basically, I am thinking I can use the STBuffer of a geography which will apply the correct radius in metres around my geographical shape and then I convert back to a geometry. As the shapes were loaded originally as geography all the points are the same. This shape-flip should give me a resulting geometry with a pretty accurate buffer around it.