Shortest route between multiple points

前端 未结 4 689
悲哀的现实
悲哀的现实 2021-01-29 11:46

I need to find the shortest route between multipe points. Let\'s say that I have these four points:

var startPoint = new Point(1, 1);
var pointsToGoPast = new Li         


        
4条回答
  •  感动是毒
    2021-01-29 12:35

    Can be solved simply if you have SQL server

    select geography :: Point(@PointALatitude, @PointALongitude, 4326).STDistance(geography::Point(@PointBLatitude, @PointBLongitude, 4326))
    

    Result is returned in meters so just divide by 1000 for Km or 1609.344 for Miles

提交回复
热议问题