diff options
| author | Rutger Broekhoff | 2026-09-08 01:36:38 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-09-08 01:37:34 +0200 |
| commit | 3e8ce840c70ee00925210b96738696d1dc445f8f (patch) | |
| tree | 4eb6b30b1d571daa596394c36e7769f6ee0af956 /server/src/geo.cpp | |
| parent | 15bcf23f2e75f9c710eee3753d530ebefc5f78f1 (diff) | |
| download | routemon-3e8ce840c70ee00925210b96738696d1dc445f8f.tar.gz routemon-3e8ce840c70ee00925210b96738696d1dc445f8f.zip | |
UTM projection
Diffstat (limited to 'server/src/geo.cpp')
| -rw-r--r-- | server/src/geo.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/server/src/geo.cpp b/server/src/geo.cpp deleted file mode 100644 index 1776f3c..0000000 --- a/server/src/geo.cpp +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | module; | ||
| 2 | |||
| 3 | #include <boost/geometry.hpp> | ||
| 4 | |||
| 5 | module routemon:geo$impl; | ||
| 6 | |||
| 7 | import :geo; | ||
| 8 | |||
| 9 | namespace routemon::geo { | ||
| 10 | |||
| 11 | auto split_linestring_with_overlap_segments( | ||
| 12 | linestring const& ls, double max_split_distance_m, | ||
| 13 | std::vector<linestring>& append_to) -> void | ||
| 14 | { | ||
| 15 | if (bgeo::is_empty(ls)) | ||
| 16 | return; | ||
| 17 | |||
| 18 | auto current_ls = linestring{}; | ||
| 19 | auto current_ls_length = 0.0; | ||
| 20 | auto previous = std::optional<point>{}; | ||
| 21 | bgeo::for_each_point( | ||
| 22 | ls, | ||
| 23 | [&](point p) -> void | ||
| 24 | { | ||
| 25 | bgeo::append(current_ls, p); | ||
| 26 | if (previous) | ||
| 27 | { | ||
| 28 | auto d = bgeo::distance(*previous, p, vincenty_strategy()); | ||
| 29 | current_ls_length += d; | ||
| 30 | if (current_ls_length > max_split_distance_m) | ||
| 31 | { | ||
| 32 | append_to.push_back(std::move(current_ls)); | ||
| 33 | current_ls = linestring{*previous, p}; | ||
| 34 | current_ls_length = d; | ||
| 35 | } | ||
| 36 | } | ||
| 37 | previous = p; | ||
| 38 | }); | ||
| 39 | append_to.emplace_back(std::move(current_ls)); | ||
| 40 | } | ||
| 41 | |||
| 42 | } // namespace routemon::geo | ||