1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
//! # wbprojection
//!
//! A map projection library for Rust, inspired by the PROJ library.
//!
//! ## Overview
//!
//! `wbprojection` provides forward and inverse transformations between geographic
//! coordinates (longitude/latitude) and projected coordinates (easting/northing)
//! for a wide range of map projections and datums.
//!
//! ## Quick Start
//!
//! ```rust
//! use wbprojection::{Projection, ProjectionParams, Ellipsoid};
//!
//! // Create a UTM Zone 32N projection
//! let params = ProjectionParams::utm(32, false);
//! let proj = Projection::new(params).unwrap();
//!
//! // Forward: lon/lat (degrees) → easting/northing (meters)
//! let (easting, northing) = proj.forward(9.0, 48.0).unwrap();
//! println!("Easting: {:.2}, Northing: {:.2}", easting, northing);
//!
//! // Inverse: easting/northing → lon/lat
//! let (lon, lat) = proj.inverse(easting, northing).unwrap();
//! println!("Lon: {:.6}, Lat: {:.6}", lon, lat);
//! ```
//!
//! ## Supported Projections
//!
//! - **Mercator** – Standard and Web Mercator (EPSG:3857)
//! - **Transverse Mercator** – Foundation for UTM
//! - **UTM** – Universal Transverse Mercator (all zones)
//! - **Lambert Conformal Conic** – One and two standard parallels
//! - **Albers Equal-Area Conic** – Equal-area conic
//! - **Azimuthal Equidistant** – Distances true from center point
//! - **Lambert Azimuthal Equal-Area** – Equal-area azimuthal
//! - **Krovak** – Oblique conformal conic (Czech/Slovak systems)
//! - **Central Conic** – Conic projection with one standard parallel
//! - **Lagrange** – Conformal spherical projection
//! - **Loximuthal** – Rhumb-line based pseudocylindrical projection
//! - **Euler** – Conic projection with two standard parallels
//! - **Tissot** – Conic projection with two standard parallels
//! - **Murdoch I** – Conic projection with two standard parallels
//! - **Murdoch II** – Conic projection with two standard parallels
//! - **Murdoch III** – Conic projection with two standard parallels
//! - **Perspective Conic** – Conic projection with two standard parallels
//! - **Vitkovsky I** – Conic projection with two standard parallels
//! - **Tobler-Mercator** – Equal-area cylindrical projection
//! - **Winkel II** – Compromise pseudocylindrical world projection
//! - **Kavrayskiy V** – Pseudocylindrical world projection
//! - **Stereographic** – Polar and oblique variants
//! - **Orthographic** – Globe-view projection
//! - **Sinusoidal** – Equal-area pseudocylindrical
//! - **Mollweide** – Equal-area pseudocylindrical
//! - **McBryde-Thomas Flat-Pole Sine (No. 2)** – Pseudocylindrical projection
//! - **McBryde-Thomas Flat-Polar Sine (No. 1)** – Pseudocylindrical projection
//! - **McBryde-Thomas Flat-Polar Parabolic** – Pseudocylindrical projection
//! - **McBryde-Thomas Flat-Polar Quartic** – Pseudocylindrical projection
//! - **Nell** – Pseudocylindrical projection
//! - **Equal Earth** – Equal-area compromise world projection
//! - **Cylindrical Equal-Area** – Equal-area cylindrical
//! - **Equirectangular** (Plate Carrée) – Simple cylindrical
//! - **Robinson** – Compromise pseudocylindrical
//! - **Gnomonic** – Great circles map to straight lines
//! - **Aitoff** – Compromise world projection
//! - **Van der Grinten** – Circular world projection
//! - **Winkel Tripel** – National Geographic world projection
//! - **Hammer** – Equal-area world projection
//! - **Hatano** – Asymmetrical equal-area pseudocylindrical projection
//! - **Eckert I** – Pseudocylindrical world projection
//! - **Eckert II** – Pseudocylindrical world projection
//! - **Eckert III** – Pseudocylindrical world projection
//! - **Eckert IV** – Equal-area pseudocylindrical world projection
//! - **Eckert V** – Pseudocylindrical world projection
//! - **Miller Cylindrical** – Modified Mercator world projection
//! - **Gall Stereographic** – Cylindrical stereographic world projection
//! - **Gall-Peters** – Equal-area cylindrical world projection
//! - **Behrmann** – Equal-area cylindrical projection (30° standard parallel)
//! - **Hobo-Dyer** – Equal-area cylindrical projection (37.5° standard parallel)
//! - **Wagner I** – Pseudocylindrical world projection
//! - **Wagner II** – Pseudocylindrical world projection
//! - **Wagner III** – Pseudocylindrical world projection
//! - **Wagner IV** – Equal-area pseudocylindrical world projection
//! - **Wagner V** – Equal-area pseudocylindrical world projection
//! - **Natural Earth** – Compromise pseudocylindrical world projection
//! - **Natural Earth II** – Compromise pseudocylindrical world projection
//! - **Wagner VI** – Compromise pseudocylindrical world projection
//! - **Eckert VI** – Equal-area pseudocylindrical world projection
//! - **Transverse Cylindrical Equal Area** – Spherical equal-area cylindrical projection
//! - **Polyconic** – American polyconic projection
//! - **Bonne** – Equal-area pseudoconical projection
//! - **Craster** – Craster Parabolic (Putnins P4) projection
//! - **Putnins P4'** – Pseudocylindrical compromise projection
//! - **Fahey** – Pseudocylindrical projection
//! - **Times** – Cylindrical compromise projection
//! - **Patterson** – Cylindrical compromise projection
//! - **Putnins P3** – Pseudocylindrical compromise projection
//! - **Putnins P3'** – Modified pseudocylindrical compromise projection
//! - **Putnins P5** – Pseudocylindrical compromise projection
//! - **Putnins P5'** – Modified pseudocylindrical compromise projection
//! - **Putnins P1** – Pseudocylindrical projection
//! - **Putnins P2** – Pseudocylindrical projection
//! - **Putnins P6** – Pseudocylindrical projection
//! - **Putnins P6'** – Pseudocylindrical projection
//! - **Quartic Authalic** – Equal-area pseudocylindrical projection
//! - **Foucaut** – Pseudocylindrical projection
//! - **Winkel I** – Compromise pseudocylindrical world projection
//! - **Werenskiold I** – Pseudocylindrical projection
//! - **Collignon** – Equal-area pseudocylindrical projection
//! - **Nell-Hammer** – Pseudocylindrical projection
//! - **Kavrayskiy VII** – Pseudocylindrical world projection
//!
//! ## Coordinate Reference Systems
//!
//! Use the [`Crs`] type to perform datum transformations between common
//! coordinate reference systems including WGS84, NAD83, NAD27, and ETRS89.
//! Grid-shift workflows are also supported via [`datum::DatumTransform::GridShift`]
//! with loaders in [`grid_formats`] and runtime registration in [`grid_shift`].
//!
//! ## 3D CRS workflows
//!
//! `wbprojection` now supports geocentric (ECEF XYZ) and minimal vertical CRS workflows.
//!
//! - Use [`Crs::transform_to_3d`] for strict 3D transforms.
//! - Geographic/Projected <-> Geocentric is supported.
//! - Vertical <-> Vertical is supported as passthrough.
//! - Mixed Vertical <-> Geographic/Projected is rejected in strict mode.
//! - Use [`Crs::transform_to_3d_preserve_horizontal`] for explicit mixed-mode
//! Vertical <-> Geographic/Projected workflows where horizontal context should be
//! preserved unchanged.
//! - Use [`Crs::transform_to_3d_preserve_horizontal_with_vertical_offsets`] (or its
//! policy-aware variant) when vertical offsets are available from external models.
//! - Use [`Crs::transform_to_3d_preserve_horizontal_with_provider`] when offsets
//! should be resolved dynamically from coordinate/CRS context.
//! - Use [`ConstantVerticalOffsetProvider`] for simple fixed-offset workflows.
//! - Use [`GridVerticalOffsetProvider`] with registered [`VerticalOffsetGrid`]
//! models for native bilinear-sampled vertical offsets.
//!
//! ```rust
//! use wbprojection::Crs;
//!
//! // Geographic <-> Geocentric
//! let geog = Crs::from_epsg(7843).unwrap();
//! let geoc = Crs::from_epsg(7842).unwrap();
//! let (x, y, z) = geog.transform_to_3d(147.0, -35.0, 120.0, &geoc).unwrap();
//! let (_lon, _lat, _h) = geoc.transform_to_3d(x, y, z, &geog).unwrap();
//!
//! // Explicit mixed vertical workflow (preserve horizontal context)
//! let vertical = Crs::from_epsg(7841).unwrap();
//! let utm = Crs::from_epsg(7846).unwrap();
//! let (_x2, _y2, _z2) = utm
//! .transform_to_3d_preserve_horizontal(500_000.0, 6_120_000.0, 42.0, &vertical)
//! .unwrap();
//! ```
pub use CompoundCrs;
pub use ;
pub use Datum;
pub use Ellipsoid;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Convert degrees to radians.
/// Convert radians to degrees.
/// Normalize a longitude value to the range [-180, 180).