My agentic slop goes here. Not intended for anyone else!
1(** Bounding box module *)
2
3type t
4
5(** {2 Construction} *)
6
7val create : min_lat:float -> min_lon:float -> max_lat:float -> max_lon:float -> t
8
9val of_coords : Coord.t -> Coord.t -> t
10(** From SW and NE corners *)
11
12val of_list : Coord.t list -> t
13(** Compute bbox containing all points *)
14
15(** {2 Accessors} *)
16
17val min_lat : t -> float
18val min_lon : t -> float
19val max_lat : t -> float
20val max_lon : t -> float
21
22val sw_corner : t -> Coord.t
23val se_corner : t -> Coord.t
24val ne_corner : t -> Coord.t
25val nw_corner : t -> Coord.t
26val center : t -> Coord.t
27
28val width : t -> float
29(** Width in degrees *)
30
31val height : t -> float
32(** Height in degrees *)
33
34(** {2 Operations} *)
35
36val contains : t -> Coord.t -> bool
37val intersects : t -> t -> bool
38val union : t -> t -> t
39val intersection : t -> t -> t option
40
41val expand : t -> float -> t
42(** Expand by degrees on all sides *)
43
44val expand_km : t -> float -> t
45(** Expand by approximate km on all sides *)
46
47(** {2 Formatting} *)
48
49val to_string : t -> string
50(** Format as "min_lon,min_lat,max_lon,max_lat" *)
51
52val of_string : string -> t
53(** Parse from "min_lon,min_lat,max_lon,max_lat" *)