mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-25 23:46:04 +08:00
add "Lambert II étendu" coordinates support
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user