FireSTARR
Loading...
Searching...
No Matches
projection.h
1/* SPDX-License-Identifier: AGPL-3.0-or-later */
2#ifndef FS_PROJECTION_H
3#define FS_PROJECTION_H
4#include "stdafx.h"
5#include "Location.h"
6#include "Point.h"
7namespace fs
8{
10using fs::MathSize;
11std::optional<FullCoordinates> to_proj4(
12 const string& proj4,
13 const fs::Point& point,
14 MathSize* x,
15 MathSize* y
16);
17class Point;
23[[nodiscard]] constexpr MathSize meridian_to_zone(const MathSize meridian) noexcept
24{
25 return (meridian + 183.0) / 6.0;
26}
32[[nodiscard]] constexpr MathSize utm_central_meridian(const MathSize zone) noexcept
33{
34 return -183.0 + zone * 6.0;
35}
36fs::XYPos from_lat_long(const string_view proj4, const fs::Point& point);
37fs::Point to_lat_long(const string_view proj4, const fs::XYPos xy);
38string try_fix_meridian(const string_view proj4);
39Degrees find_north_south_deviation(const string_view proj4, const Point& p0);
40bool check_deviation(
41 const string_view what,
42 const string_view proj4,
43 const Point& p,
44 const MathSize max_deviation
45);
46}
47#endif
A geographic location in lat/long coordinates.
Definition Point.h:11
FullCoordinates ((x, y), (sub-x, sub-y))
Definition stdafx.h:299
Definition Location.h:49