如何从此 Delphi 函数编写等效的 PL/SQL 函数:
Function TConvert.MGRS(lat : Double; Lon : Double; a : Double;
InverseFlattening : Double; Coding:Integer; Digits : Integer) : String ;
var
UTMs1 : String;
E1 : Double;
N1 : Double;
Zn : Integer;
Lzn : String;
Sq : String;
begin
UTMs1 := UTM(lat, Lon, a, InverseFlattening) ;
E1 := UTMX(UTMs1);
N1 := UTMY(UTMs1);
Zn := UTMZone(lat, Lon);
Lzn := MGRSLatZone(lat);
Sq := SquareID(Zn, N1, E1, Coding);
Result := Format('%.2d', [Zn] ) + Lzn + Sq +
Copy(Format('%.5d',[Round(E1 - 100000 * Trunc(E1 / 100000))]), 1, Digits) +
Copy(Format('%.5d',[Round(N1 - 100000 * Trunc(N1 / 100000))]), 1, Digits);
end;
MGRS(0, 0, 6378.137, 298.2572236, 1, 5) = 31NAA6602100000