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.
just enter “nm” in the field and it’ll use it, I don’t do any conversions just enter whatever the actual number is
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?
If you set the local.config setting to “nm” it will do it
Just checked the code, set the UNITS parameter to “nm”
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
I will check it out
Did you ever get a chance to look at this Nabeel?
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);
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
Hey Dan,
Which phpVMS version are you using?
Sorry. I forgot to mention that
version 1.2.700
This was fixed for the latest version, so hang tight, it’s going to drop soon
Currently in the “hanging tight” position ;D
Thanks for your hard work and dedication.
Dan