diff options
| author | Rutger Broekhoff | 2026-09-08 10:44:58 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-09-08 10:44:58 +0200 |
| commit | 3fcfe8e5b2c76efeea1e838fb6b7e235804ecd8f (patch) | |
| tree | aec6e06cdd143ffc788b8538058a04d433b2f15c /server | |
| parent | 3e8ce840c70ee00925210b96738696d1dc445f8f (diff) | |
| download | routemon-3fcfe8e5b2c76efeea1e838fb6b7e235804ecd8f.tar.gz routemon-3fcfe8e5b2c76efeea1e838fb6b7e235804ecd8f.zip | |
Some optimization
Diffstat (limited to 'server')
| -rw-r--r-- | server/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | server/src/geo/multizonal.cppm | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 7522dbe..53cda76 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt | |||
| @@ -34,8 +34,6 @@ target_sources(routemon_lib | |||
| 34 | src/config.cpp | 34 | src/config.cpp |
| 35 | src/datex2.cppm | 35 | src/datex2.cppm |
| 36 | src/datex2.cpp | 36 | src/datex2.cpp |
| 37 | src/geo.cppm | ||
| 38 | src/geo.cpp | ||
| 39 | src/gpx.cppm | 37 | src/gpx.cppm |
| 40 | src/gpx.cpp | 38 | src/gpx.cpp |
| 41 | src/http_client.cppm | 39 | src/http_client.cppm |
| @@ -65,6 +63,11 @@ target_sources(routemon_lib | |||
| 65 | src/util.cpp | 63 | src/util.cpp |
| 66 | src/xml.cppm | 64 | src/xml.cppm |
| 67 | src/xml.cpp | 65 | src/xml.cpp |
| 66 | src/geo/geo.cppm | ||
| 67 | src/geo/multizonal.cppm | ||
| 68 | src/geo/utm.cppm | ||
| 69 | src/geo/utm_zone_local.cppm | ||
| 70 | src/geo/wgs84.cppm | ||
| 68 | ) | 71 | ) |
| 69 | 72 | ||
| 70 | add_executable(routemon src/main.cpp) | 73 | add_executable(routemon src/main.cpp) |
diff --git a/server/src/geo/multizonal.cppm b/server/src/geo/multizonal.cppm index f732994..ed78a24 100644 --- a/server/src/geo/multizonal.cppm +++ b/server/src/geo/multizonal.cppm | |||
| @@ -204,7 +204,7 @@ public: | |||
| 204 | { | 204 | { |
| 205 | for (auto ls : zone_segments[z]) | 205 | for (auto ls : zone_segments[z]) |
| 206 | { | 206 | { |
| 207 | utm::zone_local::prim::box blse = | 207 | auto blse = |
| 208 | bgeo::return_buffer<utm::zone_local::prim::box>(bgeo::return_envelope<utm::zone_local::prim::box>(ls), 30.0 /* m */); | 208 | bgeo::return_buffer<utm::zone_local::prim::box>(bgeo::return_envelope<utm::zone_local::prim::box>(ls), 30.0 /* m */); |
| 209 | local_rtrees_[z].insert(index_value{blse, std::move(ls), std::forward<U>(arg)}); | 209 | local_rtrees_[z].insert(index_value{blse, std::move(ls), std::forward<U>(arg)}); |
| 210 | } | 210 | } |
| @@ -228,7 +228,11 @@ public: | |||
| 228 | for (auto it = local_rtrees_[ls.zone].qbegin(bgeo::index::intersects(ls)); | 228 | for (auto it = local_rtrees_[ls.zone].qbegin(bgeo::index::intersects(ls)); |
| 229 | it != local_rtrees_[ls.zone].qend(); it++) | 229 | it != local_rtrees_[ls.zone].qend(); it++) |
| 230 | { | 230 | { |
| 231 | if (bgeo::intersects(ls, std::get<1>(*it))) | 231 | using multi_linestring = bgeo::model::multi_linestring<utm::zone_local::prim::linestring>; |
| 232 | |||
| 233 | auto relevant_ls_parts = multi_linestring{}; | ||
| 234 | bgeo::intersection(std::get<0>(*it), static_cast<utm::zone_local::prim::linestring const&>(ls), relevant_ls_parts); | ||
| 235 | if (bgeo::distance(relevant_ls_parts, std::get<1>(*it)) < 30.0 /* m */) | ||
| 232 | { | 236 | { |
| 233 | co_yield std::get<2>(*it); | 237 | co_yield std::get<2>(*it); |
| 234 | } | 238 | } |