add "Lambert II étendu" coordinates support

This commit is contained in:
Pascal Brisset
2010-03-18 07:42:37 +00:00
parent 1caae29b46
commit 02804d6fad
3 changed files with 8 additions and 0 deletions
+6
View File
@@ -503,6 +503,7 @@ let unix_time_of_tow = fun ?week tow ->
type coordinates_kind =
WGS84_dec
| WGS84_dms
| LBT2e
| Bearing of < pos : geographic>
@@ -512,6 +513,9 @@ let string_of_coordinates = fun kind geo ->
string_degrees_of_geographic geo
| WGS84_dms ->
string_dms_of_geographic geo
| LBT2e ->
let l = lambertIIe_of geo in
Printf.sprintf "%d %d" l.lbt_x l.lbt_y
| Bearing georef ->
let (dx, dy) = utm_sub (utm_of WGS84 geo) (utm_of WGS84 georef#pos) in
let d = sqrt (dx*.dx+.dy*.dy) in
@@ -524,6 +528,8 @@ let geographic_of_coordinates = fun kind s ->
of_string ("WGS84 " ^ s)
| WGS84_dms ->
of_string ("WGS84_dms " ^ s)
| LBT2e ->
of_string ("LBT2e " ^ s)
| Bearing georef ->
of_string (Printf.sprintf "WGS84_bearing %s %s" (string_degrees_of_geographic georef#pos) s)
+1
View File
@@ -155,6 +155,7 @@ val unix_time_of_tow : ?week:int -> int -> float
type coordinates_kind =
WGS84_dec
| WGS84_dms
| LBT2e
| Bearing of < pos : geographic >
val string_of_coordinates : coordinates_kind -> geographic -> string
+1
View File
@@ -672,6 +672,7 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
let set = fun x () -> selected_georef <- x in
my_menu_item "WGS84" ~packing:georef_menu#append ~callback:(set WGS84_dec) ();
my_menu_item "WGS84_dms" ~packing:georef_menu#append ~callback:(set WGS84_dms) ();
my_menu_item "LambertIIe" ~packing:georef_menu#append ~callback:(set LBT2e) ();
optmenu#set_menu georef_menu
)