I have got a task where in I have to Draw 2 lines on Google Map (4 Points) and on Submit event I need to display the Vehicle passing through that points. I am able to draw 2 lines on google map which gives me 4 points in Lat/Longitude format.
Now the main questions is how can I query the database to get the Vehicle passing through two lines. I know I might have to use LineString function in T-SQL but how do i get all the vehicle passing through that lines? Any suggestions is welcome.
Given that I’m not sure how you are representing your “car” or your “lines” and must make assumptions, this code sample might be able to get the ball rolling for you.
It will return a dataset indicating which cars have passed through which lines.
Spatial queries are not my forte; perhaps someone else could offer an optimisation.