CREATE OR REPLACE FUNCTION fn_google2baidu(
lon in number,
lat in number
) RETURN point is
lp point;
x_pi number := trunc(3.14159265358979324 * 3000.0 / 180.0,14);
theta number;
x number;
y number;
z number;
bd_lon number;
bd_lat number;
begin
x := lon; y := lat;
z := sqrt(x * x + y * y) + 0.00002 * sin(y * x_pi);
theta := atan2(y,x) + 0.000003 * cos(x * x_pi);
bd_lon := z * cos(theta) + 0.0065;
bd_lat := z * sin(theta) + 0.006;
lp := point(to_char(bd_lon, '999.999999999'),to_char(bd_lat, '999.999999999'));
/*point.lon := bd_lon;
point.lat := bd_lat;*/
return lp;
end;