Module:Coordinates: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 22:
--- Test if the arguments imply that DMS might be in use
local dmsTest = function(first, second)
local concatenated = first:upper() .. second:upper();
if concatenated == "NE" or concatenated == "NW" or concatenated == "SE" or concatenated == "SW" thenor
concatenated == "EN" or concatenated == "WN" or concatenated == "ES" or concatenated == "WS" then
return true;
end
Line 75 ⟶ 76:
local coordinateSpec = {}
local errors = {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Specified backward
if lat_f == 'E' or lat_f == 'W' then
local t_d, t_m, t_s;
t_d = lat_d;
t_m = lat_m;
t_s = lat_s;
lat_d = long_d;
lat_m = long_m;
lat_s = long_s;
long_d = t_d;
long_m = t_m;
long_s = t_s;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
Anonymous user