December 16, 2015 at 8:17 am
Hi All,
What would be the best way to calculate all the coordination points between if i have source(longitude and latitude) values and destination(longitude and latitude) using a tsql
Thanks
December 16, 2015 at 9:29 am
There are spatial functions in SQL Server. These might help
http://www.sqlservercentral.com/articles/64601/
December 16, 2015 at 10:47 pm
@steve-2, thanks for those links, that was helpful to be only distance between source and destination. I am looking for all the possible X and Y coordinates between the source and destination. Like if I start for source what will be next point (lati and longi) in next 1 min(any time interval) or so till I reach destination.
All I have now is source and destination lati and longitude values.
Thanks.
December 17, 2015 at 12:35 am
you need to have your routine well defined in a table 1st. after that you need to lookup from that table between your source and destination to identify what would be your next point.
Feels like you are planning to show the complete route of a journey if i am not mistaken.
December 17, 2015 at 1:24 am
Yes its a complete route but need a SP or function or logic to update a table which has current lat and log details
in a time interval at run time and it should not be predefined.
So need to know what all values (like diatnce, Angular radius) I may need and formula to populate those values
to find all the midpoints between source and destination.
December 17, 2015 at 2:39 am
This is really not an SQL problem. You need some geodesic mathematics for it which SQL Spatial doesn't provide out of the box. Generally it depends on what model of the Earth is suitable. Quick search gives for example this directive with lot of formulas http://www.faa.gov/regulations_policies/orders_notices/index.cfm/go/document.information/documentID/1020347
Or may be this simple solution which considers Earth being just an ellipse
http://stackoverflow.com/questions/2094268/moving-a-point-along-a-path-in-sql-server-2008
December 17, 2015 at 7:30 am
@serg, thanks for those link which help me to get bearing formula, while when I used those function am not getting the angular movement of flight while it gives only straight line.
Mean while do we have any online tool or link where I can get some 20 or 30 mid location(lat n lon values) between my source and destination track position for testing for below points
source : 12.9823367, 80.1626049 (lat, lon)
Destination : 25.252778, 55.364444
I need some 20 track position for above points.
December 18, 2015 at 1:15 am
Check this link
December 18, 2015 at 10:56 am
This looks like more of a math problem. You need to be able to define the function that represents the curve of travel. I am sure once you have that figured you can create a table valued function that returns the intermediate coordinates. However, how does this curvature change depending on weather and other factors. I am afraid I dont know enough to provide you more , only that you need to gather more information about requirements and try to solve this mathematically first.
----------------------------------------------------
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply