packo88 Posted March 28, 2009 Report Share Posted March 28, 2009 Hi, Is there any way to have the schedules in nautical miles. I know in the local.config I can have either miles or kilometres but all the flying I do is always in NM. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 28, 2009 Administrators Report Share Posted March 28, 2009 just enter "nm" in the field and it'll use it, I don't do any conversions just enter whatever the actual number is Quote Link to comment Share on other sites More sharing options...
packo88 Posted March 29, 2009 Author Report Share Posted March 29, 2009 Thanks, but when we are in the admin panel and adding or editing a route we have the option of automatically calculating the distance. The figure that is calculated is in miles. I would like it to be calculated in nautical miles. Is this possible and if so how would I do it? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 29, 2009 Administrators Report Share Posted March 29, 2009 If you set the local.config setting to "nm" it will do it Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 29, 2009 Administrators Report Share Posted March 29, 2009 Just checked the code, set the UNITS parameter to "nm" Quote Link to comment Share on other sites More sharing options...
packo88 Posted March 30, 2009 Author Report Share Posted March 30, 2009 I have set the UNIT to nm in the local.config.php. I added a route from YPPH to YSSY and got phpvms to automatically calculate the distance. The figure it came up with is 2045.47471719. When I check this figure in google earth it is the distance in miles. The distance in nautical miles would be 1771. I am using the current version 1.2.660 sorry to be a pain I love your work ;D Regards Packo Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 30, 2009 Administrators Report Share Posted March 30, 2009 I will check it out Quote Link to comment Share on other sites More sharing options...
packo88 Posted May 27, 2009 Author Report Share Posted May 27, 2009 Did you ever get a chance to look at this Nabeel? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 27, 2009 Administrators Report Share Posted May 27, 2009 No, sorry, just checked the code, here's the equation, it could be wrong: <?php $distance = (3958 * 3.1415926 * sqrt(($lat2-$lat1) * ($lat2-$lat1) + cos($lat2/57.29578) * cos($lat1/57.29578) * ($lon2-$lon1) * ($lon2-$lon1))/180); # Distance is in miles # Do proper conversions if needed # Return in nm by default if(strtolower(Config::Get('UNITS')) == 'mi') { # Leave it in miles return $distance; } elseif(strtolower(Config::Get('UNITS')) == 'km') { # Convert to km return $distance * 1.609344; } else { # Convert to nm return $distance * .868976242; # Convert to nautical miles } return round($distance, 2); Quote Link to comment Share on other sites More sharing options...
danmand Posted December 24, 2009 Report Share Posted December 24, 2009 Hi Nabeel. I'm having the same issue. I have NM set up in the local config file but the distance in the schedule is incorrect. Does the code you provided above have to be input in any particular file? Sorry I don't know anything about PHP but I am learning Dan Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 24, 2009 Administrators Report Share Posted December 24, 2009 Hey Dan, Which phpVMS version are you using? Quote Link to comment Share on other sites More sharing options...
danmand Posted December 24, 2009 Report Share Posted December 24, 2009 Sorry. I forgot to mention that version 1.2.700 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 24, 2009 Administrators Report Share Posted December 24, 2009 This was fixed for the latest version, so hang tight, it's going to drop soon Quote Link to comment Share on other sites More sharing options...
danmand Posted December 24, 2009 Report Share Posted December 24, 2009 Currently in the "hanging tight" position ;D Thanks for your hard work and dedication. Dan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.