4

I am developing a car pooling website. For that, I have created the database which has the different route options selected by different user. These routes are saved in the Database as Geography datatype. For data access, I used Entity Framework. In the C# code, I used DBGeography datatype for process the routes.

I have a requirement that, the user can select one route, and identify the users who selected the same/nearby route which is saved in the database. How do I achieve this?

jparthj
  • 1,606
  • 3
  • 20
  • 44
petchirajan
  • 4,152
  • 1
  • 18
  • 20
  • How do you define nearby routes ? How are the routes encoded (i.e. start and finsih point or as a set of coordinates ?) In fac I amnot totally sure where your question is, do you have trouble finding what routes are similar ? – Legisey Feb 27 '14 at 12:41
  • I'd ask the folks at [Geographic Information Systems SE](http://gis.stackexchange.com/). – klugerama Feb 28 '14 at 00:57

1 Answers1

2

You can use the STDistance function in SQL to determine the distance between the Geography's or DbGeography.Distance if you are working in EF (example here).

Robert Levy
  • 28,747
  • 6
  • 62
  • 94