I am trying to find the stores within X radius of a users lat & long. I have read quite a few questions, answers, and articles on the topic. My results don't have to be pin point accurate but false positives as you might get with the filter on a Geography column would not be acceptable.
Given the above requirements I don't see the need to use the Geography data type and add a spatial index. I also don't need a perfect circle radius. In other words a bounding box would be acceptable. So I settled on this solution from Alastaira who has a very informative session on the topic here.
Now my application is MVC using CF EF4 and SQL 2008R2. I was originally thinking to do the operation in LINQ like I would any other db interaction but I was honestly stumped at a few steps such as:
DECLARE @point geography = geography::Point(40.7316, -73.9920, 4326);
I don't think EF4 supports the geography data type so that would certainly complicate things.
Then I started thinking...given that the db is kinda geared for this kind of crunching should I just wrap the TSQL in a SP that spits out a recordset I can then use LINQ on?
This is my first spatial db operation so any ideas or suggestions are welcome and would be appreciated.
If the sp is a viable solution suggestions for the best way to implement would be great.