Interesction of haversine formula and latitude/longitude in PHP
€30-250 EUR
Paid on delivery
To over simplify (good for this project), we need to find how much time it takes for a plane to fly from point A to point B, taking into account the different wind speeds in the path. We can do most of it, but we struggle with one specific part of it, which is explained under 'TASK Description'.
Data available:
*Starting coordinates of the plane
*End coordinates of the plane
*Wind speeds are given by coordinates with 0.25 decimal degree accuracy - this is a bit more explained right below.
Wind speeds for certain locations are given with accuracy of 0.25 decimal degrees. Valid examples are (numbers are in decimal degrees. first is latitude, second is longitude, third is speed):
'59.50, 16.50, 15m/s'
'59.75, 16.50, 13m/s'
'59.75, 16.75, 17m/s'
'60.00, 17.00, 12m/s'
And so on.
Imagine the wind speeds to be in the form of 'box. Taking from the examples above, first 'box' would be calculated in the following way (assuming we are on the north-east side):
$boxDelta = 0.25/2
$leftTopPoint = array('lat' => 59.50 - $boxDelta, 'lng' => 16.50 + $boxDelta)
$rightTopPoint = array('lat' => 59.50 + $boxDelta, 'lng' => 16.50 + $boxDelta)
$leftBottomPoint = array('lat' => 59.50 - $boxDelta, 'lng' => 16.50 - $boxDelta)
$rightBottomPoint = array('lat' => 59.50 + $boxDelta, 'lng' => 16.50 - $boxDelta)
Top line of the 'box' would be a line between $leftTopPoint and $rightTopPoint, right side between $rightTopPoint and $rightBottomPoint etc...
So each box contains a certain wind speed, for the 'box' example above it would be 15m/s for the whole box.
TASK Description:
Sample assignment the function should be able to solve:
Now we have the box. Lets start from coordinate latitude 59.47, longitude 16.1 and move to latitude 59.58, longitude 17.00. At which coordinates does our flight path intersect with the example 'box' from above?
We need two sets of coordinates, one going in the box and the other going out the box (to simplify for the purpose of this task we will not take into account the box we started from). After that we can get a new box and and do this process again and again and again until we reach destination.
Overly simplified function should look something like this:
function boxInteresectCoordinates($startLat, $startLong, $endLat, $endLong, $leftTopPoint, $rightTopPoint, $leftBottomPoint, $rightBottomPoint, $altitude) {
// Do magic
return array($inBoxLat, $inBoxLong, $outBoxLat, $outBoxLong, $distanceTraveledInsideBoxInKM);
}
As a visual guide, I added an image (heavily out of proportion), where red line represents the flight path, grid represents the longitude/latitude and blue X represent the coordinates we need to find. - Use it only to get a rough overview of the assignment, the image is quite inaccurate in many ways.
Side notes:
*If one can a recommend solution which is better/faster/more accurate - it would be well welcomed.
*Usages of all libraries is allowed, but in the end the code that we will use has to be in PHP.
I think I have explained the task well. In case of questions, please feel free to ask!
Project ID: #15110798
About the project
19 freelancers are bidding on average €153 for this job
Hi. I have a great skill in php. I can complete your project. My price and period is negotiable. We can discuss details via chat. Thanks. Relevant Skills and Experience I have much experience in php. Proposed Milesto More
Hey Friend, Myself having has 10 + years experience of web site development. Expert in Custom programming in php / Mysql / Jquery / Wordpress/ Joomla /OSC/ Magento /OpenCart / Android / Mobile development / iPhon More
We read your requirement about formula and latitude/longitude and we want you to know that we have a good past experience in PHP,wordprss,laravel ,angular.js, javascript, Bootstrap html and css Relevant Skills and Ex More
I've read your requirements in detail and I can able to do the project development with your full satisfaction + projected Delieverables Relevant Skills and Experience PHP+ Web Design Mobile App Development MySQLi More
Hello, Client! Thanks for the opportunity to bid on your project. I'm a master in GIS fields. Please have confidence in my skill and quality of work. Thank you!
To achieve goal with 100% quality we have team of 15 Professional Software Engg/Developer. Relevant Skills and Experience Our mission to stand out doesn’t stop with our internal goals. Proposed Milestones €222 EUR - More
Hi. I have read your description carefully. I can satisfy your requirement at the highest level, in a short time I attach importance to credit rather than money. I think i can cooperate with you well. Relevant Skills More