March 21, 201214 yr hello, I am hoping for some help with an issue i am having, i am working on a website that requires the distance between two points, i have created a PHP function that does this but mine works it out as a straight line the problem is i need it to 'go around' land to represent the distance a ship would travel to get from point A to point B any help would be appreciated
March 22, 201214 yr Author Thank you for your reply, is there a way of doing this automatically? or is it something users will need to trace out manually
March 22, 201214 yr That I couldn't tell you, I'm afraid - I don't know enough about maritime navigation to define the parameters of the problem.
March 22, 201214 yr Thank you for your reply, is there a way of doing this automatically? or is it something users will need to trace out manually There's hundreds of scripts that work out straight line distance, but I've never seen anything that works out the distance taking land into the equation. The calculations needed would be staggering and the entire worlds landscape would need to be factored in for every possible journey. Not an easy task. The only conclusion would be as you said - 'users will need to trace out manually'. If somebody does figure this out for you in this thread I would be very impressed.
March 22, 201214 yr If you use GPS coordinates, then as everybody says, you get a straight line. If it was for places on land you might somehow use place names (nearest towns) and then use a sat nav website which uses road miles. For shipping, could you set up four points in the sea north, south, east and west of the UK and then use straight line calcs between them for a start? Set up calcs for 1 to 2, 2 to 3, 3 to 4, 4 to 1 and save, then use code to work out the nearest marker to the start GPS, then the final GPS from the nearest marker, then add all the distances. I won't try to do it.
Create an account or sign in to comment