3#ifndef BOAT_GEOMETRY_VOCABULARY_HPP
4#define BOAT_GEOMETRY_VOCABULARY_HPP
6#include <boat/detail/utility.hpp>
7#include <boost/geometry.hpp>
8#include <boost/geometry/geometries/adapted/std_variant.hpp>
9#include <boost/geometry/srs/epsg.hpp>
10#include <boost/geometry/srs/transformation.hpp>
15namespace model = boost::geometry::model;
16namespace srs = boost::geometry::srs;
19using tag = boost::geometry::tag<T>::type;
22constexpr bool has_tag = !std::is_same_v<tag<T>,
void>;
31constexpr bool is_srs_spec = std::is_constructible_v<srs::projection<>, T>;
40concept box = std::same_as<tag<T>, boost::geometry::box_tag>;
43concept dynamic = std::same_as<tag<T>, boost::geometry::dynamic_geometry_tag>;
46concept linestring = std::same_as<tag<T>, boost::geometry::linestring_tag>;
49concept multi = std::derived_from<tag<T>, boost::geometry::multi_tag>;
52concept multi_point = std::same_as<tag<T>, boost::geometry::multi_point_tag>;
55concept point = std::same_as<tag<T>, boost::geometry::point_tag>;
58concept polygon = std::same_as<tag<T>, boost::geometry::polygon_tag>;
60template <
class T,
class U>
64concept single = std::derived_from<tag<T>, boost::geometry::single_tag>;
71 specialized<T, srs::projection> || specialized<T, srs::transformation>;
73template <
class CoordSys>
75 using point = model::d2::point_xy<double, CoordSys>;
77 using polygon = model::polygon<point, false, true>;
81 using box = model::box<point>;
83 using grid = std::map<double, multi_point>;
103 return {g.x(), g.y()};
108 return {(*this)(g.min_corner()), (*this)(g.max_corner())};
114using matrix = boost::qvm::mat<double, 3, 3>;
129 requires requires {
typename T::boat_geometry_tag; }
130struct boost::geometry::traits::tag<T> {
131 using type = T::boat_geometry_tag;
Definition vocabulary.hpp:40
Definition vocabulary.hpp:67
Definition vocabulary.hpp:43
Definition vocabulary.hpp:46
Definition vocabulary.hpp:52
Definition vocabulary.hpp:49
Definition vocabulary.hpp:121
Definition vocabulary.hpp:55
Definition vocabulary.hpp:58
Definition vocabulary.hpp:61
Definition vocabulary.hpp:64
Definition vocabulary.hpp:37
Definition vocabulary.hpp:28
Definition algorithm.hpp:9
constexpr bool is_srs_spec
Definition vocabulary.hpp:31
std::variant< srs::epsg, srs::proj4 > srs_variant
Definition vocabulary.hpp:115
d2< boost::geometry::cs::geographic< boost::geometry::degree > > geographic
Definition vocabulary.hpp:113
constexpr bool has_tag
Definition vocabulary.hpp:22
constexpr auto variant_index_v
Definition vocabulary.hpp:124
d2< typename boost::geometry::coordinate_system< T >::type > d2_of
Definition vocabulary.hpp:118
boost::geometry::tag< T >::type tag
Definition vocabulary.hpp:19
d2< boost::geometry::cs::cartesian > cartesian
Definition vocabulary.hpp:112
boost::qvm::mat< double, 3, 3 > matrix
Definition vocabulary.hpp:114
Definition vocabulary.hpp:96
boost::geometry::geometry_collection_tag boat_geometry_tag
Definition vocabulary.hpp:98
Definition vocabulary.hpp:74
model::multi_polygon< polygon > multi_polygon
Definition vocabulary.hpp:80
d2< CoordSys >::box operator()(geometry::box auto const &g) const
Definition vocabulary.hpp:106
std::variant< point, linestring, polygon, multi_point, multi_linestring, multi_polygon, geometry_collection > variant
Definition vocabulary.hpp:87
model::d2::point_xy< double, CoordSys > point
Definition vocabulary.hpp:75
model::segment< point > segment
Definition vocabulary.hpp:82
std::map< double, multi_point > grid
Definition vocabulary.hpp:83
d2< CoordSys >::point operator()(geometry::point auto const &g) const
Definition vocabulary.hpp:101
model::multi_linestring< linestring > multi_linestring
Definition vocabulary.hpp:79
model::box< point > box
Definition vocabulary.hpp:81
T::boat_geometry_tag type
Definition vocabulary.hpp:131