Nochmal ein Beispiel:
opengeo06h=# select 4*atan(1);
?column?
------------------
3.14159265358979
(1 row)
opengeo06h=# select lat, lon,
acos(sin(0.890424510983948)*
sin(lat*3.14159265/180)+
cos(0.890424510983948)*
cos(lat*3.14159265/180)*
cos(0.240848209390024 - lon*3.14159265/180)) * 6380
from geodb_coordinates co, geodb_textdata td
where td.loc_id=co.loc_id and
td.text_val='01237';
ERROR: input is out of range
opengeo06h=# select lat, lon,
acos(sin(0.890424510983948)*
sin(lat*4*atan(1)/180)+
cos(0.890424510983948)*
cos(lat*4*atan(1)/180)*
cos(0.240848209390024 - lon*4*atan(1)/180)) * 6380
from geodb_coordinates co, geodb_textdata td
where td.loc_id=co.loc_id and
td.text_val='01237';
lat | lon | ?column?
------------------+------------------+------------------
51.05 | 13.75 | 5.00996790547384
51.0175665126765 | 13.7995859170998 | 0
(2 rows)
opengeo06h=#
Du siehst den Punkt? Ich habe nur die Näherung für PI durch den
definierten Wert ersetzt, und schon geht es.
Thomas
|