From 1417e6cf41d27c594d2bdc92f87746d2383a1b1d Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Tue, 8 Sep 2026 13:54:40 +0200 Subject: Some cleanups --- server/src/geo/utm_zone_local.cppm | 103 +++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 44 deletions(-) (limited to 'server/src/geo/utm_zone_local.cppm') diff --git a/server/src/geo/utm_zone_local.cppm b/server/src/geo/utm_zone_local.cppm index 98a1344..b2147ad 100644 --- a/server/src/geo/utm_zone_local.cppm +++ b/server/src/geo/utm_zone_local.cppm @@ -11,35 +11,32 @@ import :geo.utm; // Coordinates that are local to some known UTM zone. namespace routemon::geo::utm::zone_local { - using cs = bgeo::cs::cartesian; +using cs = bgeo::cs::cartesian; - namespace prim { +namespace prim { - using point = bgeo::model::d2::point_xy; - using linestring = bgeo::model::linestring; - using box = bgeo::model::box; +using point = bgeo::model::d2::point_xy; +using linestring = bgeo::model::linestring; +using box = bgeo::model::box; - } // namespace prim +} // namespace prim - struct point : public prim::point - { - zone zone; - - explicit point(class zone zone, double x, double y) - : prim::point{x, y}, zone{zone} - { - } - }; +struct point : public prim::point +{ + zone zone; - struct linestring : public prim::linestring + explicit inline point(class zone zone, double x, double y) + : prim::point{x, y}, zone{zone} { - zone zone; + } +}; + +struct linestring : public prim::linestring +{ + zone zone; - explicit linestring(class zone zone) - : zone{zone} - { - } - }; + explicit inline linestring(class zone zone) : zone{zone} {} +}; } // namespace routemon::geo::utm::zone_local @@ -47,28 +44,46 @@ BOOST_GEOMETRY_REGISTER_LINESTRING(routemon::geo::utm::zone_local::linestring) namespace boost::geometry::traits { - namespace { - - using zone_local_point = routemon::geo::utm::zone_local::point; - - } // namespace - - template<> struct tag { using type = point_tag; }; - template<> struct dimension : boost::mpl::int_<2> {}; - template<> struct coordinate_type { using type = double; }; - template<> struct coordinate_system { using type = routemon::geo::utm::zone_local::cs; }; - - template - struct access { - static inline auto get(zone_local_point const& p) -> double - { - return bgeo::get(static_cast(p)); - } +namespace { + +using zone_local_point = routemon::geo::utm::zone_local::point; + +} // namespace + +template <> +struct tag +{ + using type = point_tag; +}; +template <> +struct dimension : boost::mpl::int_<2> +{ +}; +template <> +struct coordinate_type +{ + using type = double; +}; +template <> +struct coordinate_system +{ + using type = routemon::geo::utm::zone_local::cs; +}; + +template +struct access +{ + static inline auto get(zone_local_point const& p) -> double + { + return bgeo::get( + static_cast(p)); + } - static inline auto set(zone_local_point& p, double v) -> void - { - return bgeo::set(static_cast(p), v); - } - }; + static inline auto set(zone_local_point& p, double v) -> void + { + return bgeo::set( + static_cast(p), v); + } +}; } // namespace boost::geometry::traits -- cgit v1.3